From: Christian König Date: Thu, 24 Nov 2022 12:30:18 +0000 (+0100) Subject: drm/i915: stop using ttm_bo_wait X-Git-Tag: v6.6.17~3937^2~23^2~1133 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58377de46eee1e0066c93f659c91a809432d024c;p=platform%2Fkernel%2Flinux-rpi.git drm/i915: stop using ttm_bo_wait TTM is just wrapping core DMA functionality here, remove the mid-layer. No functional change. Signed-off-by: Christian König Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20221125102137.1801-7-christian.koenig@amd.com --- diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 5247d88..d409a77 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -599,13 +599,16 @@ i915_ttm_resource_get_st(struct drm_i915_gem_object *obj, static int i915_ttm_truncate(struct drm_i915_gem_object *obj) { struct ttm_buffer_object *bo = i915_gem_to_ttm(obj); - int err; + long err; WARN_ON_ONCE(obj->mm.madv == I915_MADV_WILLNEED); - err = ttm_bo_wait(bo, true, false); - if (err) + err = dma_resv_wait_timeout(bo->base.resv, DMA_RESV_USAGE_BOOKKEEP, + true, 15 * HZ); + if (err < 0) return err; + if (err == 0) + return -EBUSY; err = i915_ttm_move_notify(bo); if (err)