splitting drawable and screens

Dave Airlie airlied at gmail.com
Tue Oct 2 17:11:33 PDT 2012


So I've been looking into gpu switching and having all driver screens
be GPU screens under a protocol screen.

Now the biggest problem I've hit so far is that we all use
pDrawable->pScreen to figure out what screen we are, however I'd like
to abstract things so that you can get drawables from a protocol
screen, and the code figures out when we need an actual pixmap how to
get the correct pixmap for the gpu screen we are currently rendering
on. However this means that pDrawable->pScreen will be a protocol
screen and the drivers will want to access the GPU screen.

So I'm left with two ideas on how to fix this (one ugly, one tedious):

a) introduce pDrawable->pCurrentGPU which is a screen ptr for the
currently rendering gpu on the drawable, the driver then uses this to
get its current screenptr back, instead of using pDrawable->pScreen.

b) add pScreen to all the driver facing APIs, (GCOps, Picture ops,
lots of ScreenRec).

I'm leaning towards (a) as omg less typing, less API/ABI breakage, we
could wrap things at the driver level with a few defines and things
would be a lot easier. The driver API compat layer for b would be
incredibly ugly (worse than my current one).

I've also considered duplicating GCs and using GC->pScreen, but that
is rather crappy too, and we don't always have GCs or Pictures
everwhere, and again these are really protocol objects.

Dave.


More information about the xorg-devel mailing list