Skip to contentSkip to conversation

drm/i915: Simplify flush_cpu_write_domain

PATCH In review Daniel Vetter 4 participants 11 messages Jan 21, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/i915: Simplify flush_cpu_write_domain

We can push down the decision whether to force flushing into the implementation since in all places that matter obj->pin_display is accurate already. The only place where the optimization really matters is the sw_finish_ioctl, and that already checks for obj->pin_display on its own.

I suspect that this was simply an artifact of how

commit 2c22569bba8af6c2976d5f9479fe54a53a39966b

Author: Chris Wilson <[email protected]>
Date:   Fri Aug 9 12:26:45 2013 +0100

drm/i915: Update rules for writing through the LLC with the cpu

evolved - only v2 added the pin_display tracking.

Note that we still retain the gist of this logic from the above commit with the explicit force argument for the low-level clflush function.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +6 -8
index f486555fb4a8..783d1040bf83 100644
@@ -39,8 +39,7 @@
 #include <linux/dma-buf.h>
 
 static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
-static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj,
-						   bool force);
+static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj);
 static __must_check int
 i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj,
 			       bool readonly);
@@ -1516,7 +1515,7 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
 
 	/* Pinned buffers may be scanout, so flush the cache */
 	if (obj->pin_display)
-		i915_gem_object_flush_cpu_write_domain(obj, true);
+		i915_gem_object_flush_cpu_write_domain(obj);
 
 	drm_gem_object_unreference(&obj->base);
 unlock:
@@ -3680,15 +3679,14 @@ i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
 
 /** Flushes the CPU write domain for the object if it's dirty. */
 static void
-i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj,
-				       bool force)
+i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj)
 {
 	uint32_t old_write_domain;
 
 	if (obj->base.write_domain != I915_GEM_DOMAIN_CPU)
 		return;
 
-	if (i915_gem_clflush_object(obj, force))
+	if (i915_gem_clflush_object(obj, obj->pin_display))
 		i915_gem_chipset_flush(obj->base.dev);
 
 	old_write_domain = obj->base.write_domain;
@@ -3735,7 +3733,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
 	if (ret)
 		return ret;
 
-	i915_gem_object_flush_cpu_write_domain(obj, false);
+	i915_gem_object_flush_cpu_write_domain(obj);
 
 	/* Serialise direct access to this object with the barriers for
 	 * coherent writes from the GPU, by effectively invalidating the
@@ -3981,7 +3979,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
 	if (ret)
 		goto err_unpin_display;
 
-	i915_gem_object_flush_cpu_write_domain(obj, true);
+	i915_gem_object_flush_cpu_write_domain(obj);
 
 	old_write_domain = obj->base.write_domain;
 	old_read_domains = obj->base.read_domains;
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/2 drm/i915: Remove open-coded callers of flush_cpu_write_domain

Both places check the cpu domain and through some indirection obj->pin_display and whether cpu access is coherent. And then flush both cpu caches and the chipset cache. Which is what flush_cpu_write_domain does.

Only difference is that on top we get a tracepoint, frontbuffer tracking and and domain tracking updates. Which doesn't matter since both paths are slowpaths.

So lets go with more shared code for clearer idioms.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +4 -11
index 783d1040bf83..b48c39230b80 100644
@@ -1019,11 +1019,8 @@ out:
 		 * cachelines in-line while writing and the object moved
 		 * out of the cpu write domain while we've dropped the lock.
 		 */
-		if (!needs_clflush_after &&
-		    obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
-			if (i915_gem_clflush_object(obj, obj->pin_display))
-				i915_gem_chipset_flush(dev);
-		}
+		if (!needs_clflush_after)
+			i915_gem_object_flush_cpu_write_domain(obj);
 	}
 
 	if (needs_clflush_after)
@@ -3825,12 +3822,8 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
 		vma->node.color = cache_level;
 	obj->cache_level = cache_level;
 
