Commit 8d38c4b4 authored by Daniel Vetter's avatar Daniel Vetter Committed by Dave Airlie

drm: disallow legacy dma ioctls for modesetting drivers

Now only legacy ums drivers have the DRIVER_HAVE_DMA driver feature
flag set, so strictly speaking the modesetting check is redundant. But
adding it has the upside that it makes it very clear that the dma
support is legacy stuff.
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent e2e99a82
...@@ -1305,6 +1305,9 @@ int drm_addbufs(struct drm_device *dev, void *data, ...@@ -1305,6 +1305,9 @@ int drm_addbufs(struct drm_device *dev, void *data,
struct drm_buf_desc *request = data; struct drm_buf_desc *request = data;
int ret; int ret;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
return -EINVAL; return -EINVAL;
...@@ -1348,6 +1351,9 @@ int drm_infobufs(struct drm_device *dev, void *data, ...@@ -1348,6 +1351,9 @@ int drm_infobufs(struct drm_device *dev, void *data,
int i; int i;
int count; int count;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
return -EINVAL; return -EINVAL;
...@@ -1427,6 +1433,9 @@ int drm_markbufs(struct drm_device *dev, void *data, ...@@ -1427,6 +1433,9 @@ int drm_markbufs(struct drm_device *dev, void *data,
int order; int order;
struct drm_buf_entry *entry; struct drm_buf_entry *entry;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
return -EINVAL; return -EINVAL;
...@@ -1472,6 +1481,9 @@ int drm_freebufs(struct drm_device *dev, void *data, ...@@ -1472,6 +1481,9 @@ int drm_freebufs(struct drm_device *dev, void *data,
int idx; int idx;
struct drm_buf *buf; struct drm_buf *buf;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
return -EINVAL; return -EINVAL;
...@@ -1524,6 +1536,9 @@ int drm_mapbufs(struct drm_device *dev, void *data, ...@@ -1524,6 +1536,9 @@ int drm_mapbufs(struct drm_device *dev, void *data,
struct drm_buf_map *request = data; struct drm_buf_map *request = data;
int i; int i;
if (drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA)) if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment