Hi!
I encountered a problem with output order detection in the radeon driver. On
my X1950 card, outputs are mapped like this:
phys. Connector AtomBios-index
0 CRT1
1 DFP1
1 CRT2
0 DFP3
Which leads to the situation that merging of outputs reverses the order of
outputs: CRT1 is merged with DFP3, and CRT2 with DFP1, so that outputs are now
ordered like this:
1 DFP1 (+CRT2), named "DVI-1"
0 DFP3 (+CRT1), named "DVI-0"
This makes kdm believe "DVI-1" is the primary display, while fglrx, radeonhd
and Windows all agree on the reverse order. Note that the naming is consistent
between all drivers. Just the order in which the outputs were created using
xf86OutputCreate is wrong.
I have modified the merging code in
RADEONGetATOMConnectorInfoFromBIOSConnectorTable to always use the numerically
smaller index for the merged entry. It doesn't seem terribly elegent to me,
but it is correct -- and works.
Since changing the output order changed the names, now I had:
0 CRT1(+DFP3), named "DVI-1"
1 DFP1(+CRT2), named "DVI-0"
This is the correct order, but disagrees on how the other drivers name the
connectors. So I updated RADEONSetupConnectors to assign names more
intuitively, including HDMI and VGA. It used to be DVI-1/VGA-1/HDMI-1 for the
first (n-1) connectors, and ...-0 for the last, which is only correct for <=2
connectors anyways, and counter-intuitive as well. The new code assigns
DVI-0/1/... (same HDMI/VGA) in order, for almost arbitrary connector counts.
Attached is my patch. Consider it public domain if licensing is an issue.
Please be tolerant with it -- I never worked on an X driver before, so should
I have done any obvious mistakes, feel free to correct them :)
--
CU
Jörg
Only in /root/src: .deps
Only in /root/src: .libs
Common subdirectories: src/AtomBios and /root/src/AtomBios
Only in /root/src: CD_Operations.lo
Only in /root/src: Decoder.lo
Only in /root/src: Makefile
Only in /root/src: ati.lo
Only in /root/src: ati_drv.la
Only in /root/src: atimodule.lo
Only in /root/src: atombios_crtc.lo
Only in /root/src: atombios_output.lo
Only in /root/src: hwserv_drv.lo
Only in /root/src: legacy_crtc.lo
Only in /root/src: legacy_output.lo
Common subdirectories: src/pcidb and /root/src/pcidb
Only in /root/src: radeon_accel.lo
diff -u src/radeon_atombios.c /root/src/radeon_atombios.c
--- src/radeon_atombios.c 2008-10-21 10:36:22.000000000 +0200
+++ /root/src/radeon_atombios.c 2008-10-21 14:06:19.000000000 +0200
@@ -2014,20 +2014,28 @@
for (j = 0; j < ATOM_MAX_SUPPORTED_DEVICE; j++) {
if (info->BiosConnector[j].valid && (i != j) ) {
if (info->BiosConnector[i].output_id == info->BiosConnector[j].output_id) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Match: %i -> %i \n", i, j);
+
if (((i == ATOM_DEVICE_DFP1_INDEX) ||
(i == ATOM_DEVICE_DFP2_INDEX) ||
(i == ATOM_DEVICE_DFP3_INDEX)) &&
((j == ATOM_DEVICE_CRT1_INDEX) || (j == ATOM_DEVICE_CRT2_INDEX))) {
info->BiosConnector[i].DACType = info->BiosConnector[j].DACType;
info->BiosConnector[i].devices |= info->BiosConnector[j].devices;
- info->BiosConnector[j].valid = FALSE;
+ if (j < i) {
+ memcpy(&info->BiosConnector[j], &info->BiosConnector[i], sizeof(info->BiosConnector[0]));
+ info->BiosConnector[i].valid = FALSE;
+ } else info->BiosConnector[j].valid = FALSE;
} else if (((j == ATOM_DEVICE_DFP1_INDEX) ||
(j == ATOM_DEVICE_DFP2_INDEX) ||
(j == ATOM_DEVICE_DFP3_INDEX)) &&
((i == ATOM_DEVICE_CRT1_INDEX) || (i == ATOM_DEVICE_CRT2_INDEX))) {
info->BiosConnector[j].DACType = info->BiosConnector[i].DACType;
info->BiosConnector[j].devices |= info->BiosConnector[i].devices;
- info->BiosConnector[i].valid = FALSE;
+ if (i < j) {
+ memcpy(&info->BiosConnector[i], &info->BiosConnector[j], sizeof(info->BiosConnector[0]));
+ info->BiosConnector[j].valid = FALSE;
+ } else info->BiosConnector[i].valid = FALSE;
}
/* other possible combos? */
}
Only in /root/src: radeon_atombios.lo
Only in /root/src: radeon_atomwrapper.lo
Only in /root/src: radeon_bios.lo
Only in /root/src: radeon_crtc.lo
Only in /root/src: radeon_cursor.lo
Only in /root/src: radeon_dga.lo
Only in /root/src: radeon_dri.lo
Only in /root/src: radeon_driver.lo
Only in /root/src: radeon_drv.la
Only in /root/src: radeon_exa.lo
Only in /root/src: radeon_legacy_memory.lo
Only in /root/src: radeon_misc.lo
Only in /root/src: radeon_mm_i2c.lo
Only in /root/src: radeon_modes.lo
diff -u src/radeon_output.c /root/src/radeon_output.c
--- src/radeon_output.c 2008-10-21 10:36:22.000000000 +0200
+++ /root/src/radeon_output.c 2008-10-21 14:13:32.000000000 +0200
@@ -2653,6 +2653,7 @@
int num_vga = 0;
int num_dvi = 0;
int num_hdmi = 0;
+ char output_name[32];
/* We first get the information about all connectors from BIOS.
* This is how the card is phyiscally wired up.
@@ -2740,23 +2741,6 @@
}
info->tvdac_use_count = 0;
- for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
- if (info->BiosConnector[i].valid) {
- if (info->BiosConnector[i].DACType == DAC_TVDAC)
- info->tvdac_use_count++;
-
- if ((info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_D) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_I) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_A)) {
- num_dvi++;
- } else if (info->BiosConnector[i].ConnectorType == CONNECTOR_VGA) {
- num_vga++;
- } else if ((info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_A) ||
- (info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_B)) {
- num_hdmi++;
- }
- }
- }
/* clear the enable masks */
info->output_crt1 = 0;
@@ -2798,29 +2782,20 @@
if ((info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_D) ||
(info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_I) ||
(info->BiosConnector[i].ConnectorType == CONNECTOR_DVI_A)) {
- if (num_dvi > 1) {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-1");
- num_dvi--;
- } else {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "DVI-0");
- }
+ snprintf(output_name, 32, "DVI-%i", num_dvi++);
} else if (info->BiosConnector[i].ConnectorType == CONNECTOR_VGA) {
- if (num_vga > 1) {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-1");
- num_vga--;
- } else {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "VGA-0");
- }
+ snprintf(output_name, 32, "VGA-%i", num_vga++);
} else if ((info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_A) ||
(info->BiosConnector[i].ConnectorType == CONNECTOR_HDMI_TYPE_B)) {
- if (num_hdmi > 1) {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "HDMI-1");
- num_hdmi--;
- } else {
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, "HDMI-0");
- }
- } else
- output = xf86OutputCreate(pScrn, &radeon_output_funcs, OutputType[radeon_output->type]);
+ snprintf(output_name, 32, "HDMI-%i", num_hdmi++);
+ } else {
+ snprintf(output_name, 32, "%s", OutputType[radeon_output->type]);
+ }
+
+ output = xf86OutputCreate(pScrn, &radeon_output_funcs, output_name);
+
+ if (info->BiosConnector[i].DACType == DAC_TVDAC)
+ info->tvdac_use_count++;
if (!output) {
return FALSE;
Only in /root/src: radeon_output.lo
Only in /root/src: radeon_probe.lo
Only in /root/src: radeon_textured_video.lo
Only in /root/src: radeon_tv.lo
Only in /root/src: radeon_video.lo
Only in /root/src: radeon_vip.lo
Only in /root/src: theatre.lo
Only in /root/src: theatre200_drv.la
Only in /root/src: theatre200_drv_la-theatre200.lo
Only in /root/src: theatre200_drv_la-theatre200_module.lo
Only in /root/src: theatre_detect.lo
Only in /root/src: theatre_detect_drv.la
Only in /root/src: theatre_detect_module.lo
Only in /root/src: theatre_drv.la
Only in /root/src: theatre_module.lo
_______________________________________________
xorg-driver-ati mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-driver-ati