-	if (obj->cache_dirty &&
-	    obj->base.write_domain != I915_GEM_DOMAIN_CPU &&
-	    cpu_write_needs_clflush(obj)) {
-		if (i915_gem_clflush_object(obj, true))
-			i915_gem_chipset_flush(obj->base.dev);
-	}
+	if (obj->cache_dirty)
+		i915_gem_object_flush_cpu_write_domain(obj);
 
 	return 0;
 }
Signature · 6 lines
2.1.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/i915: Remove open-coded callers of flush_cpu_write_domain

Quoted 9 lines · Daniel Vetter

Both places check the cpu domain and through some indirection obj->pin_display and whether cpu access is coherent. And then flush both cpu caches and the chipset cache. Which is what flush_cpu_write_domain does.

Only difference is that on top we get a tracepoint, frontbuffer tracking and and domain tracking updates. Which doesn't matter since both paths are slowpaths.

Quoted 5 lines

So lets go with more shared code for clearer idioms.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>

Nice, took a few double checks to make sure that the cpu_write_needs_clflush() does indeed equate to flush_cpu_write_domain() here (the key is the passing obj->pin_display in the previous patch). I think that is worth highlighting in the commit message.

Other than that,

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH 2/2] drm/i915: Remove open-coded callers of flush_cpu_write_domain

In reply to Daniel Vetter
Quoted 23 lines · Daniel Vetter

Both places check the cpu domain and through some indirection obj->pin_display and whether cpu access is coherent. And then flush both cpu caches and the chipset cache. Which is what flush_cpu_write_domain does.

Only difference is that on top we get a tracepoint, frontbuffer tracking and and domain tracking updates. Which doesn't matter since both paths are slowpaths.

So lets go with more shared code for clearer idioms.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +0 -0
index 783d1040bf83..b48c39230b80 100644

drivers/gpu/drm/i915/i915_gem.c out: · line 1023

Quoted 10 lines
drivers/gpu/drm/i915/i915_gem.c +2 -5
@@ -1019,11 +1019,8 @@ out:
 		 * cachelines in-line while writing and the object moved
 		 * out of the cpu write domain while we've dropped the lock.
 		 */
-		if (!needs_clflush_after &&
-		    obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
-			if (i915_gem_clflush_object(obj, obj->pin_display))
-				i915_gem_chipset_flush(dev);
-		}
+		if (!needs_clflush_after)
+			i915_gem_object_flush_cpu_write_domain(obj);

Nack. You've just inverted the write domain check.

Quoted 20 lines
drivers/gpu/drm/i915/i915_gem.c +2 -6
 	}
 
 	if (needs_clflush_after)
@@ -3825,12 +3822,8 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
 		vma->node.color = cache_level;
 	obj->cache_level = cache_level;
 
-	if (obj->cache_dirty &&
-	    obj->base.write_domain != I915_GEM_DOMAIN_CPU &&
-	    cpu_write_needs_clflush(obj)) {
-		if (i915_gem_clflush_object(obj, true))
-			i915_gem_chipset_flush(obj->base.dev);
-	}
+	if (obj->cache_dirty)
+		i915_gem_object_flush_cpu_write_domain(obj);
 
 	return 0;
 }
Signature · 1 line
2.1.4
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

Re: [PATCH 2/2] drm/i915: Remove open-coded callers of flush_cpu_write_domain

Quoted 28 lines · Ville Syrjälä
Quoted 27 lines · Daniel Vetter

Both places check the cpu domain and through some indirection obj->pin_display and whether cpu access is coherent. And then flush both cpu caches and the chipset cache. Which is what flush_cpu_write_domain does.

Only difference is that on top we get a tracepoint, frontbuffer tracking and and domain tracking updates. Which doesn't matter since both paths are slowpaths.

So lets go with more shared code for clearer idioms.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +0 -1
index 783d1040bf83..b48c39230b80 100644
@@ -1019,11 +1019,8 @@ out:
 		 * cachelines in-line while writing and the object moved
 		 * out of the cpu write domain while we've dropped the lock.
 		 */
