BTW:  In response to your second question, the same rule should also apply to 
sub-surfaces which really map to the same underlying memory.

>-----Original Message-----
>From: Strelchun, Timothy 
>Sent: Tuesday, September 01, 2009 4:43 PM
>To: 'directfb-dev@directfb.org'
>Subject: RE: [directfb-dev] question about locking
>
>Hi Anders,
>
>It is not a safe operation.  The DFB core software and drivers 
>may depend upon knowing when CPU based pixel modifications are 
>complete for a variety of reasons (such as cache flushing for 
>the GPU or pushing the buffer to video RAM, etc.).  Always 
>perform locking and unlocking has a paired operation.
>
>We just identified a fix for a customer today related to 
>visible caching artifacts, partially because lock/unlock were 
>not used properly (the buffer pointer was being cached).
>
>Regards,
>Timothy
>
>--
>
>Timothy Strelchun
>CE Software Engineering
>Digital Home Group
>Intel Corporation
>
>The views expressed above are my own and not those of Intel
>
>>-----Original Message-----
>>From: directfb-dev-boun...@directfb.org 
>>[mailto:directfb-dev-boun...@directfb.org] On Behalf Of Anders Bakken
>>Sent: Tuesday, September 01, 2009 3:40 PM
>>To: directfb-dev@directfb.org
>>Subject: [directfb-dev] question about locking
>>
>>Is the following a "safe" operation:
>>
>>IDirectFBSurface *surfaceOne = ...;
>>IDirectFBSurface *surfaceTwo = ...;
>>int bpl;
>>void *mem;
>>surfaceOne->Lock(surfaceOne, DSLF_WRITE, &mem, &bpl);
>>// change the pixels of mem using something other interface
>>surfaceTwo->Blit(surfaceTwo, surfaceOne, 0, 0, 0);
>>
>>Do I need to call surfaceOne->Unlock(surfaceOne); before I blit 
>>surfaceOne onto surfaceTwo?
>>
>>If the answer is yes, what if I did this instead:
>>IDirectFBSurface *surfaceOne = ...;
>>IDirectFBSurface *surfaceTwo = ...;
>>IDirectFBSurface *sub;
>>surfaceOne->GetSubSurface(surfaceOne, 0, &sub);
>>int bpl;
>>void *mem;
>>sub->Lock(sub, DSLF_WRITE, &mem, &bpl);
>>// change the pixels of mem using something other interface
>>surfaceTwo->Blit(surfaceTwo, surfaceOne, 0, 0, 0);
>>
>>Do I need to call sub->Unlock(sub); before I blit surfaceOne onto 
>>surfaceTwo?
>>
>>regards
>>--
>>Anders Bakken
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to