drm: Ensure universal_planes is set for atomic
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Dec 2014 09:33:52 +0000 (10:33 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 5 Jan 2015 12:55:30 +0000 (13:55 +0100)
Atomic doesn't really work without universal planes anyway. But make
sure that evil userspace doesn't pull the kernel over the table
because we didn't consider a cornercase that just doesn't make sense,
just for safety.

v2: Just force ->universal_planes to the same value to avoid imposing
restrictions on userspace.

Cc: Rob Clark <robdclark@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
drivers/gpu/drm/drm_ioctl.c

index 5cb40581224579d059375937baed779f33f6a4bc..3785d66721f2f6fdba2d134ba8eaa0c9ab8fb416 100644 (file)
@@ -355,6 +355,7 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
                if (req->value > 1)
                        return -EINVAL;
                file_priv->atomic = req->value;
+               file_priv->universal_planes = req->value;
                break;
        default:
                return -EINVAL;