Comment 2 for bug 179634

Revision history for this message
Arthur Hartwig (a-hartwig) wrote : Re: [Bug 179634] Re: Jerky audio and video on GA-PCV2 motherboard (CLE-266 video)

G'day Bjorn,
    I've seen source for doing this sort of thing in the OpenChrome
driver. The source repository can be accessed through
http://www.openchrome.org/trac
and the particular file at
http://www.openchrome.org/trac/browser/trunk/src/via_driver.c
The size of the video ram is calculated inVIAPreInit() in the switch
statement at file line 1093

I have used lspci to look at the pci configuration registers and can
verify that the bits referenced in this code accurately reflect the
video ram settings of the BIOS.

    I understand Via has recently released some programming
documentation on some of the video chips. See
http://linux.via.com.tw/support/downloadFiles.action

Hope this is helpful,
Arthur

Bjorn Helgaas wrote:

>I'd like to fix the kernel vt8623fb driver. It sounds like it'd be best
>to read the information directly from the RAM controller. Can you point
>me at any code that does that?
>
>I found some code here: git://people.freedesktop.org/~libv/xf86-video-
>unichrome/, but it looks like this (from ViaScratchGet() in
>src/via_driver.c):
>
> /*
> * Get Memory size first. Should really use the RAM controller pci config.
> */
> if (pVia->Chipset == VT3122) {
> tmp = hwp->readSeq(hwp, 0x34);
>
> if (!tmp) {
> xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: VideoRam Scratch area"
> " uninitialised. Trying CR39.\n", __func__);
> tmp = hwp->readSeq(hwp, 0x39);
> }
> } else
> tmp = hwp->readSeq(hwp, 0x39);
>
> if ((tmp > 16) && (tmp <= 128))
> Scratch->VideoRam = (tmp + 1) << 9;
> else if ((tmp > 0) && (tmp < 31))
> Scratch->VideoRam = tmp << 12;
> else {
> xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "%s: VideoRam Scratch area"
> " uninitialised.\n", __func__);
> Scratch->VideoRam = 16 << 10;
> }
>
>That looks like it still reads the scratch registers, not the RAM
>controller.
>
>
>