Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tentative fix for NVIDIA 465.27 driver for Linux 5.13-rc1
From 6c1d401600b76dd7d9c24ca4c6aa8d6e6b54fb05 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
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