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

Chris Wilson
2015-01-21T14:08:23Z

On Wed, Jan 21, 2015 at 02:53:49PM +0100, Daniel Vetter wrote:
> 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ä <ville.syrjala@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

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,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

--
Chris Wilson, Intel Open Source Technology Centre