A user on a nouveau-driven card ran into a problem where DVI-D-1 and
DVI-I-1 were aliasing. The simplest fix is to provide the full connector
names. While we're at it, rename the output names to match what is in
the kernel, and start counting the connectors from 1 rather than 0. The
only deviation is HDMI vs HDMI-A, which kept its original name.

This will break backwards compatibility with existing xorg.conf's that
reference output names, but the alternative is to create a separate
counting system, further disconnecting from the kernel names.

Signed-off-by: Ilia Mirkin <[email protected]>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c 
b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 4d8892f..736bfc4 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1292,17 +1292,17 @@ static int subpixel_conv_table[7] = {
 static const char *const output_names[] = {
     "None",
     "VGA",
-    "DVI",
-    "DVI",
-    "DVI",
+    "DVI-I",
+    "DVI-D",
+    "DVI-A",
     "Composite",
-    "S-video",
+    "SVIDEO",
     "LVDS",
-    "CTV",
+    "Component",
     "DIN",
-    "DisplayPort",
-    "HDMI",
+    "DP",
     "HDMI",
+    "HDMI-B",
     "TV",
     "eDP",
     "Virtual",
@@ -1377,13 +1377,13 @@ drmmode_create_name(ScrnInfoPtr pScrn, 
drmModeConnectorPtr koutput, char *name,
 
  fallback:
     if (koutput->connector_type >= MS_ARRAY_SIZE(output_names))
-        snprintf(name, 32, "Unknown-%d", koutput->connector_type_id - 1);
+        snprintf(name, 32, "Unknown%d-%d", koutput->connector_type, 
koutput->connector_type_id);
 #ifdef MODESETTING_OUTPUT_SLAVE_SUPPORT
     else if (pScrn->is_gpu)
-        snprintf(name, 32, "%s-%d-%d", output_names[koutput->connector_type], 
pScrn->scrnIndex - GPU_SCREEN_OFFSET + 1, koutput->connector_type_id - 1);
+        snprintf(name, 32, "%s-%d-%d", output_names[koutput->connector_type], 
pScrn->scrnIndex - GPU_SCREEN_OFFSET + 1, koutput->connector_type_id);
 #endif
     else
-        snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], 
koutput->connector_type_id - 1);
+        snprintf(name, 32, "%s-%d", output_names[koutput->connector_type], 
koutput->connector_type_id);
 }
 
 static unsigned int
-- 
2.4.6

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to