Skip to content

Commit 00d6dc3

Browse files
committed
drm/i915/stolen: shuffle around init_memory_region
We generally want to first call i915_gem_object_init_memory_region() before calling into get_pages(), since this sets up various bits of state which might be needed there. Currently for stolen this doesn't matter much, but it might in the future, and at the very least this makes things consistent with the other backends. Signed-off-by: Matthew Auld <[email protected]> Cc: Thomas Hellström <[email protected]> Reviewed-by: Tvrtko Ursulin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent e49a8b2 commit 00d6dc3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/i915/gem/i915_gem_stolen.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,9 +657,11 @@ static int __i915_gem_object_create_stolen(struct intel_memory_region *mem,
657657
if (WARN_ON(!i915_gem_object_trylock(obj)))
658658
return -EBUSY;
659659

660+
i915_gem_object_init_memory_region(obj, mem);
661+
660662
err = i915_gem_object_pin_pages(obj);
661-
if (!err)
662-
i915_gem_object_init_memory_region(obj, mem);
663+
if (err)
664+
i915_gem_object_release_memory_region(obj);
663665
i915_gem_object_unlock(obj);
664666

665667
return err;

0 commit comments

Comments
 (0)