[PATCH 2/5] drm/i915/selftests: Always flush before unpining after writing
Chris Wilson
chris at chris-wilson.co.uk
Mon May 11 14:03:41 UTC 2020
Quoting Mika Kuoppala (2020-05-11 14:45:23)
> Chris Wilson <chris at chris-wilson.co.uk> writes:
>
> > Be consistent, and even when we know we had used a WC, flush the mapped
> > object after writing into it. The flush understands the mapping type and
> > will only flush the WCB if I915_MAP_WC.
>
> on subject:
> s/unpining/unpinning.
>
> which flush understands the mapping type?
__i915_gem_object_flush_map() looks the obj->mm.mapping type.
> i915_gem_object_flush_map does, but that check is after
> early return for bo_write_coherence. If the mapping is write
> combined, then we should explicitly wmb early before
> any coherence checks. But if the flush map is for cpu side
> memory coherence only, then I guess the wmb can be omitted.
I was assuming there was a wmb() in there anyway.
> But then the wcb is irrelevant regardless.
We can have one for paranoia.
> So the commit message and the current i915_gem_object_flush_map
> are in disagreement.
>
> (chipset_flush does explicit wmb tho)
I'm still not sure which direction the HW flushes in its chipset_flush.
I keep thinking we have it entirely wrong and it is flushing residual
writes from the GPU to memory.
-Chris
More information about the Intel-gfx-trybot
mailing list