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'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.
>
>
>
G'day Bjorn, www.openchrome. org/trac www.openchrome. org/trac/ browser/ trunk/src/ via_driver. c
I've seen source for doing this sort of thing in the OpenChrome
driver. The source repository can be accessed through
http://
and the particular file at
http://
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 linux.via. com.tw/ support/ downloadFiles. action
documentation on some of the video chips. See
http://
Hope this is helpful,
Arthur
Bjorn Helgaas wrote:
>I'd like to fix the kernel vt8623fb driver. It sounds like it'd be best freedesktop. org/~libv/ xf86-video- pScrn-> scrnIndex, X_WARNING, "%s: VideoRam Scratch area" pScrn-> scrnIndex, X_WARNING, "%s: VideoRam Scratch area"
>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.
>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(
> " 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(
> " uninitialised.\n", __func__);
> Scratch->VideoRam = 16 << 10;
> }
>
>That looks like it still reads the scratch registers, not the RAM
>controller.
>
>
>