On Wed, Jun 08, 2016 at 11:59:25AM +0200, Daniel Vetter wrote:
> On Fri, Jun 03, 2016 at 05:55:42PM +0100, Chris Wilson wrote:
> > 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)
> > 
> > Signed-off-by: Chris Wilson <[email protected]>
> > Cc: Daniel Vetter <[email protected]>
> > ---
> >  drivers/gpu/drm/i915/i915_gem.c | 29 ++++++++++++++++-------------
> >  1 file changed, 16 insertions(+), 13 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c 
> > b/drivers/gpu/drm/i915/i915_gem.c
> > index a4f949038d50..b78f9df1894c 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -1265,25 +1265,28 @@ i915_gem_sw_finish_ioctl(struct drm_device *dev, 
> > void *data,
> >  {
> >     struct drm_i915_gem_sw_finish *args = data;
> >     struct drm_i915_gem_object *obj;
> > -   int ret = 0;
> > -
> > -   ret = i915_mutex_lock_interruptible(dev);
> > -   if (ret)
> > -           return ret;
> > +   int ret;
> >  
> >     obj = i915_gem_object_lookup(file, args->handle);
> > -   if (!obj) {
> > -           ret = -ENOENT;
> > -           goto unlock;
> > -   }
> > +   if (!obj)
> > +           return -ENOENT;
> >  
> >     /* Pinned buffers may be scanout, so flush the cache */
> > -   if (obj->pin_display)
> > +   if (obj->pin_display) {
> 
> READ_ONCE(obj->pin_display)?

 v2: Use access once for compiler hints (or not as it is a bitfield)

Now v3, it is no longer a bitfield. Sigh.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to