Skip to content

Commit

Permalink
drm: Reject DRI1 hw lock ioctl functions for kms drivers
Browse files Browse the repository at this point in the history
I've done some extensive history digging across libdrm, mesa and
xf86-video-{intel,nouveau,ati}. The only potential user of this with
kms drivers I could find was ttmtest, which once used drmGetLock
still. But that mistake was quickly fixed up. Even the intel xvmc
library (which otherwise was really good with using dri1 stuff in kms
mode) managed to never take the hw lock for dri2 (and hence kms).

Hence it should be save to unconditionally disallow this.

Cc: Peter Antoine <peter.antoine@intel.com>
Reviewed-by: Peter Antoine <peter.antoine@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
  • Loading branch information
Daniel Vetter committed Jul 2, 2015
1 parent ba6976c commit da168d8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/drm_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ int drm_legacy_lock(struct drm_device *dev, void *data,
struct drm_master *master = file_priv->master;
int ret = 0;

if (drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

++file_priv->lock_count;

if (lock->context == DRM_KERNEL_CONTEXT) {
Expand Down Expand Up @@ -153,6 +156,9 @@ int drm_legacy_unlock(struct drm_device *dev, void *data, struct drm_file *file_
struct drm_lock *lock = data;
struct drm_master *master = file_priv->master;

if (drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

if (lock->context == DRM_KERNEL_CONTEXT) {
DRM_ERROR("Process %d using kernel context %d\n",
task_pid_nr(current), lock->context);
Expand Down

0 comments on commit da168d8

Please sign in to comment.