commit | d9365613ea1dd31ae00bc69ebd2f7a508049b2c6 | [log] [tgz] |
---|---|---|
author | Nico Huber <nico.h@gmx.de> | Sun Jun 10 12:59:04 2018 |
committer | Nico Huber <nico.h@gmx.de> | Wed May 08 12:55:42 2019 |
tree | d8cec2ad781f7531741d7a31a7272d558066e119 | |
parent | 27088aad041b760f8b86e2c19a7a6304be43063c [diff] |
gma config: Tag constants depending on generation or CPU Tag all derived config booleans that depend on the generation <genbool> and those that may depend on the CPU with the generations where that is the case. For instance `CPU_Ivybridge` can be decided purely based on the generation unless the generation is Ironlake, thus, it is tagged <ilkbool>. For non-boolean constants, per generation tags <...var> are introduced (e.g. <ilkvar>) with similar meaning. This will allow us to make them variables later, based on the generation. To ease later parsing, also move all multiline expressions after a line break. Change-Id: Iaa50987c51dc62ab2eb8b31e8f223b8a94e8ac12 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/27067 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
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 verifica- tion 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 reposi- tories 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_test
libgfxinit is configured and installed in the same manner as de- scribed 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 re- stores it before exiting. This works somehow even while the i915 driver is running. A wrapper script gfxtest/gfx_test.sh
is pro- vided 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.