git: fe705ac08744 - main - graphics/nvidia-drm-515-kmod: Fix build on CURRENT with iosys-map.h

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Fri, 29 Dec 2023 19:29:04 UTC
The branch main has been updated by manu:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fe705ac087444001315552af0c72cf39854eb1d5

commit fe705ac087444001315552af0c72cf39854eb1d5
Author:     Austin Shafer <ashafer@badland.io>
AuthorDate: 2023-12-29 19:28:07 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2023-12-29 19:28:07 +0000

    graphics/nvidia-drm-515-kmod: Fix build on CURRENT with iosys-map.h
    
    Commit f8ab2f5bae1d added the linux/iosys-map.h header to base in order
    to support 5.18+ versions of drm-kmod. This messes with nvidia-drm's
    conftest logic as on recent enough CURRENT versions it will see iosys-map
    and assume it can use it, but the drm-kmod version in use is 5.15,
    which wants to use the older dma_buf_map.
    
    This adds a patch on the port side to override nvidia-drm's detector
    and force the use of dma_buf_map on the 5.15 port.
    
    Differential Revision:  https://reviews.freebsd.org/D43234
---
 .../nvidia-drm-515-kmod/files/patch-nvidia-drm-gem.c   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/graphics/nvidia-drm-515-kmod/files/patch-nvidia-drm-gem.c b/graphics/nvidia-drm-515-kmod/files/patch-nvidia-drm-gem.c
new file mode 100644
index 000000000000..5693b76d27c4
--- /dev/null
+++ b/graphics/nvidia-drm-515-kmod/files/patch-nvidia-drm-gem.c
@@ -0,0 +1,18 @@
+--- nvidia-drm-gem.c.orig	2023-12-29 19:08:23 UTC
++++ nvidia-drm-gem.c
+@@ -68,15 +68,7 @@ void nv_drm_gem_free(struct drm_gem_object *gem)
+ #if !defined(NV_DRM_DRIVER_HAS_GEM_PRIME_CALLBACKS) && \
+     defined(NV_DRM_GEM_OBJECT_VMAP_HAS_MAP_ARG)
+ 
+-/*
+- * The 'dma_buf_map' structure is renamed to 'iosys_map' by the commit
+- * 7938f4218168 ("dma-buf-map: Rename to iosys-map").
+- */
+-#if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
+-typedef struct iosys_map nv_sysio_map_t;
+-#else
+ typedef struct dma_buf_map nv_sysio_map_t;
+-#endif
+ 
+ static int nv_drm_gem_vmap(struct drm_gem_object *gem,
+                            nv_sysio_map_t *map)