|
@@ -396,6 +396,10 @@ int drm_legacy_addmap_ioctl(struct drm_device *dev, void *data,
|
|
if (!(capable(CAP_SYS_ADMIN) || map->type == _DRM_AGP || map->type == _DRM_SHM))
|
|
if (!(capable(CAP_SYS_ADMIN) || map->type == _DRM_AGP || map->type == _DRM_SHM))
|
|
return -EPERM;
|
|
return -EPERM;
|
|
|
|
|
|
|
|
+ if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
|
|
|
|
+ drm_core_check_feature(dev, DRIVER_MODESET))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
err = drm_addmap_core(dev, map->offset, map->size, map->type,
|
|
err = drm_addmap_core(dev, map->offset, map->size, map->type,
|
|
map->flags, &maplist);
|
|
map->flags, &maplist);
|
|
|
|
|
|
@@ -438,6 +442,10 @@ int drm_legacy_getmap_ioctl(struct drm_device *dev, void *data,
|
|
int idx;
|
|
int idx;
|
|
int i;
|
|
int i;
|
|
|
|
|
|
|
|
+ if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
|
|
|
|
+ drm_core_check_feature(dev, DRIVER_MODESET))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
idx = map->offset;
|
|
idx = map->offset;
|
|
if (idx < 0)
|
|
if (idx < 0)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
@@ -569,6 +577,10 @@ int drm_legacy_rmmap_ioctl(struct drm_device *dev, void *data,
|
|
struct drm_map_list *r_list;
|
|
struct drm_map_list *r_list;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
|
|
+ if (!drm_core_check_feature(dev, DRIVER_KMS_LEGACY_CONTEXT) &&
|
|
|
|
+ drm_core_check_feature(dev, DRIVER_MODESET))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
mutex_lock(&dev->struct_mutex);
|
|
mutex_lock(&dev->struct_mutex);
|
|
list_for_each_entry(r_list, &dev->maplist, head) {
|
|
list_for_each_entry(r_list, &dev->maplist, head) {
|
|
if (r_list->map &&
|
|
if (r_list->map &&
|