Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/gem: Flush lmem contents after construction
@ 2023-03-16 16:59 Nirmoy Das
  2023-03-20  0:05 ` Andi Shyti
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Nirmoy Das @ 2023-03-16 16:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, Matthew Auld, stable, Chris Wilson, Nirmoy Das

From: Chris Wilson <chris.p.wilson@linux.intel.com>

i915_gem_object_create_lmem_from_data() lacks the flush of the data
written to lmem to ensure the object is marked as dirty and the writes
flushed to the backing store. Once created, we can immediately release
the obj->mm.mapping caching of the vmap.

Fixes: 7acbbc7cf485 ("drm/i915/guc: put all guc objects in lmem when available")
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Andi Shyti <andi.shyti@linux.intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com>
Cc: <stable@vger.kernel.org> # v5.16+
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_lmem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_lmem.c b/drivers/gpu/drm/i915/gem/i915_gem_lmem.c
index 8949fb0a944f..3198b64ad7db 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_lmem.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_lmem.c
@@ -127,7 +127,8 @@ i915_gem_object_create_lmem_from_data(struct drm_i915_private *i915,
 
 	memcpy(map, data, size);
 
-	i915_gem_object_unpin_map(obj);
+	i915_gem_object_flush_map(obj);
+	__i915_gem_object_release_map(obj);
 
 	return obj;
 }
-- 
2.39.0


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

end of thread, other threads:[~2023-03-23 11:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-16 16:59 [Intel-gfx] [PATCH] drm/i915/gem: Flush lmem contents after construction Nirmoy Das
2023-03-20  0:05 ` Andi Shyti
2023-03-21  2:59 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/gem: Flush lmem contents after construction (rev2) Patchwork
2023-03-21  2:59 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-03-21  3:00 ` [Intel-gfx] ✗ Fi.CI.DOCS: " Patchwork
2023-03-21  3:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-21  6:29 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-03-23 11:17 ` [Intel-gfx] [PATCH] drm/i915/gem: Flush lmem contents after construction Das, Nirmoy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox