diff --git a/src/rhd_dac.c b/src/rhd_dac.c index f253e10..0eb1d6c 100644 --- a/src/rhd_dac.c +++ b/src/rhd_dac.c @@ -650,6 +650,13 @@ DACSenseRV620(struct rhdOutput *Output, CARD32 offset, Bool TV) RHDRegMask(Output, offset + RV620_DACA_AUTODETECT_CONTROL, 0x01, 0xff); usleep(32); ret = RHDRegRead(Output, offset + RV620_DACA_AUTODETECT_STATUS); + if (!TV && !(ret & 0x111)) { + int retries = 1; + do { + usleep(32); + ret = RHDRegRead(Output, offset + RV620_DACA_AUTODETECT_STATUS); + } while (++retries <= 32 && !(ret & 0x111)); + } RHDRegWrite(Output, offset + RV620_DACA_AUTODETECT_CONTROL, DetectControl); RHDRegWrite(Output, offset + RV620_DACA_MACRO_CNTL, Control1); RHDRegWrite(Output, offset + RV620_DACA_CONTROL2, Control2); diff --git a/utils/conntest/rhd_conntest.c b/utils/conntest/rhd_conntest.c index 07a1335..7ac0e46 100644 --- a/utils/conntest/rhd_conntest.c +++ b/utils/conntest/rhd_conntest.c @@ -547,7 +547,7 @@ MapBar(struct pci_dev *device, int ioBar, int devMem) pci_fill_info(device, PCI_FILL_BASES | PCI_FILL_SIZES); if (!device->base_addr[ioBar] -#if !defined (__FreeBSD__) +#if defined (__linux__) || !device->size[ioBar] #endif ) @@ -852,9 +852,14 @@ RV620DACLoadDetect(void *map, Bool tv, int dac) /* check for connection */ RegMask(map, offset + RV620_DACA_AUTODETECT_CONTROL, 0x01, 0xff); usleep(32); - ret = RegRead(map, offset + RV620_DACA_AUTODETECT_STATUS); - + if (!tv && !(ret & 0x111)) { + int retries = 1; + do { + usleep(32); + ret = RegRead(map, offset + RV620_DACA_AUTODETECT_STATUS); + } while (++retries <= 32 && !(ret & 0x111)); + } RegWrite(map, offset + RV620_DACA_AUTODETECT_CONTROL, DetectControl); RegWrite(map, offset + RV620_DACA_CONTROL1, Control1); RegWrite(map, offset + RV620_DACA_CONTROL2, Control2);