All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/stolen: shuffle around init_memory_region
@ 2021-05-07  9:59 ` Matthew Auld
  0 siblings, 0 replies; 6+ messages in thread
From: Matthew Auld @ 2021-05-07  9:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: Thomas Hellström, dri-devel

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 <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
index 293f640faa0a..b5553fc3ac4d 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_stolen.c
@@ -657,9 +657,11 @@ static int __i915_gem_object_create_stolen(struct intel_memory_region *mem,
 	if (WARN_ON(!i915_gem_object_trylock(obj)))
 		return -EBUSY;
 
+	i915_gem_object_init_memory_region(obj, mem);
+
 	err = i915_gem_object_pin_pages(obj);
-	if (!err)
-		i915_gem_object_init_memory_region(obj, mem);
+	if (err)
+		i915_gem_object_release_memory_region(obj);
 	i915_gem_object_unlock(obj);
 
 	return err;
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-10  9:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  9:59 [PATCH] drm/i915/stolen: shuffle around init_memory_region Matthew Auld
2021-05-07  9:59 ` [Intel-gfx] " Matthew Auld
2021-05-07 15:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2021-05-07 18:35 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-05-10  9:17 ` [Intel-gfx] [PATCH] " Tvrtko Ursulin
2021-05-10  9:17   ` Tvrtko Ursulin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.