[PATCH v2 libdrm 0/7] Add NVIDIA Tegra support

Thierry Reding thierry.reding at gmail.com
Wed Apr 9 04:40:23 PDT 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.

The helpers introduced in patch 5 are used in patch 6 to fill a sub-
region of the screen with a solid color.

Finally patch 7 clears two IOCTL argument buffers when compiled with
valgrind support to eliminate some complaints raised by valgrind when
running the newly introduced Tegra tests.

Thierry

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

Thierry Reding (7):
  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
  libdrm: valgrind-clear a few more IOCTL arguments

 Makefile.am                  |   6 +-
 configure.ac                 |  36 +++++-
 include/drm/Makefile.am      |   1 +
 include/drm/tegra_drm.h      | 155 ++++++++++++++++++++++++++
 libdrm.h                     |  34 ++++++
 tegra/.gitignore             |   1 +
 tegra/Makefile.am            |  24 ++++
 tegra/channel.c              | 127 +++++++++++++++++++++
 tegra/fence.c                |  71 ++++++++++++
 tegra/job.c                  | 180 ++++++++++++++++++++++++++++++
 tegra/libdrm_tegra.pc.in     |  11 ++
 tegra/private.h              | 123 +++++++++++++++++++++
 tegra/pushbuf.c              | 205 ++++++++++++++++++++++++++++++++++
 tegra/tegra.c                | 255 +++++++++++++++++++++++++++++++++++++++++++
 tegra/tegra.h                |  99 +++++++++++++++++
 tests/Makefile.am            |   4 +
 tests/modetest/modetest.c    |   2 +-
 tests/tegra/.gitignore       |   2 +
 tests/tegra/Makefile.am      |  31 ++++++
 tests/tegra/drm-test-tegra.c | 137 +++++++++++++++++++++++
 tests/tegra/drm-test-tegra.h |  55 ++++++++++
 tests/tegra/drm-test.c       | 248 +++++++++++++++++++++++++++++++++++++++++
 tests/tegra/drm-test.h       |  72 ++++++++++++
 tests/tegra/gr2d-fill.c      | 146 +++++++++++++++++++++++++
 tests/tegra/openclose.c      |  63 +++++++++++
 tests/vbltest/vbltest.c      |   2 +-
 xf86drmMode.c                |   2 +
 27 files changed, 2088 insertions(+), 4 deletions(-)
 create mode 100644 include/drm/tegra_drm.h
 create mode 100644 libdrm.h
 create mode 100644 tegra/.gitignore
 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/.gitignore
 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.9.1



More information about the dri-devel mailing list