VIA Unichrome FrameBuffer Memory Problem
Posted: Sat Jan 19, 2008 8:01 am
Hi
I have been trying to put together a Graphics Driver for my VIA Unichrome CLE266 CX that is just sufficient to push the screenmode into a FrameBuffered 1024x768x32bitx60Hz.
Using the VGA specifications and the free-available VIA Framebuffer source, I have succeded in getting the mode to display correctly, but I have having an odd problem with the actual accessing of the the FrameBuffer memory.
The Display mode I am using should use exactly 3Mb of memory for it's buffer, and should be a simple packed-pixel (or chunky) display mode. The problem I am getting is that when I try to access the buffer memory in odd numbered megabytes, it actually access the memory in the previous, even numbered, megabyte (for example, accessing the memory 1Mb into the buffer actually access the memory at the beginning of the buffer).
According to the PCI Configuration for the card, the graphics card memory starts at 0xE0000000, and I have assigned 64Mb of shared memory to the card through the BIOS, both of which I have proven experimentally.
To demonstrate this, I used the following code:
The output of this is, unfortunately:
The write to TestB overwrote the data in TestA, and similarly TestD overwrote TestC.
The on-screen result is that the top and bottom thirds of the screen work correctly, but the middle one-third of my screen displays garbage data. Any attempt to write to this middle one-third actually overwrites the data in the top one-third.
My only thought is that this is some kind of behaviour designed to emulate a 1Mb graphics card, so any writes above 1Mb wrap around, but I haven't been able to find any setting to control this.
Has anyone had experience with this specific system or of a similar problem that I could experiment with that may yield a solution?
Are there any VGA configuration options that I may have missed that cause a similar effect in VGA modes?
I have been trying to put together a Graphics Driver for my VIA Unichrome CLE266 CX that is just sufficient to push the screenmode into a FrameBuffered 1024x768x32bitx60Hz.
Using the VGA specifications and the free-available VIA Framebuffer source, I have succeded in getting the mode to display correctly, but I have having an odd problem with the actual accessing of the the FrameBuffer memory.
The Display mode I am using should use exactly 3Mb of memory for it's buffer, and should be a simple packed-pixel (or chunky) display mode. The problem I am getting is that when I try to access the buffer memory in odd numbered megabytes, it actually access the memory in the previous, even numbered, megabyte (for example, accessing the memory 1Mb into the buffer actually access the memory at the beginning of the buffer).
According to the PCI Configuration for the card, the graphics card memory starts at 0xE0000000, and I have assigned 64Mb of shared memory to the card through the BIOS, both of which I have proven experimentally.
To demonstrate this, I used the following code:
Code: Select all
{
// Perform a few reads and writes to test the memory
unsigned int* lTestA = (unsigned int *)0xE0000000; // Start of Framebuffer Memory
unsigned int* lTestB = (unsigned int *)0xE0100000; // 1Mb
unsigned int* lTestC = (unsigned int *)0xE0200000; // 2Mb
unsigned int* lTestD = (unsigned int *)0xE0300000; // 3Mb
*lTestA = 0xDE;
*lTestB = 0xAD;
*lTestC = 0xBE;
*lTestD = 0xEF;
kprintf("TestA = 0x%02X\n", *lTestA);
kprintf("TestB = 0x%02X\n", *lTestB);
kprintf("TestC = 0x%02X\n", *lTestC);
kprintf("TestD = 0x%02X\n", *lTestD);
}
Code: Select all
TestA = 0xAD
TestB = 0xAD
TestC = 0xEF
TestD = 0xEF
The on-screen result is that the top and bottom thirds of the screen work correctly, but the middle one-third of my screen displays garbage data. Any attempt to write to this middle one-third actually overwrites the data in the top one-third.
My only thought is that this is some kind of behaviour designed to emulate a 1Mb graphics card, so any writes above 1Mb wrap around, but I haven't been able to find any setting to control this.
Has anyone had experience with this specific system or of a similar problem that I could experiment with that may yield a solution?
Are there any VGA configuration options that I may have missed that cause a similar effect in VGA modes?