Skip to content

Instantly share code, notes, and snippets.

@joanbm
Created June 6, 2022 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joanbm/d630a02dde00bf087f64091d331f6dbb to your computer and use it in GitHub Desktop.
Save joanbm/d630a02dde00bf087f64091d331f6dbb to your computer and use it in GitHub Desktop.
Tentative fix for NVIDIA 470.129.06 driver for Linux 5.19-rc1
From cc4acfadcd71ee07c8d1b29411620a79451780b9 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Wed, 13 Apr 2022 21:21:13 +0200
Subject: [PATCH] Buildfix NVIDIA 470.129.06 for Linux 5.19-rc1
---
nvidia-drm/nvidia-dma-resv-helper.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/nvidia-drm/nvidia-dma-resv-helper.h b/nvidia-drm/nvidia-dma-resv-helper.h
index ad8800d..65ea1f8 100644
--- a/nvidia-drm/nvidia-dma-resv-helper.h
+++ b/nvidia-drm/nvidia-dma-resv-helper.h
@@ -39,6 +39,15 @@
#include <linux/reservation.h>
#endif
+#include <linux/version.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
+// Rel. commit "dma-buf: specify usage while adding fences to dma_resv obj v7" (Christian König, 9 Nov 2021)
+static inline void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence)
+{
+ dma_resv_add_fence(obj, fence, DMA_RESV_USAGE_WRITE);
+}
+#endif
+
#include <nvidia-dma-fence-helper.h>
#if defined(NV_LINUX_DMA_RESV_H_PRESENT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment