Skip to content

Commit cefb919

Browse files
robclarkRob Clark
authored andcommitted
drm/msm: Use DMA_RESV_USAGE_BOOKKEEP/KERNEL
Any place we wait for a BO to become idle, we should use BOOKKEEP usage, to ensure that it waits for _any_ activity. Signed-off-by: Rob Clark <robdclark@chromium.org> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Tested-by: Antonino Maniscalco <antomani103@gmail.com> Reviewed-by: Antonino Maniscalco <antomani103@gmail.com> Patchwork: https://patchwork.freedesktop.org/patch/661506/
1 parent e1341f9 commit cefb919

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/gpu/drm/msm/msm_gem.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ static void msm_gem_close(struct drm_gem_object *obj, struct drm_file *file)
9393
* TODO we might need to kick this to a queue to avoid blocking
9494
* in CLOSE ioctl
9595
*/
96-
dma_resv_wait_timeout(obj->resv, DMA_RESV_USAGE_READ, false,
97-
msecs_to_jiffies(1000));
96+
dma_resv_wait_timeout(obj->resv, DMA_RESV_USAGE_BOOKKEEP, false,
97+
MAX_SCHEDULE_TIMEOUT);
9898

9999
msm_gem_lock_vm_and_obj(&exec, obj, ctx->vm);
100100
put_iova_spaces(obj, ctx->vm, true);
@@ -895,7 +895,7 @@ bool msm_gem_active(struct drm_gem_object *obj)
895895
if (to_msm_bo(obj)->pin_count)
896896
return true;
897897

898-
return !dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true));
898+
return !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_BOOKKEEP);
899899
}
900900

901901
int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout)

drivers/gpu/drm/msm/msm_gem_shrinker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ evict(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket)
139139
static bool
140140
wait_for_idle(struct drm_gem_object *obj)
141141
{
142-
enum dma_resv_usage usage = dma_resv_usage_rw(true);
142+
enum dma_resv_usage usage = DMA_RESV_USAGE_BOOKKEEP;
143143
return dma_resv_wait_timeout(obj->resv, usage, false, 10) > 0;
144144
}
145145

0 commit comments

Comments
 (0)