Younes Manton wrote:
> On Wed, Apr 1, 2009 at 3:52 AM, Thomas Hellstrom <[email protected]> 
> wrote:
>   
>> Ian Romanick wrote:
>>     
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> [email protected] wrote:
>>>
>>>       
>>>> From: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
>>>>
>>>>      /*
>>>> @@ -186,23 +183,20 @@ static int driBindContext(__DRIcontext *pcp,
>>>>      */
>>>>
>>>>      if (!psp->dri2.enabled) {
>>>> -    if (!pdp->pStamp || *pdp->pStamp != pdp->lastStamp) {
>>>> +    if (pdp && !pdp->pStamp) {
>>>>          DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
>>>>          __driUtilUpdateDrawableInfo(pdp);
>>>>          DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
>>>>      }
>>>> -
>>>> -    if ((pdp != prp) && (!prp->pStamp || *prp->pStamp != prp->lastStamp)) 
>>>> {
>>>> +    if (prp && pdp != prp && !prp->pStamp) {
>>>>          DRM_SPINLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
>>>>          __driUtilUpdateDrawableInfo(prp);
>>>>          DRM_SPINUNLOCK(&psp->pSAREA->drawable_lock, psp->drawLockID);
>>>> -    }
>>>> +        }
>>>>
>>>>         
>>> These changes seem to do the opposite of what the commit message says.
>>> "Don't update drawables if the stamps aren't matching," but this code
>>> removes the check.
>>>
>>>       
>> The previous code read the stamps outside of the lock on each
>> makeCurrent and went ahead updating the drawables. Their info
>> immediately became stale so the driver had to do it again anyway.
>> So this code removes that check and only updates the drawables if they
>> aren't initialized.
>>     
>
> Just FYI, in driSwapBuffers() we check for cliprects and exit early if
> there are none (before calling down to the driver's SwapBuffers()), so
> we never get cliprects and never swap. I went ahead and fixed it.
>   
Hmm,
You're right. The driver I tested does a drawable update within 
driver::makeCurrent if new drawables are bound and with the hardware 
lock grabbed to protect the SAREA members.

/Thomas



------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to