aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/nvidia-legacy390-kernel/kernel-5.13.patch103
-rw-r--r--system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild1
2 files changed, 104 insertions, 0 deletions
diff --git a/system/nvidia-legacy390-kernel/kernel-5.13.patch b/system/nvidia-legacy390-kernel/kernel-5.13.patch
new file mode 100644
index 0000000000000..36c0c6874c304
--- /dev/null
+++ b/system/nvidia-legacy390-kernel/kernel-5.13.patch
@@ -0,0 +1,103 @@
+diff --git a/kernel/conftest.sh b/kernel/conftest.sh
+index 4b6a9ed..25a8afa 100755
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -4408,6 +4408,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
+
diff --git a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
index d48a70658753e..355253cb672b1 100644
--- a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
+++ b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
@@ -79,6 +79,7 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
patch -p1 < $CWD/kernel-5.12.patch
+patch -p1 < $CWD/kernel-5.13.patch
(cd kernel || exit 1
make SYSSRC=$KERNELPATH module || exit 1