summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorEgbert Eich <eich@freedesktop.org>2008-03-10 11:26:38 +0100
committerEgbert Eich <eich@freedesktop.org>2008-03-12 21:29:57 +0100
commit5596d06da56a299a42818a63ec15b72393703861 (patch)
treec417da7091f773f7a2667c0a8e2d61b1aa0306b6 /utils
parentc9ccc4c474af39b583073ea083a61a7b0f711ad3 (diff)
Fix issues with DAC load detection and erronous DDC detection on RV620/635.
Some BIOSes leave DDET_REF_EN or SDET_REF_EN set. This changes the DAC comparator reference. We turn off either. DDC may also time out or be aborted - in which case the result is also invalid. Let the status function check for that.
Diffstat (limited to 'utils')
-rw-r--r--utils/conntest/rhd_conntest.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/utils/conntest/rhd_conntest.c b/utils/conntest/rhd_conntest.c
index f69682b..4d69da3 100644
--- a/utils/conntest/rhd_conntest.c
+++ b/utils/conntest/rhd_conntest.c
@@ -435,6 +435,7 @@ struct RHDDevice {
{ 0x1002, 0x958E, 2, RHD_R600},
{ 0x1002, 0x9598, 2, RHD_RV620},
{ 0x1002, 0x95C5, 2, RHD_RV620},
+ { 0x1002, 0x9612, 2, RHD_RV620},
{ 0, 0, 0, 0 }
};
@@ -636,11 +637,9 @@ DACLoadDetect(void *map, Bool tv, int dac)
* but we don't bother with this at the moment.
*/
ret = (RegRead(map, offset + DACA_COMPARATOR_OUTPUT) & 0x0E) >> 1;
-#define DEBUG
#ifdef DEBUG
fprintf(stderr, "DAC%s: %x %s\n", dac ? "B" : "A", ret, tv ? "TV" : "");
#endif
-#undef DEBUG
RegMask(map, offset + DACA_COMPARATOR_ENABLE, CompEnable, 0x00FFFFFF);
RegWrite(map, offset + DACA_CONTROL1, Control1);
RegMask(map, offset + DACA_CONTROL2, Control2, 0x1FF);
@@ -685,7 +684,6 @@ RV620DACLoadDetect(void *map, Bool tv, int dac)
AutodetectIntCtl = RegRead(map, offset + RV620_DACA_AUTODETECT_INT_CONTROL);
DetectControl = RegRead(map, offset + RV620_DACA_AUTODETECT_CONTROL);
CompEnable = RegRead(map, offset + RV620_DACA_COMPARATOR_ENABLE);
-
#if 0
if (RegRead(map, offset + 0x7000) & 0x01) {
CARD32 my_offset = 0;
@@ -723,8 +721,10 @@ RV620DACLoadDetect(void *map, Bool tv, int dac)
/* bandgap */
RegMask(map, offset + RV620_DACA_CONTROL1, dac ? 0x2502 : 0x2002, 0xffff);
/* DAC RGB async enable */
- RegMask(map, offset + RV620_DACA_COMPARATOR_ENABLE, 0x70000, 0x070000);
-
+ RegMask(map, offset + RV620_DACA_CONTROL2, 0x1, 0x1);
+ /* enable r/g/b comparators, disable D/SDET ref */
+ RegMask(map, offset + RV620_DACA_COMPARATOR_ENABLE, 0x70000, 0x070101);
+ usleep(100);
/* check for connection */
RegMask(map, offset + RV620_DACA_AUTODETECT_CONTROL, 0x01, 0xff);
usleep(32);
@@ -1763,7 +1763,8 @@ RV620I2CStatus(void *map)
RegMask(map, RV62_GENERIC_I2C_INTERRUPT_CONTROL, 0x2, 0xff);
if (!count
- || (val & (RV62_GENERIC_I2C_STOPPED_ON_NACK | RV62_GENERIC_I2C_NACK)))
+ || (val & (RV62_GENERIC_I2C_STOPPED_ON_NACK | RV62_GENERIC_I2C_NACK
+ | RV62_GENERIC_I2C_TIMEOUT | RV62_GENERIC_I2C_ABORTED)))
return FALSE; /* 2 */
return TRUE; /* 1 */
@@ -1920,6 +1921,9 @@ RV620I2CWriteRead(void *map, CARD8 line, CARD8 slave,
return TRUE;
}
+/*
+ *
+ */
static Bool
RV620DDCProbe(void *map, int Channel, unsigned char slave)
{