[RFC libdrm 0/6] Add NVIDIA Tegra support

Thierry Reding thierry.reding at gmail.com
Wed Feb 19 08:04:47 PST 2014


From: Thierry Reding <treding at nvidia.com>

Hi,

This series adds libdrm-tegra with a very lightweight API on top of the
kernel interfaces. Most of the functions provided here have been in use
in various driver efforts in different incarnations. This is an attempt
to consolidate, so I'm looking for review comments especially by Erik
to ensure it can be used by grate.

I've used these to implement basic EXA support in xf86-video-opentegra,
which I've pushed to a repository here[0]. The libdrm patches are also
available in a repository[1] for convenience.

Patch 1 adds support for symbol visibility if GCC supports it. This is
used by later patches to make only the public symbols visible in the
libdrm-tegra shared object.

Patch 2 adds support for managing a Tegra DRM object (which doesn't do
a whole lot more than wrap a file descriptor) and buffer objects.

A small test program is added in patch 3 to check that a Tegra DRM
object can be created on top of a DRM device.

Patch 4 adds functions to open a channel to an engine (gr2d or gr3d),
create and manage a job as well as compose command streams in a push
buffer and wait for a fence.

To make it easier to write further tests, patch 5 introduces some DRM
helpers to setup a screen and attach framebuffers to it. A very basic
interface is also provided for the gr2d unit, which can be used to do
a solid rectangle fill.

Finally patch 6 uses the helpers introduced in patch 5 to fill a sub-
region of the screen with a solid color.

Thierry

[0]: http://cgit.freedesktop.org/~tagr/xf86-video-opentegra/
[1]: http://cgit.freedesktop.org/~tagr/drm/

Thierry Reding (6):
  configure: Support symbol visibility when available
  libdrm: Add NVIDIA Tegra support
  tegra: Add simple test for drm_tegra_open()
  tegra: Add channel, job, pushbuf and fence APIs
  tegra: Add helper library for tests
  tegra: Add gr2d-fill test

 Makefile.am                  |   6 +-
 configure.ac                 |  36 +++++-
 include/drm/Makefile.am      |   1 +
 include/drm/tegra_drm.h      | 157 ++++++++++++++++++++++++++
 tegra/Makefile.am            |  24 ++++
 tegra/channel.c              | 127 +++++++++++++++++++++
 tegra/fence.c                |  72 ++++++++++++
 tegra/job.c                  | 167 +++++++++++++++++++++++++++
 tegra/libdrm_tegra.pc.in     |  11 ++
 tegra/private.h              | 117 +++++++++++++++++++
 tegra/pushbuf.c              | 137 +++++++++++++++++++++++
 tegra/tegra.c                | 253 +++++++++++++++++++++++++++++++++++++++++
 tegra/tegra.h                |  99 ++++++++++++++++
 tests/Makefile.am            |   4 +
 tests/modetest/modetest.c    |   2 +-
 tests/tegra/Makefile.am      |  29 +++++
 tests/tegra/drm-test-tegra.c | 132 ++++++++++++++++++++++
 tests/tegra/drm-test-tegra.h |  55 +++++++++
 tests/tegra/drm-test.c       | 261 +++++++++++++++++++++++++++++++++++++++++++
 tests/tegra/drm-test.h       |  73 ++++++++++++
 tests/tegra/gr2d-fill.c      | 145 ++++++++++++++++++++++++
 tests/tegra/openclose.c      |  63 +++++++++++
 tests/vbltest/vbltest.c      |   2 +-
 23 files changed, 1969 insertions(+), 4 deletions(-)
 create mode 100644 include/drm/tegra_drm.h
 create mode 100644 tegra/Makefile.am
 create mode 100644 tegra/channel.c
 create mode 100644 tegra/fence.c
 create mode 100644 tegra/job.c
 create mode 100644 tegra/libdrm_tegra.pc.in
 create mode 100644 tegra/private.h
 create mode 100644 tegra/pushbuf.c
 create mode 100644 tegra/tegra.c
 create mode 100644 tegra/tegra.h
 create mode 100644 tests/tegra/Makefile.am
 create mode 100644 tests/tegra/drm-test-tegra.c
 create mode 100644 tests/tegra/drm-test-tegra.h
 create mode 100644 tests/tegra/drm-test.c
 create mode 100644 tests/tegra/drm-test.h
 create mode 100644 tests/tegra/gr2d-fill.c
 create mode 100644 tests/tegra/openclose.c

-- 
1.8.4.2



More information about the dri-devel mailing list