From bdca7fd77f8e8d33616da05c2a5160dafcad0d39 Mon Sep 17 00:00:00 2001 From: Kevin Brace Date: Wed, 24 Feb 2016 17:42:38 -0800 Subject: [PATCH 3/3] Altering external DVI transmitter (VT1632A) monitor detection method Changed the way DVI monitor is detected if it is connected to VT1632A DVI trasmitter. Now I2C bus 3 can be used with VT1632A. The detection algorithm is still far from perfect, but hopefully good enough for now that it can coexist with an integrated DVI (TMDS) transmitter present in CX and VX series chipsets (i.e., CX700 and VX900 chipsets). Signed-off-by: Kevin Brace --- src/via_outputs.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/src/via_outputs.c b/src/via_outputs.c index ada1666..af4f6e9 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -1017,13 +1017,61 @@ via_dvi_detect(xf86OutputPtr output) VIAPtr pVia = VIAPTR(pScrn); xf86MonPtr mon; - mon = xf86OutputGetEDID(output, pVia->pI2CBus2); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Entered via_dvi_detect.\n")); + + /* Probe I2C bus 3 to see if a digital interface based monitor */ + /* is connected. */ + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Probing I2C Bus 3 for a monitor.\n"); + mon = xf86OutputGetEDID(output, pVia->pI2CBus3); if (mon && DIGITAL(mon->features.input_type)) { - xf86OutputSetEDID(output, mon); - status = XF86OutputStatusConnected; + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Now, determine DVI status.\n"); + status = via_vt1632_detect(output); + if (status == XF86OutputStatusConnected) { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DVI monitor detected on I2C Bus 3.\n"); + xf86OutputSetEDID(output, mon); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting via_dvi_detect.\n")); + return status; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DVI monitor not detected on I2C Bus 3.\n"); + } } else { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DVI monitor not detected on I2C Bus 3.\n"); + } + + /* Probe I2C bus 2 to see if a digital interface based monitor */ + /* is connected. */ + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Probing I2C Bus 2 for a monitor.\n"); + mon = xf86OutputGetEDID(output, pVia->pI2CBus2); + if (mon && DIGITAL(mon->features.input_type)) { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "Now, determine DVI status.\n"); status = via_vt1632_detect(output); + if (status == XF86OutputStatusConnected) { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DVI monitor detected on I2C Bus 2.\n"); + xf86OutputSetEDID(output, mon); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting via_dvi_detect.\n")); + return status; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DVI monitor not detected on I2C Bus 2.\n"); + } + } else { + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, + "DVI monitor not detected on I2C Bus 2.\n"); } + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Exiting via_dvi_detect.\n")); return status; } -- 1.7.9.5