Hi, I have made some progress:
- I updated the output sensing patch to support the VT1625S. The power register has the same layout as the status register. A 0 is always for the DACs that are not present, so writing all 1-bits and reading back the register results in a mask of which DACs are actually present.
- The number of tv registers on the VT1625 is 0x82, not 0x6C. This should not matter for anything currently in place.
- The tv screen is lighting up now. Apparently xf86OutputPtr->possible_crtcs should have a value of 1 or higher for it to be a valid configuration.
Don't get excited yet, the output is a complete mess. It seems the driver only reports one modeline, 640x480, which I believe has never worked for me anyway. Only 720x576 worked. I guess that is because the some of the registers are not set correctly and 720x576 works because it is the default set by the BIOS (for PAL).
But first I'll try to get the driver to report all supported modelines. Attached are the patches of what I have so far.
On 23-11-12 00:40, Willem van Asperen wrote:
I've applied Harry's patch and it now correctly senses the TV-Out, so good work Harry!
I kind of expected it to work for you since we seem to have exactly the same board :-)
Cheers, Harry
>From c4a0fbe82b422fe4d14bf5336052b2c067ee49ee Mon Sep 17 00:00:00 2001 From: Harry de Boer <ha...@ijscoboer.nl> Date: Thu, 22 Nov 2012 13:21:36 +0100 Subject: [PATCH 1/3] Fix VT1625 output sensing. VT1625DACSenseI2C was using the same code as VT162xDACSenseI2C but the DAC sensing bit is in a different register for the VT1625. Also adds support for the VT1625S which has only four DACs. --- src/via_vt162x.c | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/via_vt162x.c b/src/via_vt162x.c index f13a94b..91dc8cb 100644 --- a/src/via_vt162x.c +++ b/src/via_vt162x.c @@ -210,21 +210,42 @@ VT162xDACSenseI2C(I2CDevPtr pDev) } /* - * VT1625 moves DACa through DACd from bits 0-3 to 2-5. + * VT1625/VT1625S sense connected TV outputs. + * + * The lower six bits of the return byte stand for each of the six DACs: + * - bit 0: DACf (Cb) + * - bit 1: DACe (Cr) + * - bit 2: DACd (Y) + * - bit 3: DACc (Composite) + * - bit 4: DACb (S-Video C) + * - bit 5: DACa (S-Video Y) + * + * If a bit is 0 it means a cable is connected. Note the VT1625S only has + * four DACs, corresponding to bit 0-3 above. */ static CARD8 VT1625DACSenseI2C(I2CDevPtr pDev) { - CARD8 save, sense; - - xf86I2CReadByte(pDev, 0x0E, &save); - xf86I2CWriteByte(pDev, 0x0E, 0x00); - xf86I2CWriteByte(pDev, 0x0E, 0x80); - xf86I2CWriteByte(pDev, 0x0E, 0x00); - xf86I2CReadByte(pDev, 0x0F, &sense); - xf86I2CWriteByte(pDev, 0x0E, save); - - return (sense & 0x3F); + CARD8 power, status, overflow, dacPresent; + + xf86I2CReadByte(pDev, 0x0E, &power); // save power state + + // VT1625S will always report 0 for bits 4 and 5 of the status register as + // it only has four DACs instead of six. This will result in a false + // positive for the S-Video cable. It will also do this on the power + // register, which is abused to check which DACs are actually present. + xf86I2CWriteByte(pDev, 0x0E, 0xFF); + xf86I2CReadByte(pDev, 0x0E, &dacPresent); + + xf86I2CWriteByte(pDev, 0x0E, 0x00); // power on DACs/circuits + xf86I2CReadByte(pDev, 0x1C, &overflow); // save overflow reg (DAC sense bit should be off) + xf86I2CWriteByte(pDev, 0x1C, 0x80); // enable DAC sense bit + xf86I2CWriteByte(pDev, 0x1C, overflow); // disable DAC sense bit + xf86I2CReadByte(pDev, 0x0F, &status); // read connection status + xf86I2CWriteByte(pDev, 0x0E, power); // restore power state + status |= ~dacPresent; + + return (status & 0x3F); } /* -- 1.7.10.4
>From 65beba342aacba3c6de85a1450a763ccbf8d0163 Mon Sep 17 00:00:00 2001 From: Harry de Boer <ha...@ijscoboer.nl> Date: Thu, 22 Nov 2012 22:41:50 +0100 Subject: [PATCH 2/3] VT1625 register count is 0x82 --- src/via_vt162x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/via_vt162x.c b/src/via_vt162x.c index 91dc8cb..0c558f4 100644 --- a/src/via_vt162x.c +++ b/src/via_vt162x.c @@ -908,7 +908,7 @@ ViaVT162xInit(ScrnInfoPtr pScrn) pBIOSInfo->TVPower = VT1625Power; pBIOSInfo->TVModes = VT1625Modes; pBIOSInfo->TVPrintRegs = VT162xPrintRegs; - pBIOSInfo->TVNumRegs = 0x6C; + pBIOSInfo->TVNumRegs = 0x82; break; default: break; -- 1.7.10.4
>From e00d189c634c36b7c3b984894b9e048231608bf1 Mon Sep 17 00:00:00 2001 From: Harry de Boer <ha...@ijscoboer.nl> Date: Mon, 26 Nov 2012 02:58:25 +0100 Subject: [PATCH 3/3] There is a possible crtc for TV-1 --- src/via_driver.c | 4 +++- src/via_outputs.c | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/via_driver.c b/src/via_driver.c index 8542ef2..bf3e1fb 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -1537,8 +1537,10 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) } } - if (!xf86InitialConfiguration(pScrn, TRUE)) + if (!xf86InitialConfiguration(pScrn, TRUE)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Initial configuration failed\n"); return FALSE; + } if (!pScrn->modes) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n"); diff --git a/src/via_outputs.c b/src/via_outputs.c index 75d312c..0620a12 100644 --- a/src/via_outputs.c +++ b/src/via_outputs.c @@ -466,6 +466,13 @@ via_tv_init(ScrnInfoPtr pScrn) output = xf86OutputCreate(pScrn, &via_tv_funcs, "TV-1"); pVia->FirstInit = TRUE; + + if (output) { + output->possible_crtcs = 0x1; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "via_tv_init: Failed to create output for TV-1.\n"); + } + pBIOSInfo->tv = output; /* Save now */ pBIOSInfo->TVSave(pScrn); -- 1.7.10.4
_______________________________________________ Openchrome-devel mailing list Openchrome-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/openchrome-devel