Setting up a linear frame buffer without a BIOS
Re: Setting up a linear frame buffer without a BIOS
Split off the Unicode discussion.
-
- Posts: 5
- Joined: Tue May 26, 2015 11:53 pm
- Libera.chat IRC: GreaseMonkey
Re: Setting up a linear frame buffer without a BIOS
I've managed to get a display mode for an Intel Gen4.5 laptop and a Gen6 laptop. It's not the "recommended method" (*that* involves turning the screen off then on again) but it's *probably* safe.rdos wrote:...it would be better to simply setup the LFB in a driver, while NOT bothering with the acceleration support or 3D. After all, this shouldn't be so hard to do. Anybody tried to do this, and if so, is it possible to do without enormous amount of work? I'm primarily interested in Intel's and...
It's not an enormous amount of work, but here it is (note, you CANNOT assume that it uses Pipe B - on my Gen6 laptop it was using Pipe A!):
- Firstly, locate the GPU via the PCI bus. The 64-bit value at 0x10 contains the address of the MMIO registers, the 64-bit value at 0x18 contains the address of the stolen video memory. Mask out the bottom 4 bits to get the actual address.
- Turn the emulated VGA screen off via VGA sequence register 0x01. (PRMs say if you don't do this the CPU and/or GPU can randomly hang)
- Wait at least 100us.
- Get the pipe used by the VGA emulation via VGACNTRL, then turn it off via that register. This register was relocated in Gen5, so make sure you know which architecture revision you're targeting!
- Disable the "display" that was being used.
- Read the low 16-bits of HTOTAL_n and VTOTAL_n to get the resolution, then store the pipe source resolution in PIPEnSRC (n is either A or B).
- If you are using a pre Gen5 system, turn the panelfitter off. You have to turn the pipe off before you do this, and turn it on afterwards. The PRMs should explain how turning the pipe off and on again is done.
- Configure then enable the "display" that you are using. You will probably want a 32bpp linear mode w/ no pixel width/height multiplier, so you'd set that in DSPnCNTR. DSPnLINOFFSET (offset from base address for scrolling and whatnot), DSPnSTRIDE (line pitch in bytes), and DSPnSURF (base address) are the other registers you'll want to set.
Re: Setting up a linear frame buffer without a BIOS
How do you figure out which generation you have (according to your count)?
How do you disable any companion GPUs such that the intel card gets to drive the output?
How do you disable any companion GPUs such that the intel card gets to drive the output?
-
- Posts: 5
- Joined: Tue May 26, 2015 11:53 pm
- Libera.chat IRC: GreaseMonkey
Re: Setting up a linear frame buffer without a BIOS
Look through here and compare product IDs: http://en.wikipedia.org/wiki/List_of_In ... sing_unitsCandy wrote:How do you figure out which generation you have (according to your count)?
Also, check against the documentation that you have. The G35/965 docs are for Gen4, the G45 docs are for Gen4.5 (if I understand correctly - it might just be called Gen4, who knows), the rest appears to be straightforward (Ironlake is Gen5, Sandy Bridge is Gen6, Ivy Bridge is Gen7).
My Gen4.5 device is classified as DevCTG ("Cantiga"), my Gen6 HD 3000 is simply classified as DevSNB ("Sandy Bridge") although I'm not sure what GT version (probably GT2).
Checking against the documentation is important as different chips within the same architecture revision have different features and different bugs.
For more modern switchable-GPU setups, the Intel GPU drives the display, and you copy the result from the discrete GPU to the Intel GPU.Candy wrote:How do you disable any companion GPUs such that the intel card gets to drive the output?
If you actually want to disable the discrete GPU entirely (thus keeping your system cooler and doubling its battery life), you use ACPI. In the case of my Gen6 laptop w/ an AMD Radeon 6700M, I would call \_SB.PCI0.PEG0.PEGP._OFF with an argument of 1.
Older switchable-GPU setups have some sort of hardware multiplexer. I don't have any information on how to deal to these.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Setting up a linear frame buffer without a BIOS
If you're feeling up to it, please contribute some of the information you've learned to the Wiki.
http://wiki.osdev.org/
You can add yourself to the group here.
EDIT: Apparently you've already done so!
http://wiki.osdev.org/
You can add yourself to the group here.
EDIT: Apparently you've already done so!