Comment 1 for bug 179634

Revision history for this message
Bjorn Helgaas (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.