xorg/driver/xf86-video-ati: output name duplication for providers #1 and up
Submitted by Greg Turner
Assigned to xf86-video-ati maintainers
Description
Created attachment 100274
churn_output_names.patch
Thanks to a Dave Airlie and others in irc for helping me get to the bottom of this.
For cards other than "#0" (I'm still quite unclear on where exactly the numbering comes from -- I presume it's the same place as the /dev/dri/card* specials), it is still quite possible to get duplicated output names.
This is because the code identified in the source as "for compatibility with UMS output names" does not run; instead, for these non-#0-cards, only the human-readable output type name (i.e.: "DVI", "HDMI", etc.) differentiates the various outputs. Unfortunately these names are not at all unique:
const char *output_names[] = {
"None",
"VGA",
"DVI",
"DVI",
"DVI",
"Composite",
"S-video",
"LVDS",
"CTV",
"DIN",
"DisplayPort",
"HDMI",
"HDMI",
"TV",
"eDP"
};
The result, depending on your hardware: adding a second card results in duplicate output names in the global randr namespace. Wouldn't be so terrible, except it makes xrandr go utterly berzerk.*
Rather than pile more output numbering kludges on top of the ones already in drmmode_output_init, folks in IRC seemed to agree that a better solution would be to go ahead and allow the output names to churn and replace the duplicate values in the above array with unique ones.
I posted this to the mailing list some days ago and no flame-war ensued. But, I'm new in town; perhaps bugzilla is a better way to get my patch looked at?
- This may represent a second bug in apps/xrandr, as I noticed several third-party consumers of libXrandr continued to work correctly in spite of the duplicate names; however, apps/xrandr always freaked out, even if I only fed it XID's.
Patch 100274, "churn_output_names.patch":
churn_output_names.patch