drm: Kill DRM_SUSER

Checking directly for the right capability is simpler. Also this rids
us of a few places that use DRM_CURRENTPID.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Daniel Vetter 2013-12-11 11:34:46 +01:00 committed by Dave Airlie
parent 85b2331b34
commit 4cda878b12
3 changed files with 3 additions and 4 deletions

View File

@ -593,7 +593,7 @@ int ttm_bo_kmap(struct ttm_buffer_object *bo,
if (start_page > bo->num_pages) if (start_page > bo->num_pages)
return -EINVAL; return -EINVAL;
#if 0 #if 0
if (num_pages > 1 && !DRM_SUSER(DRM_CURPROC)) if (num_pages > 1 && !capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
#endif #endif
(void) ttm_mem_io_lock(man, false); (void) ttm_mem_io_lock(man, false);

View File

@ -234,13 +234,13 @@ static int via_dma_init(struct drm_device *dev, void *data, struct drm_file *fil
switch (init->func) { switch (init->func) {
case VIA_INIT_DMA: case VIA_INIT_DMA:
if (!DRM_SUSER(DRM_CURPROC)) if (!capable(CAP_SYS_ADMIN))
retcode = -EPERM; retcode = -EPERM;
else else
retcode = via_initialize(dev, dev_priv, init); retcode = via_initialize(dev, dev_priv, init);
break; break;
case VIA_CLEANUP_DMA: case VIA_CLEANUP_DMA:
if (!DRM_SUSER(DRM_CURPROC)) if (!capable(CAP_SYS_ADMIN))
retcode = -EPERM; retcode = -EPERM;
else else
retcode = via_dma_cleanup(dev); retcode = via_dma_cleanup(dev);

View File

@ -21,7 +21,6 @@ static inline void writeq(u64 val, void __iomem *reg)
/** Current process ID */ /** Current process ID */
#define DRM_CURRENTPID task_pid_nr(current) #define DRM_CURRENTPID task_pid_nr(current)
#define DRM_SUSER(p) capable(CAP_SYS_ADMIN)
#define DRM_UDELAY(d) udelay(d) #define DRM_UDELAY(d) udelay(d)
/** Read a byte from a MMIO region */ /** Read a byte from a MMIO region */
#define DRM_READ8(map, offset) readb(((void __iomem *)(map)->handle) + (offset)) #define DRM_READ8(map, offset) readb(((void __iomem *)(map)->handle) + (offset))