public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/4] drm/i915/clflush: fixup handling of cache_dirty
@ 2021-10-21 11:44 Matthew Auld
  2021-10-21 11:44 ` [Intel-gfx] [PATCH 2/4] drm/i915/clflush: disallow on discrete Matthew Auld
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Matthew Auld @ 2021-10-21 11:44 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, Thomas Hellström

In theory if clflush_work_create() somehow fails here, and we don't yet
have mm.pages populated then we end up resetting cache_dirty, which is
likely wrong, since that will potentially skip the flush-on-acquire, if
it was needed.

It looks like intel_user_framebuffer_dirty() can arrive here before the
pages are populated.

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_clflush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c
index f0435c6feb68..d09365b5eb29 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_clflush.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_clflush.c
@@ -20,6 +20,7 @@ static void __do_clflush(struct drm_i915_gem_object *obj)
 {
 	GEM_BUG_ON(!i915_gem_object_has_pages(obj));
 	drm_clflush_sg(obj->mm.pages);
+	obj->cache_dirty = false;
 
 	i915_gem_object_flush_frontbuffer(obj, ORIGIN_CPU);
 }
@@ -115,6 +116,5 @@ bool i915_gem_clflush_object(struct drm_i915_gem_object *obj,
 		GEM_BUG_ON(obj->write_domain != I915_GEM_DOMAIN_CPU);
 	}
 
-	obj->cache_dirty = false;
 	return true;
 }
-- 
2.26.3


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

end of thread, other threads:[~2021-10-27 11:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-21 11:44 [Intel-gfx] [PATCH 1/4] drm/i915/clflush: fixup handling of cache_dirty Matthew Auld
2021-10-21 11:44 ` [Intel-gfx] [PATCH 2/4] drm/i915/clflush: disallow on discrete Matthew Auld
2021-10-27 11:23   ` Thomas Hellström
2021-10-21 11:44 ` [Intel-gfx] [PATCH 3/4] drm/i915: move cpu_write_needs_clflush Matthew Auld
2021-10-27 11:29   ` Thomas Hellström
2021-10-21 11:44 ` [Intel-gfx] [PATCH 4/4] drm/i915: stop setting cache_dirty on discrete Matthew Auld
2021-10-27 11:30   ` Thomas Hellström
2021-10-21 14:17 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/4] drm/i915/clflush: fixup handling of cache_dirty Patchwork
2021-10-21 14:18 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-10-21 14:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-10-21 17:36 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-10-27 11:21 ` [Intel-gfx] [PATCH 1/4] " Thomas Hellström

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