drm: Used DRM_LEGACY for all legacy functions
Except for nouveau, only legacy drivers need this really. And nouveau is already marked up with DRIVER_KMS_LEGACY_CONTEXT as the special case. I've tried to be careful to leave everything related to modeset still using the DRIVER_MODESET flag. Otherwise it's a direct replacement of !DRIVER_MODESET with DRIVER_LEGACY checks. Also helps readability since fewer negative checks overall. Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Frank Binns <frank.binns@imgtec.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470251470-30830-2-git-send-email-daniel.vetter@ffwll.ch
This commit is contained in:
@@ -397,7 +397,7 @@ int drm_legacy_addmap_ioctl(struct drm_device *dev, void *data,
|
||||
return -EPERM;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
|
||||
drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
err = drm_addmap_core(dev, map->offset, map->size, map->type,
|
||||
@@ -443,7 +443,7 @@ int drm_legacy_getmap_ioctl(struct drm_device *dev, void *data,
|
||||
int i;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
|
||||
drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
idx = map->offset;
|
||||
@@ -545,7 +545,7 @@ EXPORT_SYMBOL(drm_legacy_rmmap_locked);
|
||||
void drm_legacy_rmmap(struct drm_device *dev, struct drm_local_map *map)
|
||||
{
|
||||
if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
|
||||
drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return;
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
@@ -558,7 +558,7 @@ void drm_legacy_master_rmmaps(struct drm_device *dev, struct drm_master *master)
|
||||
{
|
||||
struct drm_map_list *r_list, *list_temp;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return;
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
@@ -595,7 +595,7 @@ int drm_legacy_rmmap_ioctl(struct drm_device *dev, void *data,
|
||||
int ret;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
|
||||
drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
@@ -1220,7 +1220,7 @@ int drm_legacy_addbufs(struct drm_device *dev, void *data,
|
||||
struct drm_buf_desc *request = data;
|
||||
int ret;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
|
||||
@@ -1266,7 +1266,7 @@ int drm_legacy_infobufs(struct drm_device *dev, void *data,
|
||||
int i;
|
||||
int count;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
|
||||
@@ -1347,7 +1347,7 @@ int drm_legacy_markbufs(struct drm_device *dev, void *data,
|
||||
int order;
|
||||
struct drm_buf_entry *entry;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
|
||||
@@ -1395,7 +1395,7 @@ int drm_legacy_freebufs(struct drm_device *dev, void *data,
|
||||
int idx;
|
||||
struct drm_buf *buf;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
|
||||
@@ -1450,7 +1450,7 @@ int drm_legacy_mapbufs(struct drm_device *dev, void *data,
|
||||
struct drm_buf_map *request = data;
|
||||
int i;
|
||||
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
if (!drm_core_check_feature(dev, DRIVER_HAVE_DMA))
|
||||
@@ -1530,7 +1530,7 @@ int drm_legacy_mapbufs(struct drm_device *dev, void *data,
|
||||
int drm_legacy_dma_ioctl(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv)
|
||||
{
|
||||
if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||
return -EINVAL;
|
||||
|
||||
if (dev->driver->dma_ioctl)
|
||||
|
مرجع در شماره جدید
Block a user