aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-06-26 13:35:16 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-06-29 04:46:45 -0400
commit031b698a77a70a6c394568034437b5486a44e868 (patch)
tree48061fb6fdcd3aa1f5625b8246368b5677847859 /drivers/gpu/drm/i915/i915_gem.c
parent066cf55b9ce35f1f90dde9fcec01431a9243a949 (diff)
drm/i915: Unconditionally do fb tracking invalidate in set_domain
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 :( v2: Chris observed that all internal set_domain users already correctly do the fb invalidate on their own, hence we can move this just into the set_domain ioctl instead. v3: I screwed up setting the invalidate ORIGIN_* correctly (Chris). Cc: Chris Wilson <chris@chris-wilson.co.uk> 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index db1955fad005..37cd901c9d75 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1614,6 +1614,11 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
1614 else 1614 else
1615 ret = i915_gem_object_set_to_cpu_domain(obj, write_domain != 0); 1615 ret = i915_gem_object_set_to_cpu_domain(obj, write_domain != 0);
1616 1616
1617 if (write_domain != 0)
1618 intel_fb_obj_invalidate(obj,
1619 write_domain == I915_GEM_DOMAIN_GTT ?
1620 ORIGIN_GTT : ORIGIN_CPU);
1621
1617unref: 1622unref:
1618 drm_gem_object_unreference(&obj->base); 1623 drm_gem_object_unreference(&obj->base);
1619unlock: 1624unlock:
@@ -3982,9 +3987,6 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
3982 obj->dirty = 1; 3987 obj->dirty = 1;
3983 } 3988 }
3984 3989
3985 if (write)
3986 intel_fb_obj_invalidate(obj, ORIGIN_GTT);
3987
3988 trace_i915_gem_object_change_domain(obj, 3990 trace_i915_gem_object_change_domain(obj,
3989 old_read_domains, 3991 old_read_domains,
3990 old_write_domain); 3992 old_write_domain);
@@ -4256,9 +4258,6 @@ i915_gem_object_set_to_cpu_domain(struct drm_i915_gem_object *obj, bool write)
4256 obj->base.write_domain = I915_GEM_DOMAIN_CPU; 4258 obj->base.write_domain = I915_GEM_DOMAIN_CPU;
4257 } 4259 }
4258 4260
4259 if (write)
4260 intel_fb_obj_invalidate(obj, ORIGIN_CPU);
4261
4262 trace_i915_gem_object_change_domain(obj, 4261 trace_i915_gem_object_change_domain(obj,
4263 old_read_domains, 4262 old_read_domains,
4264 old_write_domain); 4263 old_write_domain);