mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 18:13:41 +02:00
drm/xe/display: Convert __xe_pin_fb_vma()
Convert __xe_pin_fb_vma() for exhaustive eviction using xe_validation_guard(). v2: - Avoid gotos from within xe_validation_guard(). (Matt Brost) - Adapt to signature change of xe_validation_guard(). (Matt Brost) - Use interruptible waiting, since xe_bo_migrate() already does that. Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Link: https://lore.kernel.org/r/20250908101246.65025-8-thomas.hellstrom@linux.intel.com
This commit is contained in:
parent
c2ae94cf8c
commit
7bcb6e38c1
|
|
@ -281,7 +281,8 @@ static struct i915_vma *__xe_pin_fb_vma(const struct intel_framebuffer *fb,
|
||||||
struct i915_vma *vma = kzalloc(sizeof(*vma), GFP_KERNEL);
|
struct i915_vma *vma = kzalloc(sizeof(*vma), GFP_KERNEL);
|
||||||
struct drm_gem_object *obj = intel_fb_bo(&fb->base);
|
struct drm_gem_object *obj = intel_fb_bo(&fb->base);
|
||||||
struct xe_bo *bo = gem_to_xe_bo(obj);
|
struct xe_bo *bo = gem_to_xe_bo(obj);
|
||||||
struct drm_exec *exec = XE_VALIDATION_UNIMPLEMENTED;
|
struct xe_validation_ctx ctx;
|
||||||
|
struct drm_exec exec;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!vma)
|
if (!vma)
|
||||||
|
|
@ -309,17 +310,22 @@ static struct i915_vma *__xe_pin_fb_vma(const struct intel_framebuffer *fb,
|
||||||
* Pin the framebuffer, we can't use xe_bo_(un)pin functions as the
|
* Pin the framebuffer, we can't use xe_bo_(un)pin functions as the
|
||||||
* assumptions are incorrect for framebuffers
|
* assumptions are incorrect for framebuffers
|
||||||
*/
|
*/
|
||||||
ret = ttm_bo_reserve(&bo->ttm, false, false, NULL);
|
xe_validation_guard(&ctx, &xe->val, &exec, (struct xe_val_flags) {.interruptible = true},
|
||||||
if (ret)
|
ret) {
|
||||||
goto err;
|
ret = drm_exec_lock_obj(&exec, &bo->ttm.base);
|
||||||
|
drm_exec_retry_on_contention(&exec);
|
||||||
|
if (ret)
|
||||||
|
break;
|
||||||
|
|
||||||
if (IS_DGFX(xe))
|
if (IS_DGFX(xe))
|
||||||
ret = xe_bo_migrate(bo, XE_PL_VRAM0, NULL, exec);
|
ret = xe_bo_migrate(bo, XE_PL_VRAM0, NULL, &exec);
|
||||||
else
|
else
|
||||||
ret = xe_bo_validate(bo, NULL, true, exec);
|
ret = xe_bo_validate(bo, NULL, true, &exec);
|
||||||
if (!ret)
|
drm_exec_retry_on_contention(&exec);
|
||||||
ttm_bo_pin(&bo->ttm);
|
xe_validation_retry_on_oom(&ctx, &ret);
|
||||||
ttm_bo_unreserve(&bo->ttm);
|
if (!ret)
|
||||||
|
ttm_bo_pin(&bo->ttm);
|
||||||
|
}
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user