| commit | 6dc7843082cf50e71001c9b24850bfbc86c3a39e | [log] [tgz] |
|---|---|---|
| author | Arthur Heymans <arthur@aheymans.xyz> | Thu Jun 18 09:34:50 2026 +0200 |
| committer | Nico Huber <nico.h@gmx.de> | Fri Jul 17 18:19:31 2026 +0000 |
| tree | 95cf2104a7df44ca0ab46b8b4a0c3be9ccded8f4 | |
| parent | 3d7c33f5d24b27b1b140d91af89628ea3caa86ac [diff] |
gma i945: Add Pineview support Add Pineview desktop and mobile variants to the existing i945/Gen3 code path. Pineview is close to i945, but Linux' i915 treats a few pieces differently and those differences need explicit handling: - add Pineview/Pineview_M CPU types and PCI IDs 0xa001/0xa011 - detect Pineview-M as a mobile Gen3 platform so LVDS is exposed - decode Pineview GCFGC display clock selections for 133/167/200/ 267/333/444 MHz CDClk - use the mobile/Pineview CLKCFG FSB encoding for HRAW clock - keep the separate BAR3 Gen3 GTT layout, but use the i965/G33 style PTE encoding for Pineview's 36-bit DMA addresses - add a separate Pineview DPLL calculation/programming path instead of widening the i945 PLL ranges; Pineview has a one-hot N encoding in the frequency-parameter (FP) register, no M1 divider, M = M2 + 2, and P1 at bit 15 The i945 PLL type ranges and calculation path remain unchanged. Tested with: make clean && make DEBUG=1 cnf=configs/ironlake make clean && make DEBUG=1 cnf=configs/ironlake_edp make clean && make DEBUG=1 cnf=configs/i945 Tested with coreboot on Foxconn D41S. Change-Id: I8bda5d27e1c071bd59bd9a8751dc1ea31b25614f Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/515 Tested-by: Ada SPARK <gnatbot@sourcearcade.org> Reviewed-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.