diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2010-11-02 09:21:48 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-08 22:39:06 -0500 |
commit | 29e190e049168b01dc5fa26d577ef99cafd753ee (patch) | |
tree | e8e6a543caa6ad85bd2e3467f0326a8d27ef777c /drivers/gpu/drm/ttm | |
parent | aa123268c2623c62e33248dafc0572f091689e86 (diff) |
drm/ttm: Remove the CAP_SYS_ADMIN requirement for bo pinning
This breaks vmwgfx non-root EGL clients and is a remnant from the
TTM user-space interface. This test should be done in the driver.
Replace the remaining placement test with a BUG_ON, since triggering
it is a driver bug.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 340dfb11959d..ce464579c485 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
@@ -1119,35 +1119,9 @@ EXPORT_SYMBOL(ttm_bo_validate); | |||
1119 | int ttm_bo_check_placement(struct ttm_buffer_object *bo, | 1119 | int ttm_bo_check_placement(struct ttm_buffer_object *bo, |
1120 | struct ttm_placement *placement) | 1120 | struct ttm_placement *placement) |
1121 | { | 1121 | { |
1122 | int i; | 1122 | BUG_ON((placement->fpfn || placement->lpfn) && |
1123 | (bo->mem.num_pages > (placement->lpfn - placement->fpfn))); | ||
1123 | 1124 | ||
1124 | if (placement->fpfn || placement->lpfn) { | ||
1125 | if (bo->mem.num_pages > (placement->lpfn - placement->fpfn)) { | ||
1126 | printk(KERN_ERR TTM_PFX "Page number range to small " | ||
1127 | "Need %lu pages, range is [%u, %u]\n", | ||
1128 | bo->mem.num_pages, placement->fpfn, | ||
1129 | placement->lpfn); | ||
1130 | return -EINVAL; | ||
1131 | } | ||
1132 | } | ||
1133 | for (i = 0; i < placement->num_placement; i++) { | ||
1134 | if (!capable(CAP_SYS_ADMIN)) { | ||
1135 | if (placement->placement[i] & TTM_PL_FLAG_NO_EVICT) { | ||
1136 | printk(KERN_ERR TTM_PFX "Need to be root to " | ||
1137 | "modify NO_EVICT status.\n"); | ||
1138 | return -EINVAL; | ||
1139 | } | ||
1140 | } | ||
1141 | } | ||
1142 | for (i = 0; i < placement->num_busy_placement; i++) { | ||
1143 | if (!capable(CAP_SYS_ADMIN)) { | ||
1144 | if (placement->busy_placement[i] & TTM_PL_FLAG_NO_EVICT) { | ||
1145 | printk(KERN_ERR TTM_PFX "Need to be root to " | ||
1146 | "modify NO_EVICT status.\n"); | ||
1147 | return -EINVAL; | ||
1148 | } | ||
1149 | } | ||
1150 | } | ||
1151 | return 0; | 1125 | return 0; |
1152 | } | 1126 | } |
1153 | 1127 | ||