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/
This commit is contained in:
@@ -93,8 +93,8 @@ static void msm_gem_close(struct drm_gem_object *obj, struct drm_file *file)
|
||||
* TODO we might need to kick this to a queue to avoid blocking
|
||||
* in CLOSE ioctl
|
||||
*/
|
||||
dma_resv_wait_timeout(obj->resv, DMA_RESV_USAGE_READ, false,
|
||||
msecs_to_jiffies(1000));
|
||||
dma_resv_wait_timeout(obj->resv, DMA_RESV_USAGE_BOOKKEEP, false,
|
||||
MAX_SCHEDULE_TIMEOUT);
|
||||
|
||||
msm_gem_lock_vm_and_obj(&exec, obj, ctx->vm);
|
||||
put_iova_spaces(obj, ctx->vm, true);
|
||||
@@ -895,7 +895,7 @@ bool msm_gem_active(struct drm_gem_object *obj)
|
||||
if (to_msm_bo(obj)->pin_count)
|
||||
return true;
|
||||
|
||||
return !dma_resv_test_signaled(obj->resv, dma_resv_usage_rw(true));
|
||||
return !dma_resv_test_signaled(obj->resv, DMA_RESV_USAGE_BOOKKEEP);
|
||||
}
|
||||
|
||||
int msm_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, ktime_t *timeout)
|
||||
|
||||
@@ -139,7 +139,7 @@ evict(struct drm_gem_object *obj, struct ww_acquire_ctx *ticket)
|
||||
static bool
|
||||
wait_for_idle(struct drm_gem_object *obj)
|
||||
{
|
||||
enum dma_resv_usage usage = dma_resv_usage_rw(true);
|
||||
enum dma_resv_usage usage = DMA_RESV_USAGE_BOOKKEEP;
|
||||
return dma_resv_wait_timeout(obj->resv, usage, false, 10) > 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user