Skip to contentSkip to conversation

drm: Require universal_planes for atomic

PATCH New Daniel Vetter 1 participant 2 messages Dec 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Require universal_planes for atomic

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.

Only requirement imposed on userspace by this is that it asks for universal planes before it asks for atomic.

---
 drivers/gpu/drm/drm_ioctl.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_ioctl.c +2 -0
index 5cb405812245..255bf5d45037 100644
@@ -350,6 +350,8 @@ drm_setclientcap(struct drm_device *dev, void *data, struct drm_file *file_priv)
 		/* for now, hide behind experimental drm.atomic moduleparam */
 		if (!drm_atomic)
 			return -EINVAL;
+		if (!file_priv->universal_planes)
+			return -EINVAL;
 		if (!drm_core_check_feature(dev, DRIVER_ATOMIC))
 			return -EINVAL;
 		if (req->value > 1)
Signature · 6 lines
2.1.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 1/1 drm: Ensure universal_planes is set for atomic

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.

---
 drivers/gpu/drm/drm_ioctl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_ioctl.c +1 -0
index 5cb405812245..3785d66721f2 100644
@@ -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;
Signature · 6 lines
2.1.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel