Korona wrote:
Yes. I think on many BIOSes, you can configure the size of the reserved buffer. Usually, it should be enough to hold a framebuffer though. You can dump the GTT to be sure.
You have to set the framebuffer offset in one of the GPUs registers (one of the primary plane registers on the generation that I was dealing with; this has probably not changed). Note that you set the offset relative to the start of video memory, not the address. Accessing video memory through BAR2 is correct.
It's somewhat strange that you cannot see output. Setting the mode correctly is much harder than dealing with the GTT and the framebuffer.
Is your code public?
If you're talking about BAR 2 (your reserved buffer?) then it is 256 MB in size. Which is more than plenty.
There is a register called PLANE_SURFACE_1_A which has the surface base address (the offset you're talking about).
I'll quote it:
Quote:
This address specifies the surface base address bits 31:12. In stereo 3D mode this is the right eye
base address. In non-stereo 3D mode this is the only base address. It represents an offset from
the graphics memory aperture base and is mapped to physical pages through the global GTT.
I've tried setting it to different values including 0 and other addresses, no progress.
So, you're saying that the address of my video memory is BAR_2 + whatever offset I choose? The question is, why can't the offset be zero (like in your code)?
My code is not public.
Here is a relevant chunk:
Code:
//Mode setting happens in here...//
framebuffer = (uint32_t*) (BAR_2 + 0x01230000);
plane_surface_1_A[0] = 0x01230000;
for(uint32_t x = 0; x < 1920; x++)
{
for(uint32_t y = 0; y < 1080; y++)
{
framebuffer[(y * 1920) + x] = 0xFFFFFFFF;
}
}
The only thing I see is a black illuminated screen.