commit | 31042e8cb3dd2e1fbc56cd1e07b41c00c37e33c6 | [log] [tgz] |
---|---|---|
author | Nico Huber <nico.h@gmx.de> | Sun Sep 04 14:24:00 2022 |
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Dec 08 07:30:33 2022 |
tree | f795ddbcbc7724724a2719fc272a18ab76eae0f9 | |
parent | b9042e06c47658ed54ac48ec101304d54af34c78 [diff] |
gma: Correct Global annotation for Initialize() On G45, we use the private PCI device `Dev` during Power_And_Clocks.Initialize(). As its `Dev.PCI_State` is not directly visible in the sub-package, it is assumed that the whole, abstract `Device_State` can be altered. This includes `Registers.GTT_State`. Correcting the `Globals` aspect for G45 makes it excessive for other platforms, hence we need the same forest of additional justifications and anno- tations as we have for Power_Up_VGA(). (cherry picked from commit 793f4f83f128b5ed2afe9bbcc1299c625bad9a8c) Original-Change-Id: I7086b024d96f0a17f19f46f60ceac6757eb91867 Original-Signed-off-by: Nico Huber <nico.h@gmx.de> Original-Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/68111 Original-Reviewed-by: Angel Pons <th3fanbus@gmail.com> GitOrigin-RevId: 793f4f83f128b5ed2afe9bbcc1299c625bad9a8c Change-Id: I44d02f964d4ab7765c3b1ab170b035f2c37cebce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/libgfxinit/+/4085501 Commit-Queue: Kangheui Won <khwon@chromium.org> Tested-by: CopyBot Service Account <copybot.service@gmail.com> Reviewed-by: Kangheui Won <khwon@chromium.org>
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_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
.
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.