[PATCH] xfree86: belately init RandR12 if xinerama fails. (#24627)

Keith Packard keithp at keithp.com
Sun Dec 13 21:07:55 PST 2009


> you know the dependency better than I do so any hints are apreciated.

This is all a terribly twisty maze at this point... Would be cool if
we figured out how to use the existing Xinerama code (or something
nicer, if possible) to merge multiple graphics cards into one giant
screen visible through the RandR extension though.

> afaict, the screenInfo.numScreens (the check used by Xinerama) isn't
> necessarily initialized at this point so we can't use the same check.
> The following seems to work though:

Right, here's the call chain:

       InitOutput
        AddScreen
         <driver>ScreenInit
          xf86CrtcScreenInit
           xf86RandR12Init
           
AddScreen is responsible for incrementing screenInfo.numScreens each
time a screen is successfully added to the system, while xf86NumScreens
is set long before that to match the number of screens found on the
system. It looks like the xf86 layer depends on xf86NumScreens matching
screenInfo.numScreens after InitOutput is done, although it doesn't
appear to verify that anywhere.

In any case, we can use xf86NumScreens to know the number of screens
that should be initialized.

> --- a/hw/xfree86/modes/xf86RandR12.c
> +++ b/hw/xfree86/modes/xf86RandR12.c
> @@ -871,7 +871,12 @@ xf86RandR12Init (ScreenPtr pScreen)
>  #ifdef PANORAMIX
>      /* XXX disable RandR when using Xinerama */
>      if (!noPanoramiXExtension)
> -	return TRUE;
> +    {
> +        if (xf86NumScreens == 1)
> +            noPanoramiXExtension = TRUE;
> +        else
> +            return TRUE;
> +    }

This should work, although it does look like quite the kludge. Unless
someone has a better plan, we'll go with it though.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20091213/4d57ceea/attachment.pgp 


More information about the xorg-devel mailing list