Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -136,24 +136,18 @@

Mesa, at this point in time, is a collection of Graphics (GFX) tools and
utilities for setting up and interacting with rendering contexts. It has
everything from a DRI "megadriver" to full GLES/GL implementations. If you're
interested in learning GFX under Linux it is worth familiarizing yourself with
everything else it provides.
everything from a driver selection system to full GLES/GL implementations. If

Check warning on line 139 in source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Slash] Use either 'or' or 'and' in 'GLES/GL' Raw Output: {"message":"[RedHat.Slash] Use either 'or' or 'and' in 'GLES/GL'","location":{"path":"source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst","range":{"start":{"line":139,"column":51},"end":{"line":139,"column":58}}},"severity":"WARNING","code":{"value":"RedHat.Slash","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#slash"}}

Check warning on line 139 in source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'GLES') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message":"[RedHat.Definitions] Define acronyms and abbreviations (such as 'GLES') on first occurrence if they're likely to be unfamiliar.","location":{"path":"source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst","range":{"start":{"line":139,"column":51},"end":{"line":139,"column":55}}},"severity":"INFO","code":{"value":"RedHat.Definitions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#definitions"}}
you're interested in learning GFX under Linux it is worth familiarizing yourself
with everything else it provides.

For us, the important part is that DRI megadriver. This is the mechanism used to
decide what GLES / GL implementation to pick when you bind one of the earlier
mentioned API to a context. This is also where things get tricky.
With mesa 25.X the legacy DRI interface is no longer present. With this update

Check warning on line 143 in source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'DRI') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message":"[RedHat.Definitions] Define acronyms and abbreviations (such as 'DRI') on first occurrence if they're likely to be unfamiliar.","location":{"path":"source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst","range":{"start":{"line":143,"column":27},"end":{"line":143,"column":30}}},"severity":"INFO","code":{"value":"RedHat.Definitions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#definitions"}}

Check warning on line 143 in source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.TermsSuggestions] Depending on the context, consider using 'existing', 'traditional', 'established', 'classic', 'earlier', or 'previous' rather than 'legacy'. Raw Output: {"message":"[RedHat.TermsSuggestions] Depending on the context, consider using 'existing', 'traditional', 'established', 'classic', 'earlier', or 'previous' rather than 'legacy'.","location":{"path":"source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst","range":{"start":{"line":143,"column":20},"end":{"line":143,"column":26}}},"severity":"INFO","code":{"value":"RedHat.TermsSuggestions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#terms-suggestions"}}
``kmsro`` binds displays to their associated drivers. We still need a small shim
to load our GLES implementation and configure the mesa dispatch table.

Check warning on line 145 in source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'GLES') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message":"[RedHat.Definitions] Define acronyms and abbreviations (such as 'GLES') on first occurrence if they're likely to be unfamiliar.","location":{"path":"source/linux/Foundational_Components/Graphics/Rogue/Build_Guide.rst","range":{"start":{"line":145,"column":13},"end":{"line":145,"column":17}}},"severity":"INFO","code":{"value":"RedHat.Definitions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#definitions"}}

Historically there has been some issues with embedded GFX because, unlike your
standard PC GPU, we tend to mix and match actual Graphics Processing Units and
Display Controllers. The megadriver uses the display device name to coordinate
between API implementations. As such, we need a shim to act as a ``tidss`` DRI
driver and coordinate the link with the PVR GLES implementation.

This shim, currently, takes the form of a Gallium Frontend. This is the main
This shim, currently, is in the form of a gallium driver. This is the main
reason for the fork and the 60 odd patches we carry at the following repository:

https://gitlab.freedesktop.org/StaticRocket/mesa
https://github.com/texasInstruments/mesa

There are also other nice-to-have features there such as additional pixel
formats, minor fix-ups, and a few performance tweaks Imagination has picked up
Expand All @@ -164,7 +158,8 @@

