Skip to content

Instantly share code, notes, and snippets.

@baudneo
Forked from joanbm/nvidia-fix-linux-5.13.patch
Created November 21, 2021 07:42
Show Gist options
  • Save baudneo/a0241a7061988f2df1488246e79feb72 to your computer and use it in GitHub Desktop.
Save baudneo/a0241a7061988f2df1488246e79feb72 to your computer and use it in GitHub Desktop.
Tentative fix for NVIDIA 465.27 driver for Linux 5.13-rc1
From 6c1d401600b76dd7d9c24ca4c6aa8d6e6b54fb05 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <[email protected]>
Date: Fri, 16 Apr 2021 09:29:24 +0200
Subject: [PATCH] Tentative fix for NVIDIA 465.27 driver for Linux 5.13-rc1
---
nvidia-drm/nvidia-drm-crtc.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/nvidia-drm/nvidia-drm-crtc.c b/nvidia-drm/nvidia-drm-crtc.c
index 14fab04..405843c 100644
--- a/nvidia-drm/nvidia-drm-crtc.c
+++ b/nvidia-drm/nvidia-drm-crtc.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/version.h>
#include "nvidia-drm-conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -288,9 +289,19 @@ static bool __is_async_flip_requested(const struct drm_plane *plane,
return false;
}
+// Rel commit "drm/atomic: Pass the full state to planes atomic_check" (Maxime Ripard, Feb 19 2021)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0))
static int nv_drm_plane_atomic_check(struct drm_plane *plane,
struct drm_plane_state *plane_state)
+#else
+static int nv_drm_plane_atomic_check(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+#endif
{
+// Rel commit "drm/atomic: Pass the full state to planes atomic_check" (Maxime Ripard, Feb 19 2021)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 13, 0))
+ struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
+#endif
int i;
struct drm_crtc *crtc;
struct drm_crtc_state *crtc_state;
@@ -341,13 +352,25 @@ done:
return 0;
}
+// Rel commit "drm/atomic: Pass the full state to planes atomic disable and update" (Maxime Ripard, Feb 19 2021)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0))
static void nv_drm_plane_atomic_update(struct drm_plane *plane,
struct drm_plane_state *old_state)
+#else
+static void nv_drm_plane_atomic_update(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+#endif
{
}
+// Rel commit "drm/atomic: Pass the full state to planes atomic disable and update" (Maxime Ripard, Feb 19 2021)
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 13, 0))
static void nv_drm_plane_atomic_disable(struct drm_plane *plane,
struct drm_plane_state *old_state)
+#else
+static void nv_drm_plane_atomic_disable(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+#endif
{
}
--
2.31.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment