diff mbox

[1/2] drm/i915: Unconditionally do fb tracking invalidate in set_domain

Message ID 1435268843-6596-1-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter June 25, 2015, 9:47 p.m. UTC
We can't elide the fb tracking invalidate if the buffer is already in
the right domain since that would lead to missed screen updates. I'm
pretty sure I've written this already before but must have gotten lost
unfortunately :(

Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Chris Wilson June 26, 2015, 7:29 a.m. UTC | #1
On Thu, Jun 25, 2015 at 11:47:22PM +0200, Daniel Vetter wrote:
> We can't elide the fb tracking invalidate if the buffer is already in
> the right domain since that would lead to missed screen updates. I'm
> pretty sure I've written this already before but must have gotten lost
> unfortunately :(
> 
> Reported-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

Note that I have a variant on this that observes that internally users
all honor the fb invalidation and so we can move this into the
set-domain ioctl.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f79ce9f22312..36f5e86f9048 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3940,6 +3940,9 @@  i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
 	struct i915_vma *vma;
 	int ret;
 
+	if (write)
+		intel_fb_obj_invalidate(obj, ORIGIN_GTT);
+
 	if (obj->base.write_domain == I915_GEM_DOMAIN_GTT)
 		return 0;
 
@@ -3982,9 +3985,6 @@  i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
 		obj->dirty = 1;
 	}
 
-	if (write)
-		intel_fb_obj_invalidate(obj, ORIGIN_GTT);
-
 	trace_i915_gem_object_change_domain(obj,
 					    old_read_domains,
 					    old_write_domain);
@@ -4224,6 +4224,9 @@  i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write)
 	uint32_t old_write_domain, old_read_domains;
 	int ret;
 
+	if (write)
+		intel_fb_obj_invalidate(obj, ORIGIN_CPU);
+
 	if (obj->base.write_domain == I915_GEM_DOMAIN_CPU)
 		return 0;
 
@@ -4256,9 +4259,6 @@  i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write)
 		obj->base.write_domain = I915_GEM_DOMAIN_CPU;
 	}
 
-	if (write)
-		intel_fb_obj_invalidate(obj, ORIGIN_CPU);
-
 	trace_i915_gem_object_change_domain(obj,
 					    old_read_domains,
 					    old_write_domain);