Mesa (master): tegra: Initial support

Thierry Reding tagr at kemper.freedesktop.org
Fri Mar 9 10:49:35 UTC 2018


Module: Mesa
Branch: master
Commit: 1755f608f5201e0a23f00cc3ea1b01edd07eb6ef
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1755f608f5201e0a23f00cc3ea1b01edd07eb6ef

Author: Thierry Reding <thierry.reding at gmail.com>
Date:   Wed May 28 00:36:48 2014 +0200

tegra: Initial support

Tegra K1 and later use a GPU that can be driven by the Nouveau driver.
But the GPU is a pure render node and has no display engine, hence the
scanout needs to happen on the Tegra display hardware. The GPU and the
display engine each have a separate DRM device node exposed by the
kernel.

To make the setup appear as a single device, this driver instantiates
a Nouveau screen with each instance of a Tegra screen and forwards GPU
requests to the Nouveau screen. For purposes of scanout it will import
buffers created on the GPU into the display driver. Handles that
userspace requests are those of the display driver so that they can be
used to create framebuffers.

This has been tested with some GBM test programs, as well as kmscube and
weston. All of those run without modifications, but I'm sure there is a
lot that can be improved.

Some fixes contributed by Hector Martin <marcan at marcan.st>.

Changes in v2:
- duplicate file descriptor in winsys to avoid potential issues
- require nouveau when building the tegra driver
- check for nouveau driver name on render node
- remove unneeded dependency on libdrm_tegra
- remove zombie references to libudev
- add missing headers to C_SOURCES variable
- drop unneeded tegra/ prefix for includes
- open device files with O_CLOEXEC
- update copyrights

Changes in v3:
- properly unwrap resources in ->resource_copy_region()
- support vertex buffers passed by user pointer
- allocate custom stream and const uploader
- silence error message on pre-Tegra124
- support X without explicit PRIME

Changes in v4:
- ship Meson build files in distribution tarball
- drop duplicate driver_tegra dependency

Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Acked-by: Emil Velikov <emil.velikov at collabora.com>
Tested-by: Andre Heider <a.heider at gmail.com>
Reviewed-by: Dmitry Osipenko <digetx at gmail.com>
Reviewed-by: Dylan Baker <dylan at pnwbakers.com>
Signed-off-by: Thierry Reding <treding at nvidia.com>

---

 configure.ac                                       |   12 +-
 include/drm-uapi/tegra_drm.h                       |  225 ++++
 meson.build                                        |    7 +-
 src/gallium/Makefile.am                            |    5 +
 .../auxiliary/pipe-loader/pipe_loader_drm.c        |    7 +-
 src/gallium/auxiliary/target-helpers/drm_helper.h  |   23 +
 .../auxiliary/target-helpers/drm_helper_public.h   |    3 +
 src/gallium/drivers/tegra/Automake.inc             |   11 +
 src/gallium/drivers/tegra/Makefile.am              |   14 +
 src/gallium/drivers/tegra/Makefile.sources         |    6 +
 src/gallium/drivers/tegra/meson.build              |   41 +
 src/gallium/drivers/tegra/tegra_context.c          | 1384 ++++++++++++++++++++
 src/gallium/drivers/tegra/tegra_context.h          |   81 ++
 src/gallium/drivers/tegra/tegra_resource.h         |   76 ++
 src/gallium/drivers/tegra/tegra_screen.c           |  688 ++++++++++
 src/gallium/drivers/tegra/tegra_screen.h           |   45 +
 src/gallium/meson.build                            |    6 +
 src/gallium/targets/dri/Makefile.am                |    2 +
 src/gallium/targets/dri/meson.build                |    4 +-
 src/gallium/targets/dri/target.c                   |    4 +
 src/gallium/targets/vdpau/Makefile.am              |    2 +
 src/gallium/winsys/tegra/drm/Makefile.am           |   13 +
 src/gallium/winsys/tegra/drm/Makefile.sources      |    2 +
 src/gallium/winsys/tegra/drm/meson.build           |   33 +
 src/gallium/winsys/tegra/drm/tegra_drm_public.h    |   31 +
 src/gallium/winsys/tegra/drm/tegra_drm_winsys.c    |   49 +
 26 files changed, 2770 insertions(+), 4 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=1755f608f5201e0a23f00cc3ea1b01edd07eb6ef



More information about the mesa-commit mailing list