On Thu, Aug 04, 2016 at 01:32:52PM +0300, Joonas Lahtinen wrote:
> On ma, 2016-08-01 at 19:22 +0100, Chris Wilson wrote:
> > /* Pinned buffers may be scanout, so flush the cache */
> > - if (obj->pin_display)
> > + if (READ_ONCE(obj->pin_display)) {
> > + ret =
On ma, 2016-08-01 at 19:22 +0100, Chris Wilson wrote:
> /* Pinned buffers may be scanout, so flush the cache */
> - if (obj->pin_display)
> + if (READ_ONCE(obj->pin_display)) {
> + ret = i915_mutex_lock_interruptible(dev);
> + if (ret)
> +
We only need to take the struct_mutex if the object is pinned to the
display engine and so requires checking for clflush. (The race with
userspace pinning the object to a framebuffer is irrelevant.)
v2: Use access once for compiler hints (or not as it is a bitfield)
v3: READ_ONCE,