How to shift color bits in fbdev?

Aaron Plattner aplattner at nvidia.com
Wed Mar 18 20:54:07 PDT 2009


On Sun, Mar 15, 2009 at 11:08:10AM -0700, Gregoire Gentil wrote:
> +    if ((pPixmap->devPrivate.ptr >= fPtr->fbmem) &&
> +	((char*)pPixmap->devPrivate.ptr < ((char*)fPtr->fbmem +
> fPtr->lineLength * 600 * 8))) {
> +	*pWrite = WriteMemoryShiftBit;
> +    } else {
> +	*pWrite = WriteMemoryPassthru;
> +    }
> +
> +    *pRead = ReadMemory;

One thing to note is that wfb can be set up for multiple drawables at the
same time.  For example, if your driver is falling back to software for a
CopyArea, wfb will call the setup function once for the source and once for
the destination.  If you switch pWrite to WriteMemoryPassthru while it's
still set up for the screen, you'll miss the ShiftBit stuff you wanted to
do.

-- Aaron



More information about the xorg mailing list