-		if (!needs_clflush_after &&
Quoted 8 lines

drivers/gpu/drm/i915/i915_gem.c out: · line 1023

Quoted 6 lines
drivers/gpu/drm/i915/i915_gem.c +2 -4
-		    obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
-			if (i915_gem_clflush_object(obj, obj->pin_display))
-				i915_gem_chipset_flush(dev);
-		}
+		if (!needs_clflush_after)
+			i915_gem_object_flush_cpu_write_domain(obj);

Nack. You've just inverted the write domain check.

Indeed, brain must have been offline. And thinking about this more this really is a low-level clflush from a function playing tricks, so doesn't make sense to use higher level functions anyway.

I'll respin with just the 2nd hunk and try to explain a bit better why it's ok, like Chris requested.
-Daniel

Quoted 29 lines
Quoted 21 lines
drivers/gpu/drm/i915/i915_gem.c +2 -6
 	}
 
 	if (needs_clflush_after)
@@ -3825,12 +3822,8 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
 		vma->node.color = cache_level;
 	obj->cache_level = cache_level;
 
-	if (obj->cache_dirty &&
-	    obj->base.write_domain != I915_GEM_DOMAIN_CPU &&
-	    cpu_write_needs_clflush(obj)) {
-		if (i915_gem_clflush_object(obj, true))
-			i915_gem_chipset_flush(obj->base.dev);
-	}
+	if (obj->cache_dirty)
+		i915_gem_object_flush_cpu_write_domain(obj);
 
 	return 0;
 }
Signature · 1 line
2.1.4
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Re: [PATCH 2/2] drm/i915: Remove open-coded callers of flush_cpu_write_domain

Quoted 38 lines · Daniel Vetter
Quoted 28 lines · Ville Syrjälä
Quoted 27 lines · Daniel Vetter

Both places check the cpu domain and through some indirection obj->pin_display and whether cpu access is coherent. And then flush both cpu caches and the chipset cache. Which is what flush_cpu_write_domain does.

Only difference is that on top we get a tracepoint, frontbuffer tracking and and domain tracking updates. Which doesn't matter since both paths are slowpaths.

So lets go with more shared code for clearer idioms.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +0 -1
index 783d1040bf83..b48c39230b80 100644
@@ -1019,11 +1019,8 @@ out:
 		 * cachelines in-line while writing and the object moved
 		 * out of the cpu write domain while we've dropped the lock.
 		 */
-		if (!needs_clflush_after &&
Quoted 8 lines

drivers/gpu/drm/i915/i915_gem.c out: · line 1023

Quoted 6 lines
drivers/gpu/drm/i915/i915_gem.c +2 -4
-		    obj->base.write_domain != I915_GEM_DOMAIN_CPU) {
-			if (i915_gem_clflush_object(obj, obj->pin_display))
-				i915_gem_chipset_flush(dev);
-		}
+		if (!needs_clflush_after)
+			i915_gem_object_flush_cpu_write_domain(obj);

Nack. You've just inverted the write domain check.

Quoted 6 lines

Indeed, brain must have been offline. And thinking about this more this really is a low-level clflush from a function playing tricks, so doesn't make sense to use higher level functions anyway.

I'll respin with just the 2nd hunk and try to explain a bit better why it's ok, like Chris requested.

The 2nd hunk has the same problem.

Quoted 36 lines

-Daniel

Quoted 29 lines
Quoted 21 lines
drivers/gpu/drm/i915/i915_gem.c +2 -6
 	}
 
 	if (needs_clflush_after)
@@ -3825,12 +3822,8 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
 		vma->node.color = cache_level;
 	obj->cache_level = cache_level;
 
