From e41479605c1b03c3717d99873f7da455b2d72808 Mon Sep 17 00:00:00 2001 From: Connor Behan Date: Wed, 1 Jul 2015 10:56:28 -0400 Subject: [PATCH] Debug try 2 --- src/r128_output.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/r128_output.c b/src/r128_output.c index cfa184a..eeecd50 100644 --- a/src/r128_output.c +++ b/src/r128_output.c @@ -273,11 +273,35 @@ static R128MonitorType R128DisplayDDCConnected(xf86OutputPtr output) MonType = MT_CRT; } } else if (xf86I2CProbeAddress(r128_output->pI2CBus, 0x0060)) { - R128TRAC(("Got it the other way\n")); + R128TRACE(("Got it the other way\n")); /* Just in case. */ MonType = MT_CRT; } + int i, j; + for (i = 0; i < 4; i++) { + for (j = 0; j < 4; j++) { + mask1 = (1 << (24 + i)) | (1 << (24 + j)); + mask2 = (1 << i) | (1 << j); + + R128I2CBusPtr pR128I2CBus = &(r128_output->ddc_i2c); + OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg) | mask1); + OUTREG(pR128I2CBus->ddc_reg, INREG(pR128I2CBus->ddc_reg) & ~mask2); + + pR128I2CBus->put_data_mask = (1 << (16 + i)); + pR128I2CBus->get_data_mask = (1 << (8 + i)); + pR128I2CBus->put_clk_mask = (1 << (16 + j)); + pR128I2CBus->get_clk_mask = (1 << (8 + j)); + *MonInfo = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), r128_output->pI2CBus); + + if (*MonInfo) { + R128TRACE(("We got moninfo\n")); + } else { + R128TRACE(("No moninfo\n")); + } + } + } + R128TRACE(("Monitor detection done\n")); return MonType; } -- 2.4.5