Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Daniel Vetter and committed by
Dave Airlie
4cda878b 85b2331b

+3 -4
+1 -1
drivers/gpu/drm/ttm/ttm_bo_util.c
··· 593 593 if (start_page > bo->num_pages) 594 594 return -EINVAL; 595 595 #if 0 596 - if (num_pages > 1 && !DRM_SUSER(DRM_CURPROC)) 596 + if (num_pages > 1 && !capable(CAP_SYS_ADMIN)) 597 597 return -EPERM; 598 598 #endif 599 599 (void) ttm_mem_io_lock(man, false);
+2 -2
drivers/gpu/drm/via/via_dma.c
··· 234 234 235 235 switch (init->func) { 236 236 case VIA_INIT_DMA: 237 - if (!DRM_SUSER(DRM_CURPROC)) 237 + if (!capable(CAP_SYS_ADMIN)) 238 238 retcode = -EPERM; 239 239 else 240 240 retcode = via_initialize(dev, dev_priv, init); 241 241 break; 242 242 case VIA_CLEANUP_DMA: 243 - if (!DRM_SUSER(DRM_CURPROC)) 243 + if (!capable(CAP_SYS_ADMIN)) 244 244 retcode = -EPERM; 245 245 else 246 246 retcode = via_dma_cleanup(dev);
-1
include/drm/drm_os_linux.h
··· 21 21 22 22 /** Current process ID */ 23 23 #define DRM_CURRENTPID task_pid_nr(current) 24 - #define DRM_SUSER(p) capable(CAP_SYS_ADMIN) 25 24 #define DRM_UDELAY(d) udelay(d) 26 25 /** Read a byte from a MMIO region */ 27 26 #define DRM_READ8(map, offset) readb(((void __iomem *)(map)->handle) + (offset))