[PATCH 15/36] xf86dga: handle DGAAvailable for gpu screens.
Adam Jackson
ajax at nwnk.net
Mon Jul 2 13:22:42 PDT 2012
On 7/2/12 6:13 AM, Dave Airlie wrote:
> diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
> index 6416372..4fe12f2 100644
> --- a/hw/xfree86/common/xf86DGA.c
> +++ b/hw/xfree86/common/xf86DGA.c
> @@ -523,10 +523,15 @@ DGAChangePixmapMode(int index, int *x, int *y, int mode)
> Bool
> DGAAvailable(int index)
> {
> + ScreenPtr pScreen;
> if (!DGAScreenKeyRegistered)
> return FALSE;
>
> - if (DGA_GET_SCREEN_PRIV(screenInfo.screens[index]))
> + if (index >= GPU_SCREEN_OFFSET)
> + pScreen = screenInfo.gpuscreens[index - GPU_SCREEN_OFFSET];
> + else
> + pScreen = screenInfo.screens[index];
> + if (DGA_GET_SCREEN_PRIV(pScreen))
> return TRUE;
>
> return FALSE;
Ignoring that we ought never have put screen numbers in the protocol,
since that ship done sailed, I don't think this is meaningful or right.
The index into the GPU screen list is a) not something the client can
get hold of to begin with, b) dynamic anyway since you can unplug and
replug between consecutive DGA requests.
I think anywhere you see a screen number on the wire the safe thing to
do is index protocolscreens not gpuscreens.
- ajax
More information about the xorg-devel
mailing list