[PATCH v3 0/4] NVIDIA Tegra Video Decoder driver improvements

From: Dmitry Osipenko
Date: Sun Jun 23 2019 - 13:08:24 EST


Hello,

This series cleans up some of minor shortcomings that are caused by
checkpatch recommendations that are not very applicable for the driver.
Then IOMMU support is added to the driver and now it can handle sparse
memory buffers that GPU hands to VDE in a default kernel configuration
on Tegra30+.

Changelog:

v3: - Fixed memory leak on driver's module reload. For some reason I
erroneously assumed that IOVA reservations are released on IOVA
destruction themselves.

- Corrected PFN's for the last-page's IOVA reservation. We want to
reserve the last page, but a page before the last was reserved.

v2: - Fixed use-after-free bug and uninitialized-variable warning that
were reported by smatch and pointed out by Hans Verkuil in the
review comment to v1.

- Fixed build failure when CONFIG_ARM_DMA_USE_IOMMU=y and tested this
case properly (multi-platform kernel config).

- Made some extra minor changes, prettifying code a tad more.

Dmitry Osipenko (4):
staging: media: tegra-vde: Remove BIT() macro from UAPI header
staging: media: tegra-vde: Manually pack UAPI structures
staging: media: tegra-vde: Add IOMMU support
staging: media: tegra-vde: Defer dmabuf's unmapping

drivers/staging/media/tegra-vde/Kconfig | 1 +
drivers/staging/media/tegra-vde/Makefile | 1 +
.../staging/media/tegra-vde/dmabuf-cache.c | 226 ++++++++++++++++++
drivers/staging/media/tegra-vde/iommu.c | 157 ++++++++++++
drivers/staging/media/tegra-vde/trace.h | 2 +
drivers/staging/media/tegra-vde/uapi.h | 48 ++--
.../media/tegra-vde/{tegra-vde.c => vde.c} | 212 ++++++----------
drivers/staging/media/tegra-vde/vde.h | 107 +++++++++
8 files changed, 591 insertions(+), 163 deletions(-)
create mode 100644 drivers/staging/media/tegra-vde/dmabuf-cache.c
create mode 100644 drivers/staging/media/tegra-vde/iommu.c
rename drivers/staging/media/tegra-vde/{tegra-vde.c => vde.c} (88%)
create mode 100644 drivers/staging/media/tegra-vde/vde.h

--
2.22.0