| commit | 605660bb2180acc07aad4ac11da2b28d6192d7b0 | [log] [tgz] |
|---|---|---|
| author | Tim Wawrzynczak <twawrzynczak@chromium.org> | Wed Jun 08 12:48:19 2022 -0600 |
| committer | Nico Huber <nico.h@gmx.de> | Mon May 29 19:22:30 2023 +0000 |
| tree | d1440b51ab228b826b92326f8aecad506b9460fd | |
| parent | 0dadb674cc98974378ccceccc8c557197a2bad16 [diff] |
gma: Begin Tiger Lake (TGL) integration
Tiger Lake's integrated graphics engine is built off an entirely new
igfx architecture named "Iris Xe". This patch adds just enough support
to compile for Tiger Lake. Fortunately, the backlight programming
hasn't changed since SKL, so with a little bit of hacking, one can
also have libgfxinit turn on the backlight to verify something is
working and running.
The first pass through the support will focus mostly on the eDP panel,
then Type-C ports (both in fixed/native mode [DP/HDMI] and in Type-C
DP Alt Mode). TBT will not be mostly ignored in this first pass, as
it is not as widely used (yet?) as the other protocols.
This patch includes changes to fix ironlake gnatprove errors caused by
the new PCH_HDMI_A port definition.
Tested on google/voxel, with DEBUG_ADA_CODE enabled.
Tested on google/skolas, with DEBUG_ADA_CODE enabled.
This patch leaves the following unresolved gnatprove errors:
- hw-gfx-gma-port_detect.ads:17:14:
warning: subprogram "Initialize" has no effect
- hw-gfx-gma-port_detect.ads:20:07:
warning: unused variable "Port"
- hw-gfx-gma-port_detect.ads:23:14:
warning: subprogram "Clear_Hotplug_Detect" has no effect
- hw-gfx-gma-connectors.ads:39:14:
warning: subprogram "Post_Off" has no effect
- hw-gfx-gma-connectors.ads:42:14:
warning: subprogram "Post_All_Off" has no effect
These errors will by addressed by the proper implementation of these
procedures.
Change-Id: I84f15837856ecc5ec8df18b39d3989885cd550d4
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/libgfxinit/+/70887
Tested-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Sean Rhodes <sean@starlabs.systems>
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.