From a6ff2bcf9ecbf77e209d89ee8766b526eaf84502 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Fri, 5 Nov 2021 11:04:46 +0000 Subject: [PATCH] drm/tegra: Fix build for Linux-v5.16-rc1 Building the Tegra DRM out-of-tree module against the current upstream mainline kernel is failing and errors such as the following are seen. ERROR: modpost: module tegra-drm-next uses symbol dma_buf_detach from namespace DMA_BUF, but does not import it. ERROR: modpost: module tegra-drm-next uses symbol dma_buf_vunmap from namespace DMA_BUF, but does not import it. ERROR: modpost: module tegra-drm-next uses symbol dma_buf_put from namespace DMA_BUF, but does not import it. Following upstream commit 16b0314aa746 ("dma-buf: move dma-buf symbols into the DMA_BUF module namespace"), it is now necessary to import the DMA_BUF module namespace into the Tegra DRM driver to fix this. Change-Id: I9dbd0e3c97b3ccf09982fdb72ef8a9a715d873de Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2621643 Tested-by: mobile promotions Reviewed-by: svc_kernel_abi Reviewed-by: Mikko Perttunen Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/drm/tegra/gem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 06da8273..1e9d5840 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -21,6 +22,10 @@ #include "drm.h" #include "gem.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 16, 0) +MODULE_IMPORT_NS(DMA_BUF); +#endif + static unsigned int __sgt_dma_count_chunks(struct sg_table *sgt) { dma_addr_t next = ~(dma_addr_t)0;