-	if (obj->cache_dirty &&
-	    obj->base.write_domain != I915_GEM_DOMAIN_CPU &&
-	    cpu_write_needs_clflush(obj)) {
-		if (i915_gem_clflush_object(obj, true))
-			i915_gem_chipset_flush(obj->base.dev);
-	}
+	if (obj->cache_dirty)
+		i915_gem_object_flush_cpu_write_domain(obj);
 
 	return 0;
 }
Signature · 1 line
2.1.4
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/2
#6 lore raw
In reply to Daniel Vetter
Quoted 14 lines · Daniel Vetter

We can push down the decision whether to force flushing into the implementation since in all places that matter obj->pin_display is accurate already. The only place where the optimization really matters is the sw_finish_ioctl, and that already checks for obj->pin_display on its own.

I suspect that this was simply an artifact of how

commit 2c22569bba8af6c2976d5f9479fe54a53a39966b

Author: Chris Wilson <[email protected]>
Date:   Fri Aug 9 12:26:45 2013 +0100

drm/i915: Update rules for writing through the LLC with the cpu

Quoted 8 lines

evolved - only v2 added the pin_display tracking.

Note that we still retain the gist of this logic from the above commit with the explicit force argument for the low-level clflush function.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/2
#7 lore raw
In reply to Daniel Vetter
Quoted 68 lines · Daniel Vetter

We can push down the decision whether to force flushing into the implementation since in all places that matter obj->pin_display is accurate already. The only place where the optimization really matters is the sw_finish_ioctl, and that already checks for obj->pin_display on its own.

I suspect that this was simply an artifact of how

commit 2c22569bba8af6c2976d5f9479fe54a53a39966b

Author: Chris Wilson <[email protected]>
Date:   Fri Aug 9 12:26:45 2013 +0100

drm/i915: Update rules for writing through the LLC with the cpu

evolved - only v2 added the pin_display tracking.

Note that we still retain the gist of this logic from the above commit with the explicit force argument for the low-level clflush function.

Cc Ville Syrjälä <[email protected]>
Cc Chris Wilson <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +4 -6
index f486555fb4a8..783d1040bf83 100644
@@ -39,8 +39,7 @@
 #include <linux/dma-buf.h>
 
 static void i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj);
-static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj,
-						   bool force);
+static void i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj);
 static __must_check int
 i915_gem_object_wait_rendering(struct drm_i915_gem_object *obj,
 			       bool readonly);
@@ -1516,7 +1515,7 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, void *data,
 
 	/* Pinned buffers may be scanout, so flush the cache */
 	if (obj->pin_display)
-		i915_gem_object_flush_cpu_write_domain(obj, true);
+		i915_gem_object_flush_cpu_write_domain(obj);
 
 	drm_gem_object_unreference(&obj->base);
 unlock:
@@ -3680,15 +3679,14 @@ i915_gem_object_flush_gtt_write_domain(struct drm_i915_gem_object *obj)
 
 /** Flushes the CPU write domain for the object if it's dirty. */
 static void
-i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj,
-				       bool force)
+i915_gem_object_flush_cpu_write_domain(struct drm_i915_gem_object *obj)
 {
 	uint32_t old_write_domain;
 
 	if (obj->base.write_domain != I915_GEM_DOMAIN_CPU)
 		return;
 
-	if (i915_gem_clflush_object(obj, force))
+	if (i915_gem_clflush_object(obj, obj->pin_display))
 		i915_gem_chipset_flush(obj->base.dev);
 
 	old_write_domain = obj->base.write_domain;

drivers/gpu/drm/i915/i915_gem.c i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write) · line 3736

Quoted 5 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -3735,7 +3733,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
 	if (ret)
 		return ret;
 
-	i915_gem_object_flush_cpu_write_domain(obj, false);
+	i915_gem_object_flush_cpu_write_domain(obj);

This is the only place where there's a slight change in behaviour. Previosuly we would not clflush here when pin_display==true, but from now on we will. I had a patch to do only this change (part of some FBC series), but IIRC you argued it could hide bugs. I guess you've now changed you mind ;)

