[PATCH] exa: Accept scratch pixmaps with offscreen memory as such.

Maarten Maathuis madman2003 at gmail.com
Thu Mar 19 11:29:29 PDT 2009


2009/3/19 Michel Dänzer <michel at daenzer.net>:
> On Don, 2009-03-19 at 19:10 +0100, Maarten Maathuis wrote:
>>
>> -     /* Is this the framebuffer (for classic exa)? */
>> -     if (pPixData && pPixData == pExaScr->info->memoryBase) {
>> -         pExaPixmap->fb_ptr = pPixData;
>> -         pExaPixmap->fb_pitch = devKind;
>> -         pExaPixmap->offscreen = TRUE;
>> +     /* Classic EXA:
>> +      * - Framebuffer.
>> +      * - Scratch pixmap with offscreen memory.
>> +      */
>> +     if (pExaScr->info->memoryBase && pPixData) {
>
> Maybe this block should also be guarded by !EXA_HANDLES_PIXMAPS or
> something like that, to prevent it from executing for drivers that
> handle pixmap allocation.

Those drivers don't set memoryBase, but if you want a more explicit
check, then that can be arranged.

>> +         if ((CARD8 *)pPixData >= pExaScr->info->memoryBase &&
>> +             (CARD8 *)pPixData < (pExaScr->info->memoryBase + pExaScr->info->memorySize)) {
>
> (pExaScr->info->memoryBase + pExaScr->info->memorySize) could wrap
> around to 0, in which case the latter check would always fail.

I don't see how that failure is bad (considering it won't wrap for the
cases that are offscreen).

How would you do it?

>
>
> Also, BTW, please try to keep lines below 80 characters or so.
>

I looked better this way (imo), but if you insist.

>
> --
> Earthling Michel Dänzer           |                http://www.vmware.com
> Libre software enthusiast         |          Debian, X and DRI developer
>


More information about the xorg-devel mailing list