[Spice-devel] [PATCH] don't use alpha channel bitmap for primary surface operations

Alexander Larsson alexl at redhat.com
Tue May 18 02:23:18 PDT 2010


On Tue, 2010-05-18 at 04:56 -0400, Alon Levy wrote:
> This is an idea suggested by izik, I just tested it a little so far.
> 
> Basically the test for alpha in QXLGetBitmap is done even when the target
> is a primary surface (side note: our driver only supports a single monitor
> right now, and hardcoding '0' there also sucks, it should basically be
> 0..num_monitors-1). So this adds a check explicitly. I haven't benchmarked
> it yet (I plan on doing a little infrastructure to make benchmarking easier
> with another ifdef - don't plan on pushing this upstream since it will make
> the code much uglier - I want to decorate all the api functions to have
> them output debug prints).

Yes, i have thought about this myself. We do the same on the spice
server side when sending updates to the client about surface contents.

However, the reason I have not done this so far is that there is a risk
that the image being drawn to the primary surface will be cached and
then reused later to draw to a non-primary surface.

Of course, since you're drawing it to the primary surface first that
makes it unlikely that it has alpha contents (since the primary surface
never does anything with alpha). You can't be 100% sure of this though.

I guess what I'm saying is that this needs a fair amount of testing to
ensure that we're not tripping over some weird behaviour from
applications.

About hardcoding surface 0 for primary. Thats actually right. The way
multi-monitor works in windows is that you instantiate multiple qxl
devices, one for each monitor. However, this isn't how X does it, so we
need to support multiple primary surfaces for the X driver if we're to
support multiple monitors on it. I'm not sure how this will work right
now as i believe there are some places in the spice server that treats
surface 0 as special. Izik might know what the plans here are.

> I haven't tried this on X driver either - don't even know where the X code is..

Upstream for the driver is:
http://cgit.freedesktop.org/xorg/driver/xf86-video-qxl/

But i think the "new" version that ssp is working on for upstream is
somewhere at:
http://cgit.freedesktop.org/~sandmann/xf86-video-qxl/




More information about the Spice-devel mailing list