| commit | 960e239abb429da6f9c6718d12ffd5d649fa9892 | [log] [tgz] |
|---|---|---|
| author | Arthur Heymans <arthur@aheymans.xyz> | Tue Mar 03 19:45:24 2026 +0100 |
| committer | Nico Huber <nico.h@gmx.de> | Sat Jun 06 10:23:00 2026 +0000 |
| tree | 0d2d212be1aa9e55fe93bcf503fe17048a96b99d | |
| parent | 3c3828add50024e90e57d6fbe0e660d1b66302d9 [diff] |
gma: Add Intel i945 (Gen3) graphics init support Add i945G (desktop) and i945GM (mobile) generation support, modeled after the existing G45 generation code with hardware-specific adaptations based on the Linux i915 DRM driver and coreboot. Key hardware differences from G45 (Gen4): - GTT on separate PCI BAR3 (not within BAR0) - Simple 32-bit GTT PTEs (addr[31:12] | valid[0]) - No DSPSURF register (uses DSPADDR/DSPLINOFF instead) - Gen3 fence registers: 32-bit at split 0x2000/0x3000 addresses - Different PLL limits (VCO 1400-2800 MHz, 96 MHz refclk) - SDVO multiplier in DPLL register bits[7:4] - LVDS restricted to Pipe B (pre-i965 requirement) - CDClk: fixed 400 MHz (desktop) or GCFGC-based (mobile) - No HDMI/DP, only VGA, LVDS, and SDVO outputs - PCI IDs: 0x2772 (I945G), 0x27a2/0x27ae (I945GM) TESTED with thinkpad x60: LVDS & VGA works with a linear framebuffer. Change-Id: Ib67b3d0ee5e06df427869dce4db926ba57a80fd8 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/476 Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Tested-by: Nico Huber <nico.h@gmx.de>
libgfxinit is a graphics initialization (aka modesetting) library for embedded environments. It currently supports only Intel hardware, more specifically the Intel Core processor line.
It can query and set up most kinds of displays based on their EDID information. You can, however, also specify particular mode lines.
libgfxinit is written in SPARK, an Ada subset with formal verification aspects. Absence of runtime errors can be proved automatically with SPARK GPL 2016.
For compilation, the GNAT Ada compiler is required. Usual package names in Linux distributions are gcc-ada and gnat.
You'll need libhwbase and libgfxinit. Best is to clone the repositories into a common parent directory (this way libgfxinit will know where to find libhwbase).
$ mkdir gfxfun && cd gfxfun $ git clone https://review.coreboot.org/p/libhwbase.git $ git clone https://review.coreboot.org/p/libgfxinit.git
Both libraries are currently configured by hand-written config files. You can either write your own .config, link one of the shipped files in configs/, e.g.:
$ ln -s configs/linux libhwbase/.config
or overwrite the config filename by specifying cnf=<configfile> on the make command line.
By default most debug messages won't be compiled into the binary. To include them into the build, set DEBUG=1 on the command line or in your .config.
Let's install libhwbase. We'll need configs/linux to build regular Linux executables:
$ cd libhwbase $ make DEBUG=1 cnf=configs/linux install
By default this installs into a new subdirectory dest. You can however overwrite this decision by specifying DESTDIR=.
gfx_testlibgfxinit is configured and installed in the same manner as described above. You will have to select a configuration matching your hardware.
The makefile knows an additional target gfx_test to build a small Linux test application:
$ cd ../libgfxinit $ make DEBUG=1 cnf=configs/sandybridge gfx_test
The resulting binary is build/gfx_test.
gfx_test sets up its own framebuffer in the stolen memory. It backs any current framebuffer mapping and contents up first and restores it before exiting. This works somehow even while the i915 driver is running. A wrapper script gfxtest/gfx_test.sh is provided to help with the setup. It switches to a text console first and tries to unload the i915 driver. But ignores failures to do so (it won't work if you still have any application running that uses the gfx driver, e.g. an X server).
# gfxtest/gfx_test.sh
If you chose the right config above, you should be presented with a nice test image. But please be prepared that your console might be stuck in that state afterwards. You can try to run it with i915 deactivated then (e.g. when booting with nomodeset in the kernel command line or with i915 blacklisted) and loading it afterwards.