[Intel-gfx] [PATCH 61/70] drm/i915: Make fb_tracking.lock a spinlock

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Apr 14 08:15:47 PDT 2015


On 04/14/2015 04:05 PM, Chris Wilson wrote:
> On Tue, Apr 14, 2015 at 03:52:09PM +0100, Tvrtko Ursulin wrote:
>>>   	/* Delay flushing when rings are still busy.*/
>>> -	mutex_lock(&dev_priv->fb_tracking.lock);
>>> +	spin_lock(&dev_priv->fb_tracking.lock);
>>>   	frontbuffer_bits &= ~dev_priv->fb_tracking.busy_bits;
>>> -	mutex_unlock(&dev_priv->fb_tracking.lock);
>>> +	spin_unlock(&dev_priv->fb_tracking.lock);
>>
>> Looks like you could just remove the lock here in process.
>
> ...as in we are always protected by struct_mutex? I think Daniel was
> planning for a future where that was guaranteed.

No, it always looks to be updated with a single write - so I don't see 
why have a lock for this read?

Regards,

Tvrtko


More information about the Intel-gfx mailing list