We recommend following the `Mesa build guide`_ for general options. Currently
the mesa components use a standard interface that allows the use of any
``powervr/*`` branch.
``powervr/*`` branch. This guide expects a version equal to or greater than
``25.2.8``.

.. note::

Expand All @@ -176,26 +171,14 @@
- ``-Dgallium-drivers=pvr`` -- This is a comma separated list, just make sure
pvr is present in it.

- ``-Dgallium-pvr-alias=tidss`` -- This should match the display controller
you want to bind to. For all K3 devices this is ``tidss``.

- ``-Dvulkan-drivers=pvr`` -- If using Vulkan

This will produce 2 important files relevant to the shim mechanism we discussed
earlier:

- :file:`pvr_dri.so` -- Main DRI interface

- :file:`tidss_dri.so` -- Display controller interface that points back at
:file:`pvr_dri.so`. This uses the value specified with
``-Dgallium-pvr-alias``.

Using the proprietary stack
===========================

Assuming you're using the SDK or you've built and installed the earlier parts
correctly, you should see a message similar to the following in :command:`dmesg`
after the kernel module has loaded:
after the kernel module loads:

.. code-block:: dmesg

Expand Down
111 changes: 52 additions & 59 deletions source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
SGX build guide
###############

The graphics stack on SGX will not receive any new major updates. The last major
change occurred in release 09.01. This will capture the build process and some
of the caveats of this legacy driver.
The graphics stack on SGX will not receive any major feature updates. The last

Check warning on line 5 in source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'SGX') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message":"[RedHat.Definitions] Define acronyms and abbreviations (such as 'SGX') on first occurrence if they're likely to be unfamiliar.","location":{"path":"source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst","range":{"start":{"line":5,"column":23},"end":{"line":5,"column":26}}},"severity":"INFO","code":{"value":"RedHat.Definitions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#definitions"}}
major change occurred in release 12.02.

As part of the kernel 6.1 support effort, this driver now mimics the build and
structure of rogue. The stack consists of 3 main components with varying
Expand Down Expand Up @@ -36,8 +35,8 @@

The latest branch has the most bug-fixes and has the widest general
compatibility in modern applications. This is ``1.17.4948957/mesa/k6.1``, and
despite the mention of kernel 6.1 it is also interoperable with kernel 6.6 and
6.12.
despite the mention of kernel 6.1 it is also interoperable with kernel 6.6,
6.12, and 6.18.

The :file:`INSTALL` file gives a brief overview of how to build and install the
module. This gives you the common variables, but it does omit some of the more
Expand All @@ -57,7 +56,7 @@

As before mentioned these build options must match with the corresponding UM
build options. Currently we only release binaries with ``BUILD=release`` and
``WINDOW_SYSTEM=lws-generic``. The UM section will go previous exceptions
``WINDOW_SYSTEM=lws-generic``. The UM section will go over earlier exceptions
to this.

*************************
Expand All @@ -66,7 +65,7 @@

The proprietary user space components are necessary for all interactions with
the GPU. It has the firmware, GLES implementation, and the primary control
server. Unlike rogue, the firmware part of the control sever library.
server. Unlike rogue, the firmware is part of the control sever library.

The binary release is available at:

Expand All @@ -78,8 +77,8 @@
The repository has binaries for each platform in release specific branches. The
newest release, which matches with the earlier mentioned kernel module branch is
``1.17.4948957/mesa/glibc-2.35``. This branch deviates from the existing naming
pattern to indicate that unlike previous releases it required a new version of
mesa and was linked against glibc-2.35.
pattern to indicate that, unlike other releases, it requires a new version of
mesa and at least glibc-2.35.

The repository has the following structure:

Expand Down Expand Up @@ -138,63 +137,51 @@

Mesa, at this point in time, is a collection of Graphics (GFX) tools and
utilities for setting up and interacting with rendering contexts. It has
everything from a DRI "megadriver" to full GLES/GL implementations. If you're
interested in learning GFX under Linux it is worth familiarizing yourself with
everything else it provides.
everything from a driver selection system to full GLES/GL implementations. If

Check warning on line 140 in source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Slash] Use either 'or' or 'and' in 'GLES/GL' Raw Output: {"message":"[RedHat.Slash] Use either 'or' or 'and' in 'GLES/GL'","location":{"path":"source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst","range":{"start":{"line":140,"column":51},"end":{"line":140,"column":58}}},"severity":"WARNING","code":{"value":"RedHat.Slash","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#slash"}}

Check warning on line 140 in source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'GLES') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message":"[RedHat.Definitions] Define acronyms and abbreviations (such as 'GLES') on first occurrence if they're likely to be unfamiliar.","location":{"path":"source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst","range":{"start":{"line":140,"column":51},"end":{"line":140,"column":55}}},"severity":"INFO","code":{"value":"RedHat.Definitions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#definitions"}}
you're interested in learning GFX under Linux it is worth familiarizing yourself
with everything else it provides.

For us, the important part is that DRI "megadriver." This is the mechanism used
to decide what GLES / GL implementation gets selected when you bind one of the
before mentioned API to a context. This is also where things get tricky.
With mesa 25.X the legacy DRI interface is no longer present. With this update

Check warning on line 144 in source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.Definitions] Define acronyms and abbreviations (such as 'DRI') on first occurrence if they're likely to be unfamiliar. Raw Output: {"message":"[RedHat.Definitions] Define acronyms and abbreviations (such as 'DRI') on first occurrence if they're likely to be unfamiliar.","location":{"path":"source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst","range":{"start":{"line":144,"column":27},"end":{"line":144,"column":30}}},"severity":"INFO","code":{"value":"RedHat.Definitions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#definitions"}}

Check warning on line 144 in source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [RedHat.TermsSuggestions] Depending on the context, consider using 'existing', 'traditional', 'established', 'classic', 'earlier', or 'previous' rather than 'legacy'. Raw Output: {"message":"[RedHat.TermsSuggestions] Depending on the context, consider using 'existing', 'traditional', 'established', 'classic', 'earlier', or 'previous' rather than 'legacy'.","location":{"path":"source/linux/Foundational_Components/Graphics/SGX/Build_Guide.rst","range":{"start":{"line":144,"column":20},"end":{"line":144,"column":26}}},"severity":"INFO","code":{"value":"RedHat.TermsSuggestions","url":"https://redhat-documentation.github.io/vale-at-red-hat/reference-guide.html#terms-suggestions"}}
``kmsro`` binds displays to their associated drivers. We still need a small shim
to load our GLES implementation and configure the mesa dispatch table.

Historically there has been some issues with embedded GFX because, unlike your
standard PC GPU, we tend to mix and match actual Graphics Processing Units and
Display Controllers. The megadriver uses the display device name to coordinate
between API implementations. As such, we need a shim to act as a DRI driver and
coordinate the link with the SGX GLES implementation.

This shim, currently, is in the form of a Gallium Frontend. This is the main
This shim, currently, is in the form of a gallium driver. This is the main
reason for the fork and the 60 odd patches we carry at the following repository:

https://gitlab.freedesktop.org/StaticRocket/mesa
https://github.com/texasInstruments/mesa

There are also other nice-to-have features there such as additional pixel
formats, minor fix-ups, and a few performance tweaks IMG have picked up over the
years. The main reason we need it is for that shim.
formats, minor fix-ups, and a few performance tweaks Imagination has picked up
over the years. The main reason we need it is for that shim.

Building the SGX mesa components
================================

We recommend following the `Mesa build guide`_ for general options. Currently
the mesa components use a standard interface that allows use of any
``powervr/*`` branch equal to or greater than ``22.3.5``.

The only necessary build options are:
In earlier releases the SGX shim was a separate gallium frontend. Starting with
``f52f27edce0e (all: unify sgx and rogue dri layers, 2026-11-12)`` a unified PVR
driver replaces this. This means any older PVR specific mesa branches should
also work, though support is not guaranteed.

- ``-Dgallium-drivers=sgx`` -- This is a comma separated list, just make sure
sgx is present in it.

- ``-Dgallium-sgx-alias=`` -- This should match the display controller you
want to bind to. This can either be ``tilcdc``, ``tidss``, or ``omapdrm``
depending on the device.
We recommend following the `Mesa build guide`_ for general options. Currently
the mesa components use a standard interface that allows the use of any
``powervr/*`` branch. This guide expects a version equal to or greater than
``25.2.8``.

This will produce 3 important files relevant to the shim mechanism we discussed
earlier:
.. note::

- :file:`sgx_dri.so` -- Main DRI interface
Releases before 1.18 did not use this standard interface. Instead the UM
binaries include all relevant mesa components for those releases.

- :file:`pvr_dri.so` -- GPU interface that points back to :file:`sgx_dri.so`.
This is for an application that attempts to interact with the GPU directly
because the DRI device is still registered with the name ``pvr``.
The only necessary build options are:

- :file:`<display>_dri.so` -- Display controller interface that points back
at :file:`sgx_dri.so`. This is from the value specified with
``-Dgallium-sgx-alias``.
- ``-Dgallium-drivers=pvr`` -- This is a comma separated list, just make sure
pvr is present in it.

*******************
Using the SGX stack
*******************

Assuming you're using the SDK or you've built and installed the preceding
Assuming you're using the SDK or you've built and installed the earlier parts
correctly, you should see a message similar to the following in :command:`dmesg`
after the kernel module loads:

Expand All @@ -213,23 +200,29 @@
[ 29.277564] PVR_K: UM DDK-(4948957) and KM DDK-(4948957) match. [ OK ]

You should now be able to issue a simple test. We recommend
:command:`glmark2-es2-drm`. You should see the following indicating you are
:command:`kmscube`. You should see the following indicating you are
using the correct driver:

.. code-block:: console

root@am335x-evm:~# glmark2-es2-drm
MESA: info: Loaded libpvr_dri_support.so
=======================================================
glmark2 2021.12
=======================================================
OpenGL Information
GL_VENDOR: Imagination Technologies
GL_RENDERER: PowerVR SGX 530
GL_VERSION: OpenGL ES 2.0 build 1.17@4948957
=======================================================

The ``GL_VENDOR`` should report ``Imagination Technologies`` with the renderer
root@am335x-evm:~# kmscube
Using display 0x6564b0 with EGL version 1.4
===================================
EGL information:
version: "1.4"
vendor: "Mesa Project"
[snip]
===================================
OpenGL ES 2.x information:
version: "OpenGL ES 2.0 build 1.17@4948957"
shading language version: "OpenGL ES GLSL ES 1.00 build 1.17@4948957"
vendor: "Imagination Technologies"
renderer: "PowerVR SGX 530"
[snip]
===================================
Rendered 120 frames in 2.002120 sec (59.936461 fps)

The vendor should report ``Imagination Technologies`` with the renderer
corresponding to the graphics processor in that device.

.. _Mesa build guide: https://docs.mesa3d.org/install.html
Expand Down
Loading