Anyway this makes sense to me, so

Quoted 14 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
 	/* Serialise direct access to this object with the barriers for
 	 * coherent writes from the GPU, by effectively invalidating the
@@ -3981,7 +3979,7 @@ i915_gem_object_pin_to_display_plane(struct drm_i915_gem_object *obj,
 	if (ret)
 		goto err_unpin_display;
 
-	i915_gem_object_flush_cpu_write_domain(obj, true);
+	i915_gem_object_flush_cpu_write_domain(obj);
 
 	old_write_domain = obj->base.write_domain;
 	old_read_domains = obj->base.read_domains;
Signature · 1 line
2.1.4
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw
Quoted 4 lines · Ville Syrjälä
Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +0 -0
@@ -3735,7 +3733,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
      if (ret)
              return ret;
 
Quoted 8 lines

drivers/gpu/drm/i915/i915_gem.c i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write) · line 3736

Quoted 2 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
-     i915_gem_object_flush_cpu_write_domain(obj, false);
+     i915_gem_object_flush_cpu_write_domain(obj);

This is the only place where there's a slight change in behaviour. Previosuly we would not clflush here when pin_display==true, but from now on we will. I had a patch to do only this change (part of some FBC series), but IIRC you argued it could hide bugs. I guess you've now changed you mind ;)

Hm, I don't remember that I've shot down a patch to change this and I can't come up with any reason any more why. But you're right that the commit message is a bit too silent about the behavioral change here. Lazy me will try harder and augment it when merging. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw
Quoted 15 lines · Daniel Vetter
Quoted 4 lines · Ville Syrjälä
Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +0 -0
@@ -3735,7 +3733,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
      if (ret)
              return ret;
 
Quoted 8 lines

drivers/gpu/drm/i915/i915_gem.c i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write) · line 3736

Quoted 2 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
-     i915_gem_object_flush_cpu_write_domain(obj, false);
+     i915_gem_object_flush_cpu_write_domain(obj);

This is the only place where there's a slight change in behaviour. Previosuly we would not clflush here when pin_display==true, but from now on we will. I had a patch to do only this change (part of some FBC series), but IIRC you argued it could hide bugs. I guess you've now changed you mind ;)

Quoted 4 lines

Hm, I don't remember that I've shot down a patch to change this and I can't come up with any reason any more why. But you're right that the commit message is a bit too silent about the behavioral change here. Lazy me will try harder and augment it when merging.

http://lists.freedesktop.org/archives/intel-gfx/2013-November/036421.html

Also seems Chris already suggested dropping the force parameter back then, but no one took the bait:
http://lists.freedesktop.org/archives/intel-gfx/2013-November/036346.html

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
Quoted 16 lines · Ville Syrjälä
Quoted 15 lines · Daniel Vetter
Quoted 12 lines · Ville Syrjälä

drivers/gpu/drm/i915/i915_gem.c i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write) · line 3736

Quoted 6 lines
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -3735,7 +3733,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
      if (ret)
              return ret;
 
-     i915_gem_object_flush_cpu_write_domain(obj, false);
+     i915_gem_object_flush_cpu_write_domain(obj);

This is the only place where there's a slight change in behaviour. Previosuly we would not clflush here when pin_display==true, but from now on we will. I had a patch to do only this change (part of some FBC series), but IIRC you argued it could hide bugs. I guess you've now changed you mind ;)

Quoted 6 lines
Quoted 4 lines

Hm, I don't remember that I've shot down a patch to change this and I can't come up with any reason any more why. But you're right that the commit message is a bit too silent about the behavioral change here. Lazy me will try harder and augment it when merging.

http://lists.freedesktop.org/archives/intel-gfx/2013-November/036421.html

Well I didn't want the abi change really. But as a cleanup it seems acceptable ;-)

Anyway added a bit of blurb and merged the patch, thanks for the feedback. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx