k/kmod-nvidia: enable building 390.143 with kernel 5.13.
Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
This commit is contained in:
parent
1364413bef
commit
33986595fe
114
k/kmod-nvidia/patches/linux-5.13/kernel-5.13.patch
Normal file
114
k/kmod-nvidia/patches/linux-5.13/kernel-5.13.patch
Normal file
@ -0,0 +1,114 @@
|
||||
From 69cc75c9918dbb7d50670f1379021229fb159a34 Mon Sep 17 00:00:00 2001
|
||||
From: Alberto Milone <alberto.milone@canonical.com>
|
||||
Date: Wed, 26 May 2021 12:47:54 +0200
|
||||
Subject: [PATCH 1/1] Add support for Linux 5.13
|
||||
|
||||
---
|
||||
conftest.sh | 32 ++++++++++++++++++++++++++++++++
|
||||
nvidia-drm/nvidia-drm-crtc.c | 16 ++++++++++++++++
|
||||
nvidia-drm/nvidia-drm.Kbuild | 1 +
|
||||
3 files changed, 49 insertions(+)
|
||||
|
||||
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
|
||||
index 4b6a9ed..25a8afa 100755
|
||||
--- a/kernel/conftest.sh
|
||||
+++ b/kernel/conftest.sh
|
||||
@@ -4426,6 +4426,38 @@ compile_test() {
|
||||
fi
|
||||
;;
|
||||
|
||||
+ drm_plane_atomic_update_has_atomic_state_arg)
|
||||
+ #
|
||||
+ # Determine if drm_plane_helper_funcs::atomic_update takes 'state'
|
||||
+ # argument of 'struct drm_atomic_state' type.
|
||||
+ #
|
||||
+ # The commit 977697e20b3d ("drm/atomic: Pass the full state to
|
||||
+ # planes atomic disable and update") passed the full atomic state to
|
||||
+ # drm_crtc_helper_funcs::atomic_update() and atomic_disable().
|
||||
+ #
|
||||
+ echo "$CONFTEST_PREAMBLE
|
||||
+ #include <drm/drm_modeset_helper_vtables.h>
|
||||
+ #include <drm/drm_crtc_helper.h>
|
||||
+ #include <drm/drm_plane_helper.h>
|
||||
+ #include <drm/drm_atomic.h>
|
||||
+ #include <drm/drm_atomic_helper.h>
|
||||
+ void conftest_drm_plane_helper_atomic_update_has_atomic_state_arg(
|
||||
+ struct drm_plane *plane, struct drm_atomic_state *state) {
|
||||
+ const struct drm_plane_helper_funcs *funcs = plane->helper_private;
|
||||
+ funcs->atomic_update(plane, state);
|
||||
+ }" > conftest$$.c
|
||||
+
|
||||
+ $CC $CFLAGS -Werror=incompatible-pointer-types -c conftest$$.c > /dev/null 2>&1
|
||||
+ rm -f conftest$$.c
|
||||
+
|
||||
+ if [ -f conftest$$.o ]; then
|
||||
+ rm -f conftest$$.o
|
||||
+ echo "#define NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG" | append_conftest "types"
|
||||
+ else
|
||||
+ echo "#undef NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG" | append_conftest "types"
|
||||
+ fi
|
||||
+ ;;
|
||||
+
|
||||
drm_gem_object_vmap_has_map_arg)
|
||||
#
|
||||
# Determine if drm_gem_object_funcs::vmap takes 'map'
|
||||
diff --git a/kernel/nvidia-drm/nvidia-drm-crtc.c b/kernel/nvidia-drm/nvidia-drm-crtc.c
|
||||
index 8abd1f3..d5e5cfd 100644
|
||||
--- a/kernel/nvidia-drm/nvidia-drm-crtc.c
|
||||
+++ b/kernel/nvidia-drm/nvidia-drm-crtc.c
|
||||
@@ -131,13 +131,21 @@ plane_req_config_update(struct drm_plane_state *plane_state,
|
||||
}
|
||||
|
||||
static int nv_drm_plane_atomic_check(struct drm_plane *plane,
|
||||
+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
|
||||
+ struct drm_atomic_state *state)
|
||||
+#else
|
||||
struct drm_plane_state *plane_state)
|
||||
+#endif
|
||||
{
|
||||
int i;
|
||||
struct drm_crtc *crtc;
|
||||
struct drm_crtc_state *crtc_state;
|
||||
NvKmsKapiPlaneType type;
|
||||
|
||||
+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
|
||||
+ struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state,
|
||||
+ plane);
|
||||
+#endif
|
||||
if (NV_DRM_WARN(!drm_plane_type_to_nvkms_plane_type(plane->type, &type))) {
|
||||
goto done;
|
||||
}
|
||||
@@ -166,12 +174,20 @@ done:
|
||||
}
|
||||
|
||||
static void nv_drm_plane_atomic_update(struct drm_plane *plane,
|
||||
+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
|
||||
+ struct drm_atomic_state *old_state)
|
||||
+#else
|
||||
struct drm_plane_state *old_state)
|
||||
+#endif
|
||||
{
|
||||
}
|
||||
|
||||
static void nv_drm_plane_atomic_disable(struct drm_plane *plane,
|
||||
+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
|
||||
+ struct drm_atomic_state *old_state)
|
||||
+#else
|
||||
struct drm_plane_state *old_state)
|
||||
+#endif
|
||||
{
|
||||
}
|
||||
|
||||
diff --git a/kernel/nvidia-drm/nvidia-drm.Kbuild b/kernel/nvidia-drm/nvidia-drm.Kbuild
|
||||
index 885ab49..2cb0f9f 100644
|
||||
--- a/kernel/nvidia-drm/nvidia-drm.Kbuild
|
||||
+++ b/kernel/nvidia-drm/nvidia-drm.Kbuild
|
||||
@@ -100,4 +100,5 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_gem_free_object
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_prime_pages_to_sg_has_drm_device_arg
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_gem_prime_callbacks
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_crtc_atomic_check_has_atomic_state_arg
|
||||
+NV_CONFTEST_TYPE_COMPILE_TESTS += drm_plane_atomic_update_has_atomic_state_arg
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_gem_object_vmap_has_map_arg
|
||||
--
|
||||
2.30.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user