[PATCH] Improved autoconfig drivers matching

Aaron Plattner aplattner at nvidia.com
Tue May 9 22:00:00 UTC 2017


On 05/03/2017 01:11 PM, Adam Jackson wrote:
> On Mon, 2017-05-01 at 18:03 +0900, Michel Dänzer wrote:
>> On 28/04/17 04:11 AM, Adam Jackson wrote:
>>> Fixed up (and rebased and made meson-aware) and merged:
>>>
>>> To ssh://git.freedesktop.org/git/xorg/xserver
>>>    1549e3037..112d0d7d0  master -> master
>>
>> This broke things on my development box.
>>
>> There are two GPUs. When I want Xorg to use the secondary GPU for its
>> primary screen, I use a xorg.conf with (effectively) only:
>>
>> Section "Device"
>>         Identifier "Device0"
>>         BusID   "PCI:1:0:0"
>> EndSection
>>
>> Before this change, this worked fine, automatically[0] using the amdgpu
>> driver for that GPU. With this change, Xorg fails to start up, see the
>> attached log file.
> 
> Ugh. I don't know if I'm going to have time to investigate that in
> detail, so I lean towards reverting. If the original problem was that
> 20 was too small a number let's just bump it to something safely crazy
> like 256. Sound reasonable?

I found the problem. Karol's change lost the initialization of i here:

@@ -398,8 +412,8 @@ autoConfigDevice(GDevPtr preconf_device)

             /* for each other driver found, copy the first screen,
insert it
              * into the list of screens and set the driver */
-            for (i = 1; i < num_matches; i++) {
-                if (!copyScreen(slp[0].screen, ptr, i, matches[i]))
+            while (i++ < md.nmatches) {
+                if (!copyScreen(slp[0].screen, ptr, i, md.matches[i]))
                     return NULL;
             }

Patch incoming.

-- Aaron


More information about the xorg-devel mailing list