diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-12-11 05:34:46 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-12-17 20:35:45 -0500 |
commit | 4cda878b129aa873bc7c83c61f2a8d830b138de6 (patch) | |
tree | a4b52883b5128a9ddccca73b17405f8f95a207fb | |
parent | 85b2331b3437a55c21cce3ee1ea0bd12301ecb56 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo_util.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/via/via_dma.c | 4 | ||||
-rw-r--r-- | include/drm/drm_os_linux.h | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 15b86a94949d..99aab8639089 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c | |||
@@ -593,7 +593,7 @@ int ttm_bo_kmap(struct ttm_buffer_object *bo, | |||
593 | if (start_page > bo->num_pages) | 593 | if (start_page > bo->num_pages) |
594 | return -EINVAL; | 594 | return -EINVAL; |
595 | #if 0 | 595 | #if 0 |
596 | if (num_pages > 1 && !DRM_SUSER(DRM_CURPROC)) | 596 | if (num_pages > 1 && !capable(CAP_SYS_ADMIN)) |
597 | return -EPERM; | 597 | return -EPERM; |
598 | #endif | 598 | #endif |
599 | (void) ttm_mem_io_lock(man, false); | 599 | (void) ttm_mem_io_lock(man, false); |
diff --git a/drivers/gpu/drm/via/via_dma.c b/drivers/gpu/drm/via/via_dma.c index 5d4179284964..a18479c6b6da 100644 --- a/drivers/gpu/drm/via/via_dma.c +++ b/drivers/gpu/drm/via/via_dma.c | |||
@@ -234,13 +234,13 @@ static int via_dma_init(struct drm_device *dev, void *data, struct drm_file *fil | |||
234 | 234 | ||
235 | switch (init->func) { | 235 | switch (init->func) { |
236 | case VIA_INIT_DMA: | 236 | case VIA_INIT_DMA: |
237 | if (!DRM_SUSER(DRM_CURPROC)) | 237 | if (!capable(CAP_SYS_ADMIN)) |
238 | retcode = -EPERM; | 238 | retcode = -EPERM; |
239 | else | 239 | else |
240 | retcode = via_initialize(dev, dev_priv, init); | 240 | retcode = via_initialize(dev, dev_priv, init); |
241 | break; | 241 | break; |
242 | case VIA_CLEANUP_DMA: | 242 | case VIA_CLEANUP_DMA: |
243 | if (!DRM_SUSER(DRM_CURPROC)) | 243 | if (!capable(CAP_SYS_ADMIN)) |
244 | retcode = -EPERM; | 244 | retcode = -EPERM; |
245 | else | 245 | else |
246 | retcode = via_dma_cleanup(dev); | 246 | retcode = via_dma_cleanup(dev); |
diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h index 43008938b6b2..86ab99bc0ac5 100644 --- a/include/drm/drm_os_linux.h +++ b/include/drm/drm_os_linux.h | |||
@@ -21,7 +21,6 @@ static inline void writeq(u64 val, void __iomem *reg) | |||
21 | 21 | ||
22 | /** Current process ID */ | 22 | /** Current process ID */ |
23 | #define DRM_CURRENTPID task_pid_nr(current) | 23 | #define DRM_CURRENTPID task_pid_nr(current) |
24 | #define DRM_SUSER(p) capable(CAP_SYS_ADMIN) | ||
25 | #define DRM_UDELAY(d) udelay(d) | 24 | #define DRM_UDELAY(d) udelay(d) |
26 | /** Read a byte from a MMIO region */ | 25 | /** Read a byte from a MMIO region */ |
27 | #define DRM_READ8(map, offset) readb(((void __iomem *)(map)->handle) + (offset)) | 26 | #define DRM_READ8(map, offset) readb(((void __iomem *)(map)->handle) + (offset)) |