]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.7-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Jan 2024 22:55:27 +0000 (14:55 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 27 Jan 2024 22:55:27 +0000 (14:55 -0800)
added patches:
drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch
drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch
drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch
drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch
drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch
drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch
drm-fix-todo-list-mentioning-non-kms-drivers.patch
drm-i915-psr-only-allow-psr-in-lpsp-mode-on-hsw-non-ult.patch
drm-tidss-fix-atomic_flush-check.patch
drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch

queue-6.7/drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch [new file with mode: 0644]
queue-6.7/drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch [new file with mode: 0644]
queue-6.7/drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch [new file with mode: 0644]
queue-6.7/drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch [new file with mode: 0644]
queue-6.7/drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch [new file with mode: 0644]
queue-6.7/drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch [new file with mode: 0644]
queue-6.7/drm-fix-todo-list-mentioning-non-kms-drivers.patch [new file with mode: 0644]
queue-6.7/drm-i915-psr-only-allow-psr-in-lpsp-mode-on-hsw-non-ult.patch [new file with mode: 0644]
queue-6.7/drm-tidss-fix-atomic_flush-check.patch [new file with mode: 0644]
queue-6.7/drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch [new file with mode: 0644]
queue-6.7/series

diff --git a/queue-6.7/drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch b/queue-6.7/drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch
new file mode 100644 (file)
index 0000000..d52f665
--- /dev/null
@@ -0,0 +1,80 @@
+From 35ed38d58257336c1df26b14fd5110b026e2adde Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <javierm@redhat.com>
+Date: Thu, 23 Nov 2023 23:13:00 +0100
+Subject: drm: Allow drivers to indicate the damage helpers to ignore damage clips
+
+From: Javier Martinez Canillas <javierm@redhat.com>
+
+commit 35ed38d58257336c1df26b14fd5110b026e2adde upstream.
+
+It allows drivers to set a struct drm_plane_state .ignore_damage_clips in
+their plane's .atomic_check callback, as an indication to damage helpers
+such as drm_atomic_helper_damage_iter_init() that the damage clips should
+be ignored.
+
+To be used by drivers that do per-buffer (e.g: virtio-gpu) uploads (rather
+than per-plane uploads), since these type of drivers need to handle buffer
+damages instead of frame damages.
+
+That way, these drivers could force a full plane update if the framebuffer
+attached to a plane's state has changed since the last update (page-flip).
+
+Fixes: 01f05940a9a7 ("drm/virtio: Enable fb damage clips property for the primary plane")
+Cc: <stable@vger.kernel.org> # v6.4+
+Reported-by: nerdopolis <bluescreen_avenger@verizon.net>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115
+Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
+Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
+Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
+Reviewed-by: Zack Rusin <zackr@vmware.com>
+Acked-by: Sima Vetter <daniel.vetter@ffwll.ch>
+Link: https://patchwork.freedesktop.org/patch/msgid/20231123221315.3579454-2-javierm@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/gpu/drm-kms.rst       |    2 ++
+ drivers/gpu/drm/drm_damage_helper.c |    3 ++-
+ include/drm/drm_plane.h             |   10 ++++++++++
+ 3 files changed, 14 insertions(+), 1 deletion(-)
+
+--- a/Documentation/gpu/drm-kms.rst
++++ b/Documentation/gpu/drm-kms.rst
+@@ -548,6 +548,8 @@ Plane Composition Properties
+ .. kernel-doc:: drivers/gpu/drm/drm_blend.c
+    :doc: overview
++.. _damage_tracking_properties:
++
+ Damage Tracking Properties
+ --------------------------
+--- a/drivers/gpu/drm/drm_damage_helper.c
++++ b/drivers/gpu/drm/drm_damage_helper.c
+@@ -241,7 +241,8 @@ drm_atomic_helper_damage_iter_init(struc
+       iter->plane_src.x2 = (src.x2 >> 16) + !!(src.x2 & 0xFFFF);
+       iter->plane_src.y2 = (src.y2 >> 16) + !!(src.y2 & 0xFFFF);
+-      if (!iter->clips || !drm_rect_equals(&state->src, &old_state->src)) {
++      if (!iter->clips || state->ignore_damage_clips ||
++          !drm_rect_equals(&state->src, &old_state->src)) {
+               iter->clips = NULL;
+               iter->num_clips = 0;
+               iter->full_update = true;
+--- a/include/drm/drm_plane.h
++++ b/include/drm/drm_plane.h
+@@ -191,6 +191,16 @@ struct drm_plane_state {
+       struct drm_property_blob *fb_damage_clips;
+       /**
++       * @ignore_damage_clips:
++       *
++       * Set by drivers to indicate the drm_atomic_helper_damage_iter_init()
++       * helper that the @fb_damage_clips blob property should be ignored.
++       *
++       * See :ref:`damage_tracking_properties` for more information.
++       */
++      bool ignore_damage_clips;
++
++      /**
+        * @src:
+        *
+        * source coordinates of the plane (in 16.16).
diff --git a/queue-6.7/drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch b/queue-6.7/drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch
new file mode 100644 (file)
index 0000000..a822cfe
--- /dev/null
@@ -0,0 +1,48 @@
+From 571c2fa26aa654946447c282a09d40a56c7ff128 Mon Sep 17 00:00:00 2001
+From: Mario Limonciello <mario.limonciello@amd.com>
+Date: Mon, 19 Jun 2023 15:04:24 -0500
+Subject: drm/amd/display: Disable PSR-SU on Parade 0803 TCON again
+
+From: Mario Limonciello <mario.limonciello@amd.com>
+
+commit 571c2fa26aa654946447c282a09d40a56c7ff128 upstream.
+
+When screen brightness is rapidly changed and PSR-SU is enabled the
+display hangs on panels with this TCON even on the latest DCN 3.1.4
+microcode (0x8002a81 at this time).
+
+This was disabled previously as commit 072030b17830 ("drm/amd: Disable
+PSR-SU on Parade 0803 TCON") but reverted as commit 1e66a17ce546 ("Revert
+"drm/amd: Disable PSR-SU on Parade 0803 TCON"") in favor of testing for
+a new enough microcode (commit cd2e31a9ab93 ("drm/amd/display: Set minimum
+requirement for using PSR-SU on Phoenix")).
+
+As hangs are still happening specifically with this TCON, disable PSR-SU
+again for it until it can be root caused.
+
+Cc: stable@vger.kernel.org
+Cc: aaron.ma@canonical.com
+Cc: binli@gnome.org
+Cc: Marc Rossi <Marc.Rossi@amd.com>
+Cc: Hamza Mahfooz <Hamza.Mahfooz@amd.com>
+Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
+Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2046131
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Harry Wentland <harry.wentland@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/modules/power/power_helpers.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
++++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+@@ -841,6 +841,8 @@ bool is_psr_su_specific_panel(struct dc_
+                               isPSRSUSupported = false;
+                       else if (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x03)
+                               isPSRSUSupported = false;
++                      else if (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x03)
++                              isPSRSUSupported = false;
+                       else if (dpcd_caps->psr_info.force_psrsu_cap == 0x1)
+                               isPSRSUSupported = true;
+               }
diff --git a/queue-6.7/drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch b/queue-6.7/drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch
new file mode 100644 (file)
index 0000000..f64f3a3
--- /dev/null
@@ -0,0 +1,38 @@
+From 3a0fa3bc245ef92838a8296e0055569b8dff94c4 Mon Sep 17 00:00:00 2001
+From: Melissa Wen <mwen@igalia.com>
+Date: Fri, 29 Dec 2023 15:25:00 -0100
+Subject: drm/amd/display: fix bandwidth validation failure on DCN 2.1
+
+From: Melissa Wen <mwen@igalia.com>
+
+commit 3a0fa3bc245ef92838a8296e0055569b8dff94c4 upstream.
+
+IGT `amdgpu/amd_color/crtc-lut-accuracy` fails right at the beginning of
+the test execution, during atomic check, because DC rejects the
+bandwidth state for a fb sizing 64x64. The test was previously working
+with the deprecated dc_commit_state(). Now using
+dc_validate_with_context() approach, the atomic check needs to perform a
+full state validation. Therefore, set fast_validation to false in the
+dc_validate_global_state call for atomic check.
+
+Cc: stable@vger.kernel.org
+Fixes: b8272241ff9d ("drm/amd/display: Drop dc_commit_state in favor of dc_commit_streams")
+Signed-off-by: Melissa Wen <mwen@igalia.com>
+Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+@@ -10479,7 +10479,7 @@ static int amdgpu_dm_atomic_check(struct
+                       DRM_DEBUG_DRIVER("drm_dp_mst_atomic_check() failed\n");
+                       goto fail;
+               }
+-              status = dc_validate_global_state(dc, dm_state->context, true);
++              status = dc_validate_global_state(dc, dm_state->context, false);
+               if (status != DC_OK) {
+                       DRM_DEBUG_DRIVER("DC global validation failure: %s (%d)",
+                                      dc_status_to_str(status), status);
diff --git a/queue-6.7/drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch b/queue-6.7/drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch
new file mode 100644 (file)
index 0000000..b88674c
--- /dev/null
@@ -0,0 +1,58 @@
+From 914437992876838662c968cb416f832110fb1093 Mon Sep 17 00:00:00 2001
+From: Dan Carpenter <dan.carpenter@linaro.org>
+Date: Mon, 4 Dec 2023 15:29:00 +0300
+Subject: drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
+
+From: Dan Carpenter <dan.carpenter@linaro.org>
+
+commit 914437992876838662c968cb416f832110fb1093 upstream.
+
+The i2c_master_send/recv() functions return negative error codes or the
+number of bytes that were able to be sent/received.  This code has
+two problems.  1)  Instead of checking if all the bytes were sent or
+received, it checks that at least one byte was sent or received.
+2) If there was a partial send/receive then we should return a negative
+error code but this code returns success.
+
+Fixes: a9fe713d7d45 ("drm/bridge: Add PTN3460 bridge driver")
+Cc: stable@vger.kernel.org
+Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
+Reviewed-by: Robert Foss <rfoss@kernel.org>
+Signed-off-by: Robert Foss <rfoss@kernel.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/0cdc2dce-ca89-451a-9774-1482ab2f4762@moroto.mountain
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/bridge/nxp-ptn3460.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/gpu/drm/bridge/nxp-ptn3460.c
++++ b/drivers/gpu/drm/bridge/nxp-ptn3460.c
+@@ -56,13 +56,13 @@ static int ptn3460_read_bytes(struct ptn
+       ret = i2c_master_send(ptn_bridge->client, &addr, 1);
+       if (ret <= 0) {
+               DRM_ERROR("Failed to send i2c command, ret=%d\n", ret);
+-              return ret;
++              return ret ?: -EIO;
+       }
+       ret = i2c_master_recv(ptn_bridge->client, buf, len);
+-      if (ret <= 0) {
++      if (ret != len) {
+               DRM_ERROR("Failed to recv i2c data, ret=%d\n", ret);
+-              return ret;
++              return ret < 0 ? ret : -EIO;
+       }
+       return 0;
+@@ -78,9 +78,9 @@ static int ptn3460_write_byte(struct ptn
+       buf[1] = val;
+       ret = i2c_master_send(ptn_bridge->client, buf, ARRAY_SIZE(buf));
+-      if (ret <= 0) {
++      if (ret != ARRAY_SIZE(buf)) {
+               DRM_ERROR("Failed to send i2c command, ret=%d\n", ret);
+-              return ret;
++              return ret < 0 ? ret : -EIO;
+       }
+       return 0;
diff --git a/queue-6.7/drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch b/queue-6.7/drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch
new file mode 100644 (file)
index 0000000..1461503
--- /dev/null
@@ -0,0 +1,163 @@
+From 4e3b70da64a53784683cfcbac2deda5d6e540407 Mon Sep 17 00:00:00 2001
+From: Zack Rusin <zackr@vmware.com>
+Date: Mon, 23 Oct 2023 09:46:05 +0200
+Subject: drm: Disable the cursor plane on atomic contexts with virtualized drivers
+
+From: Zack Rusin <zackr@vmware.com>
+
+commit 4e3b70da64a53784683cfcbac2deda5d6e540407 upstream.
+
+Cursor planes on virtualized drivers have special meaning and require
+that the clients handle them in specific ways, e.g. the cursor plane
+should react to the mouse movement the way a mouse cursor would be
+expected to and the client is required to set hotspot properties on it
+in order for the mouse events to be routed correctly.
+
+This breaks the contract as specified by the "universal planes". Fix it
+by disabling the cursor planes on virtualized drivers while adding
+a foundation on top of which it's possible to special case mouse cursor
+planes for clients that want it.
+
+Disabling the cursor planes makes some kms compositors which were broken,
+e.g. Weston, fallback to software cursor which works fine or at least
+better than currently while having no effect on others, e.g. gnome-shell
+or kwin, which put virtualized drivers on a deny-list when running in
+atomic context to make them fallback to legacy kms and avoid this issue.
+
+Signed-off-by: Zack Rusin <zackr@vmware.com>
+Fixes: 681e7ec73044 ("drm: Allow userspace to ask for universal plane list (v2)")
+Cc: <stable@vger.kernel.org> # v5.4+
+Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Cc: Maxime Ripard <mripard@kernel.org>
+Cc: Thomas Zimmermann <tzimmermann@suse.de>
+Cc: David Airlie <airlied@linux.ie>
+Cc: Daniel Vetter <daniel@ffwll.ch>
+Cc: Dave Airlie <airlied@redhat.com>
+Cc: Gerd Hoffmann <kraxel@redhat.com>
+Cc: Hans de Goede <hdegoede@redhat.com>
+Cc: Gurchetan Singh <gurchetansingh@chromium.org>
+Cc: Chia-I Wu <olvaffe@gmail.com>
+Cc: dri-devel@lists.freedesktop.org
+Cc: virtualization@lists.linux-foundation.org
+Cc: spice-devel@lists.freedesktop.org
+Acked-by: Pekka Paalanen <pekka.paalanen@collabora.com>
+Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
+Acked-by: Simon Ser <contact@emersion.fr>
+Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20231023074613.41327-2-aesteve@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/drm_plane.c          |   13 +++++++++++++
+ drivers/gpu/drm/qxl/qxl_drv.c        |    2 +-
+ drivers/gpu/drm/vboxvideo/vbox_drv.c |    2 +-
+ drivers/gpu/drm/virtio/virtgpu_drv.c |    2 +-
+ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c  |    2 +-
+ include/drm/drm_drv.h                |    9 +++++++++
+ include/drm/drm_file.h               |   12 ++++++++++++
+ 7 files changed, 38 insertions(+), 4 deletions(-)
+
+--- a/drivers/gpu/drm/drm_plane.c
++++ b/drivers/gpu/drm/drm_plane.c
+@@ -678,6 +678,19 @@ int drm_mode_getplane_res(struct drm_dev
+                   !file_priv->universal_planes)
+                       continue;
++              /*
++               * If we're running on a virtualized driver then,
++               * unless userspace advertizes support for the
++               * virtualized cursor plane, disable cursor planes
++               * because they'll be broken due to missing cursor
++               * hotspot info.
++               */
++              if (plane->type == DRM_PLANE_TYPE_CURSOR &&
++                  drm_core_check_feature(dev, DRIVER_CURSOR_HOTSPOT) &&
++                  file_priv->atomic &&
++                  !file_priv->supports_virtualized_cursor_plane)
++                      continue;
++
+               if (drm_lease_held(file_priv, plane->base.id)) {
+                       if (count < plane_resp->count_planes &&
+                           put_user(plane->base.id, plane_ptr + count))
+--- a/drivers/gpu/drm/qxl/qxl_drv.c
++++ b/drivers/gpu/drm/qxl/qxl_drv.c
+@@ -285,7 +285,7 @@ static const struct drm_ioctl_desc qxl_i
+ };
+ static struct drm_driver qxl_driver = {
+-      .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
++      .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_CURSOR_HOTSPOT,
+       .dumb_create = qxl_mode_dumb_create,
+       .dumb_map_offset = drm_gem_ttm_dumb_map_offset,
+--- a/drivers/gpu/drm/vboxvideo/vbox_drv.c
++++ b/drivers/gpu/drm/vboxvideo/vbox_drv.c
+@@ -182,7 +182,7 @@ DEFINE_DRM_GEM_FOPS(vbox_fops);
+ static const struct drm_driver driver = {
+       .driver_features =
+-          DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
++          DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC | DRIVER_CURSOR_HOTSPOT,
+       .fops = &vbox_fops,
+       .name = DRIVER_NAME,
+--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
++++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
+@@ -177,7 +177,7 @@ static const struct drm_driver driver =
+        * out via drm_device::driver_features:
+        */
+       .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_RENDER | DRIVER_ATOMIC |
+-                         DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE,
++                         DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE | DRIVER_CURSOR_HOTSPOT,
+       .open = virtio_gpu_driver_open,
+       .postclose = virtio_gpu_driver_postclose,
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+@@ -1611,7 +1611,7 @@ static const struct file_operations vmwg
+ static const struct drm_driver driver = {
+       .driver_features =
+-      DRIVER_MODESET | DRIVER_RENDER | DRIVER_ATOMIC | DRIVER_GEM,
++      DRIVER_MODESET | DRIVER_RENDER | DRIVER_ATOMIC | DRIVER_GEM | DRIVER_CURSOR_HOTSPOT,
+       .ioctls = vmw_ioctls,
+       .num_ioctls = ARRAY_SIZE(vmw_ioctls),
+       .master_set = vmw_master_set,
+--- a/include/drm/drm_drv.h
++++ b/include/drm/drm_drv.h
+@@ -110,6 +110,15 @@ enum drm_driver_feature {
+        * Driver supports user defined GPU VA bindings for GEM objects.
+        */
+       DRIVER_GEM_GPUVA                = BIT(8),
++      /**
++       * @DRIVER_CURSOR_HOTSPOT:
++       *
++       * Driver supports and requires cursor hotspot information in the
++       * cursor plane (e.g. cursor plane has to actually track the mouse
++       * cursor and the clients are required to set hotspot in order for
++       * the cursor planes to work correctly).
++       */
++      DRIVER_CURSOR_HOTSPOT           = BIT(9),
+       /* IMPORTANT: Below are all the legacy flags, add new ones above. */
+--- a/include/drm/drm_file.h
++++ b/include/drm/drm_file.h
+@@ -227,6 +227,18 @@ struct drm_file {
+       bool is_master;
+       /**
++       * @supports_virtualized_cursor_plane:
++       *
++       * This client is capable of handling the cursor plane with the
++       * restrictions imposed on it by the virtualized drivers.
++       *
++       * This implies that the cursor plane has to behave like a cursor
++       * i.e. track cursor movement. It also requires setting of the
++       * hotspot properties by the client on the cursor plane.
++       */
++      bool supports_virtualized_cursor_plane;
++
++      /**
+        * @master:
+        *
+        * Master this node is currently associated with. Protected by struct
diff --git a/queue-6.7/drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch b/queue-6.7/drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch
new file mode 100644 (file)
index 0000000..abb7075
--- /dev/null
@@ -0,0 +1,48 @@
+From cb4daf271302d71a6b9a7c01bd0b6d76febd8f0c Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
+Date: Mon, 11 Dec 2023 10:16:24 +0200
+Subject: drm: Don't unref the same fb many times by mistake due to deadlock handling
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ville Syrjälä <ville.syrjala@linux.intel.com>
+
+commit cb4daf271302d71a6b9a7c01bd0b6d76febd8f0c upstream.
+
+If we get a deadlock after the fb lookup in drm_mode_page_flip_ioctl()
+we proceed to unref the fb and then retry the whole thing from the top.
+But we forget to reset the fb pointer back to NULL, and so if we then
+get another error during the retry, before the fb lookup, we proceed
+the unref the same fb again without having gotten another reference.
+The end result is that the fb will (eventually) end up being freed
+while it's still in use.
+
+Reset fb to NULL once we've unreffed it to avoid doing it again
+until we've done another fb lookup.
+
+This turned out to be pretty easy to hit on a DG2 when doing async
+flips (and CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y). The first symptom I
+saw that drm_closefb() simply got stuck in a busy loop while walking
+the framebuffer list. Fortunately I was able to convince it to oops
+instead, and from there it was easier to track down the culprit.
+
+Cc: stable@vger.kernel.org
+Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20231211081625.25704-1-ville.syrjala@linux.intel.com
+Acked-by: Javier Martinez Canillas <javierm@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/drm_plane.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/gpu/drm/drm_plane.c
++++ b/drivers/gpu/drm/drm_plane.c
+@@ -1387,6 +1387,7 @@ retry:
+ out:
+       if (fb)
+               drm_framebuffer_put(fb);
++      fb = NULL;
+       if (plane->old_fb)
+               drm_framebuffer_put(plane->old_fb);
+       plane->old_fb = NULL;
diff --git a/queue-6.7/drm-fix-todo-list-mentioning-non-kms-drivers.patch b/queue-6.7/drm-fix-todo-list-mentioning-non-kms-drivers.patch
new file mode 100644 (file)
index 0000000..3445fea
--- /dev/null
@@ -0,0 +1,58 @@
+From 9cf5ca1f485cae406968947a92bf304603999fa1 Mon Sep 17 00:00:00 2001
+From: Thomas Zimmermann <tzimmermann@suse.de>
+Date: Wed, 22 Nov 2023 13:09:31 +0100
+Subject: drm: Fix TODO list mentioning non-KMS drivers
+
+From: Thomas Zimmermann <tzimmermann@suse.de>
+
+commit 9cf5ca1f485cae406968947a92bf304603999fa1 upstream.
+
+Non-KMS drivers have been removed from DRM. Update the TODO list
+accordingly.
+
+Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
+Fixes: a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)")
+Cc: Cai Huoqing <cai.huoqing@linux.dev>
+Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
+Cc: Dave Airlie <airlied@redhat.com>
+Cc: Thomas Zimmermann <tzimmermann@suse.de>
+Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Cc: Maxime Ripard <mripard@kernel.org>
+Cc: David Airlie <airlied@gmail.com>
+Cc: Daniel Vetter <daniel@ffwll.ch>
+Cc: Jonathan Corbet <corbet@lwn.net>
+Cc: dri-devel@lists.freedesktop.org
+Cc: <stable@vger.kernel.org> # v6.3+
+Cc: linux-doc@vger.kernel.org
+Reviewed-by: David Airlie <airlied@gmail.com>
+Reviewed-by: Daniel Vetter <daniel@ffwll.ch>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20231122122449.11588-3-tzimmermann@suse.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/gpu/todo.rst |    7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+--- a/Documentation/gpu/todo.rst
++++ b/Documentation/gpu/todo.rst
+@@ -337,8 +337,8 @@ connector register/unregister fixes
+ Level: Intermediate
+-Remove load/unload callbacks from all non-DRIVER_LEGACY drivers
+----------------------------------------------------------------
++Remove load/unload callbacks
++----------------------------
+ The load/unload callbacks in struct &drm_driver are very much midlayers, plus
+ for historical reasons they get the ordering wrong (and we can't fix that)
+@@ -347,8 +347,7 @@ between setting up the &drm_driver struc
+ - Rework drivers to no longer use the load/unload callbacks, directly coding the
+   load/unload sequence into the driver's probe function.
+-- Once all non-DRIVER_LEGACY drivers are converted, disallow the load/unload
+-  callbacks for all modern drivers.
++- Once all drivers are converted, remove the load/unload callbacks.
+ Contact: Daniel Vetter
diff --git a/queue-6.7/drm-i915-psr-only-allow-psr-in-lpsp-mode-on-hsw-non-ult.patch b/queue-6.7/drm-i915-psr-only-allow-psr-in-lpsp-mode-on-hsw-non-ult.patch
new file mode 100644 (file)
index 0000000..d0f4d50
--- /dev/null
@@ -0,0 +1,68 @@
+From f9f031dd21a7ce13a13862fa5281d32e1029c70f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
+Date: Thu, 18 Jan 2024 23:21:31 +0200
+Subject: drm/i915/psr: Only allow PSR in LPSP mode on HSW non-ULT
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ville Syrjälä <ville.syrjala@linux.intel.com>
+
+commit f9f031dd21a7ce13a13862fa5281d32e1029c70f upstream.
+
+On HSW non-ULT (or at least on Dell Latitude E6540) external displays
+start to flicker when we enable PSR on the eDP. We observe a much higher
+SR and PC6 residency than should be possible with an external display,
+and indeen much higher than what we observe with eDP disabled and
+only the external display enabled. Looks like the hardware is somehow
+ignoring the fact that the external display is active during PSR.
+
+I wasn't able to redproduce this on my HSW ULT machine, or BDW.
+So either there's something specific about this particular laptop
+(eg. some unknown firmware thing) or the issue is limited to just
+non-ULT HSW systems. All known registers that could affect this
+look perfectly reasonable on the affected machine.
+
+As a workaround let's unmask the LPSP event to prevent PSR entry
+except while in LPSP mode (only pipe A + eDP active). This
+will prevent PSR entry entirely when multiple pipes are active.
+The one slight downside is that we now also prevent PSR entry
+when driving eDP with pipe B or C, but I think that's a reasonable
+tradeoff to avoid having to implement a more complex workaround.
+
+Cc: stable@vger.kernel.org
+Fixes: 783d8b80871f ("drm/i915/psr: Re-enable PSR1 on hsw/bdw")
+Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/10092
+Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240118212131.31868-1-ville.syrjala@linux.intel.com
+Reviewed-by: Jouni Högander <jouni.hogander@intel.com>
+(cherry picked from commit 94501c3ca6400e463ff6cc0c9cf4a2feb6a9205d)
+Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/i915/display/intel_psr.c |   14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpu/drm/i915/display/intel_psr.c
++++ b/drivers/gpu/drm/i915/display/intel_psr.c
+@@ -1401,8 +1401,18 @@ static void intel_psr_enable_source(stru
+        * can rely on frontbuffer tracking.
+        */
+       mask = EDP_PSR_DEBUG_MASK_MEMUP |
+-             EDP_PSR_DEBUG_MASK_HPD |
+-             EDP_PSR_DEBUG_MASK_LPSP;
++             EDP_PSR_DEBUG_MASK_HPD;
++
++      /*
++       * For some unknown reason on HSW non-ULT (or at least on
++       * Dell Latitude E6540) external displays start to flicker
++       * when PSR is enabled on the eDP. SR/PC6 residency is much
++       * higher than should be possible with an external display.
++       * As a workaround leave LPSP unmasked to prevent PSR entry
++       * when external displays are active.
++       */
++      if (DISPLAY_VER(dev_priv) >= 8 || IS_HASWELL_ULT(dev_priv))
++              mask |= EDP_PSR_DEBUG_MASK_LPSP;
+       if (DISPLAY_VER(dev_priv) < 20)
+               mask |= EDP_PSR_DEBUG_MASK_MAX_SLEEP;
diff --git a/queue-6.7/drm-tidss-fix-atomic_flush-check.patch b/queue-6.7/drm-tidss-fix-atomic_flush-check.patch
new file mode 100644 (file)
index 0000000..131f2fb
--- /dev/null
@@ -0,0 +1,54 @@
+From 95d4b471953411854f9c80b568da7fcf753f3801 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Date: Thu, 9 Nov 2023 09:38:03 +0200
+Subject: drm/tidss: Fix atomic_flush check
+
+From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+
+commit 95d4b471953411854f9c80b568da7fcf753f3801 upstream.
+
+tidss_crtc_atomic_flush() checks if the crtc is enabled, and if not,
+returns immediately as there's no reason to do any register changes.
+
+However, the code checks for 'crtc->state->enable', which does not
+reflect the actual HW state. We should instead look at the
+'crtc->state->active' flag.
+
+This causes the tidss_crtc_atomic_flush() to proceed with the flush even
+if the active state is false, which then causes us to hit the
+WARN_ON(!crtc->state->event) check.
+
+Fix this by checking the active flag, and while at it, fix the related
+debug print which had "active" and "needs modeset" wrong way.
+
+Cc:  <stable@vger.kernel.org>
+Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem")
+Reviewed-by: Aradhya Bhatia <a-bhatia1@ti.com>
+Link: https://lore.kernel.org/r/20231109-tidss-probe-v2-10-ac91b5ea35c0@ideasonboard.com
+Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/tidss/tidss_crtc.c |   10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+--- a/drivers/gpu/drm/tidss/tidss_crtc.c
++++ b/drivers/gpu/drm/tidss/tidss_crtc.c
+@@ -169,13 +169,13 @@ static void tidss_crtc_atomic_flush(stru
+       struct tidss_device *tidss = to_tidss(ddev);
+       unsigned long flags;
+-      dev_dbg(ddev->dev,
+-              "%s: %s enabled %d, needs modeset %d, event %p\n", __func__,
+-              crtc->name, drm_atomic_crtc_needs_modeset(crtc->state),
+-              crtc->state->enable, crtc->state->event);
++      dev_dbg(ddev->dev, "%s: %s is %sactive, %s modeset, event %p\n",
++              __func__, crtc->name, crtc->state->active ? "" : "not ",
++              drm_atomic_crtc_needs_modeset(crtc->state) ? "needs" : "doesn't need",
++              crtc->state->event);
+       /* There is nothing to do if CRTC is not going to be enabled. */
+-      if (!crtc->state->enable)
++      if (!crtc->state->active)
+               return;
+       /*
diff --git a/queue-6.7/drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch b/queue-6.7/drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch
new file mode 100644 (file)
index 0000000..8b7af13
--- /dev/null
@@ -0,0 +1,53 @@
+From 0240db231dfe5ee5b7a3a03cba96f0844b7a673d Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <javierm@redhat.com>
+Date: Thu, 23 Nov 2023 23:13:01 +0100
+Subject: drm/virtio: Disable damage clipping if FB changed since last page-flip
+
+From: Javier Martinez Canillas <javierm@redhat.com>
+
+commit 0240db231dfe5ee5b7a3a03cba96f0844b7a673d upstream.
+
+The driver does per-buffer uploads and needs to force a full plane update
+if the plane's attached framebuffer has change since the last page-flip.
+
+Fixes: 01f05940a9a7 ("drm/virtio: Enable fb damage clips property for the primary plane")
+Cc: <stable@vger.kernel.org> # v6.4+
+Reported-by: nerdopolis <bluescreen_avenger@verizon.net>
+Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115
+Suggested-by: Sima Vetter <daniel.vetter@ffwll.ch>
+Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
+Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
+Reviewed-by: Zack Rusin <zackr@vmware.com>
+Acked-by: Sima Vetter <daniel.vetter@ffwll.ch>
+Link: https://patchwork.freedesktop.org/patch/msgid/20231123221315.3579454-3-javierm@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/virtio/virtgpu_plane.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
++++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
+@@ -79,6 +79,8 @@ static int virtio_gpu_plane_atomic_check
+ {
+       struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state,
+                                                                                plane);
++      struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state,
++                                                                               plane);
+       bool is_cursor = plane->type == DRM_PLANE_TYPE_CURSOR;
+       struct drm_crtc_state *crtc_state;
+       int ret;
+@@ -86,6 +88,14 @@ static int virtio_gpu_plane_atomic_check
+       if (!new_plane_state->fb || WARN_ON(!new_plane_state->crtc))
+               return 0;
++      /*
++       * Ignore damage clips if the framebuffer attached to the plane's state
++       * has changed since the last plane update (page-flip). In this case, a
++       * full plane update should happen because uploads are done per-buffer.
++       */
++      if (old_plane_state->fb != new_plane_state->fb)
++              new_plane_state->ignore_damage_clips = true;
++
+       crtc_state = drm_atomic_get_crtc_state(state,
+                                              new_plane_state->crtc);
+       if (IS_ERR(crtc_state))
index a4805be1f1b7895de13929c40d7aca66d239dc46..bdac284b4f81f4a11e28b1c9801dbd3616765dd5 100644 (file)
@@ -245,3 +245,13 @@ gpiolib-acpi-ignore-touchpad-wakeup-on-gpd-g1619-04.patch
 cpufreq-intel_pstate-refine-computation-of-p-state-for-given-frequency.patch
 revert-nouveau-push-event-block-allowing-out-of-the-fence-context.patch
 revert-drm-i915-dsi-do-display-on-sequence-later-on-icl.patch
+drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch
+drm-i915-psr-only-allow-psr-in-lpsp-mode-on-hsw-non-ult.patch
+drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch
+drm-fix-todo-list-mentioning-non-kms-drivers.patch
+drm-tidss-fix-atomic_flush-check.patch
+drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch
+drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch
+drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch
+drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch
+drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch