Go to file
Tim Wawrzynczak 4be2e75658 gma: Update transcoder setup for TGL
Tiger Lake requires configuration (but not enablement) of the
transcoder during the modeset sequence itself, so this patch adds a
new Config option to accommodate that and refactors the transcoder
setup into two new procedures.  There should be no functional
differences for other generations.

Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Change-Id: I4d7e2a24c54fcd9994f44bb0b10924dce48068e5
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/67493
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Nico Huber <nico.h@gmx.de>
2024-02-29 15:11:40 +00:00
common gma: Update transcoder setup for TGL 2024-02-29 15:11:40 +00:00
configs gma: Begin Alder Lake (ADL) integration 2023-05-29 19:22:30 +00:00
gfxtest gfxtest: Re-arrange debug output to avoid dynamic allocation 2021-06-13 20:11:44 +00:00
.gitignore Initial upstream commit 2016-10-09 11:34:25 +02:00
COPYING Initial upstream commit 2016-10-09 11:34:25 +02:00
Makefile Add linux user-space app `gfx_test` 2017-06-06 17:52:22 +02:00
Makefile.inc Add linux user-space app `gfx_test` 2017-06-06 17:52:22 +02:00
README.md README: Fix hyphenations in markdown 2022-05-02 20:18:06 +00:00
TODO gma skl: Disable DDI clocks on reset path 2017-08-30 15:14:08 +00:00

README.md

libgfxinit

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.

Building on Linux

Prerequisites

For compilation, the GNAT Ada compiler is required. Usual package names in Linux distributions are gcc-ada and gnat.

Grab the Sources

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

Configure and Install libhwbase

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=.

Build libgfxinit/gfx_test

libgfxinit 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.

Testing libgfxinit on Linux

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.