From 0c11fd956579d8a17c3add58db95f557b4cc46a0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 27 Jan 2024 14:54:55 -0800 Subject: [PATCH] 6.6-stable patches 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-tidss-fix-atomic_flush-check.patch drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch --- ...amage-helpers-to-ignore-damage-clips.patch | 80 +++++++++ ...ble-psr-su-on-parade-0803-tcon-again.patch | 48 ++++++ ...dwidth-validation-failure-on-dcn-2.1.patch | 38 ++++ ...0-fix-i2c_master_send-error-checking.patch | 58 +++++++ ...ic-contexts-with-virtualized-drivers.patch | 163 ++++++++++++++++++ ...-by-mistake-due-to-deadlock-handling.patch | 48 ++++++ ...todo-list-mentioning-non-kms-drivers.patch | 63 +++++++ .../drm-tidss-fix-atomic_flush-check.patch | 54 ++++++ ...g-if-fb-changed-since-last-page-flip.patch | 58 +++++++ queue-6.6/series | 9 + 10 files changed, 619 insertions(+) create mode 100644 queue-6.6/drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch create mode 100644 queue-6.6/drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch create mode 100644 queue-6.6/drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch create mode 100644 queue-6.6/drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch create mode 100644 queue-6.6/drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch create mode 100644 queue-6.6/drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch create mode 100644 queue-6.6/drm-fix-todo-list-mentioning-non-kms-drivers.patch create mode 100644 queue-6.6/drm-tidss-fix-atomic_flush-check.patch create mode 100644 queue-6.6/drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch diff --git a/queue-6.6/drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch b/queue-6.6/drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch new file mode 100644 index 00000000000..d35fa491891 --- /dev/null +++ b/queue-6.6/drm-allow-drivers-to-indicate-the-damage-helpers-to-ignore-damage-clips.patch @@ -0,0 +1,80 @@ +From 35ed38d58257336c1df26b14fd5110b026e2adde Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +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 + +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: # v6.4+ +Reported-by: nerdopolis +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115 +Suggested-by: Thomas Zimmermann +Signed-off-by: Javier Martinez Canillas +Reviewed-by: Thomas Zimmermann +Reviewed-by: Zack Rusin +Acked-by: Sima Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20231123221315.3579454-2-javierm@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -546,6 +546,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.6/drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch b/queue-6.6/drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch new file mode 100644 index 00000000000..a822cfe2556 --- /dev/null +++ b/queue-6.6/drm-amd-display-disable-psr-su-on-parade-0803-tcon-again.patch @@ -0,0 +1,48 @@ +From 571c2fa26aa654946447c282a09d40a56c7ff128 Mon Sep 17 00:00:00 2001 +From: Mario Limonciello +Date: Mon, 19 Jun 2023 15:04:24 -0500 +Subject: drm/amd/display: Disable PSR-SU on Parade 0803 TCON again + +From: Mario Limonciello + +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 +Cc: Hamza Mahfooz +Signed-off-by: Mario Limonciello +Link: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2046131 +Acked-by: Alex Deucher +Reviewed-by: Harry Wentland +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + 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.6/drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch b/queue-6.6/drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch new file mode 100644 index 00000000000..7c8123e0620 --- /dev/null +++ b/queue-6.6/drm-amd-display-fix-bandwidth-validation-failure-on-dcn-2.1.patch @@ -0,0 +1,38 @@ +From 3a0fa3bc245ef92838a8296e0055569b8dff94c4 Mon Sep 17 00:00:00 2001 +From: Melissa Wen +Date: Fri, 29 Dec 2023 15:25:00 -0100 +Subject: drm/amd/display: fix bandwidth validation failure on DCN 2.1 + +From: Melissa Wen + +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 +Signed-off-by: Hamza Mahfooz +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -10400,7 +10400,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.6/drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch b/queue-6.6/drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch new file mode 100644 index 00000000000..b88674c53bd --- /dev/null +++ b/queue-6.6/drm-bridge-nxp-ptn3460-fix-i2c_master_send-error-checking.patch @@ -0,0 +1,58 @@ +From 914437992876838662c968cb416f832110fb1093 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Mon, 4 Dec 2023 15:29:00 +0300 +Subject: drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking + +From: Dan Carpenter + +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 +Reviewed-by: Robert Foss +Signed-off-by: Robert Foss +Link: https://patchwork.freedesktop.org/patch/msgid/0cdc2dce-ca89-451a-9774-1482ab2f4762@moroto.mountain +Signed-off-by: Greg Kroah-Hartman +--- + 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.6/drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch b/queue-6.6/drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch new file mode 100644 index 00000000000..523529e4c08 --- /dev/null +++ b/queue-6.6/drm-disable-the-cursor-plane-on-atomic-contexts-with-virtualized-drivers.patch @@ -0,0 +1,163 @@ +From 4e3b70da64a53784683cfcbac2deda5d6e540407 Mon Sep 17 00:00:00 2001 +From: Zack Rusin +Date: Mon, 23 Oct 2023 09:46:05 +0200 +Subject: drm: Disable the cursor plane on atomic contexts with virtualized drivers + +From: Zack Rusin + +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 +Fixes: 681e7ec73044 ("drm: Allow userspace to ask for universal plane list (v2)") +Cc: # v5.4+ +Cc: Maarten Lankhorst +Cc: Maxime Ripard +Cc: Thomas Zimmermann +Cc: David Airlie +Cc: Daniel Vetter +Cc: Dave Airlie +Cc: Gerd Hoffmann +Cc: Hans de Goede +Cc: Gurchetan Singh +Cc: Chia-I Wu +Cc: dri-devel@lists.freedesktop.org +Cc: virtualization@lists.linux-foundation.org +Cc: spice-devel@lists.freedesktop.org +Acked-by: Pekka Paalanen +Reviewed-by: Javier Martinez Canillas +Acked-by: Simon Ser +Signed-off-by: Javier Martinez Canillas +Link: https://patchwork.freedesktop.org/patch/msgid/20231023074613.41327-2-aesteve@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -283,7 +283,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 +@@ -229,6 +229,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.6/drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch b/queue-6.6/drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch new file mode 100644 index 00000000000..abb7075d844 --- /dev/null +++ b/queue-6.6/drm-don-t-unref-the-same-fb-many-times-by-mistake-due-to-deadlock-handling.patch @@ -0,0 +1,48 @@ +From cb4daf271302d71a6b9a7c01bd0b6d76febd8f0c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= +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ä + +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ä +Link: https://patchwork.freedesktop.org/patch/msgid/20231211081625.25704-1-ville.syrjala@linux.intel.com +Acked-by: Javier Martinez Canillas +Signed-off-by: Greg Kroah-Hartman +--- + 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.6/drm-fix-todo-list-mentioning-non-kms-drivers.patch b/queue-6.6/drm-fix-todo-list-mentioning-non-kms-drivers.patch new file mode 100644 index 00000000000..55d1fab426b --- /dev/null +++ b/queue-6.6/drm-fix-todo-list-mentioning-non-kms-drivers.patch @@ -0,0 +1,63 @@ +From 9cf5ca1f485cae406968947a92bf304603999fa1 Mon Sep 17 00:00:00 2001 +From: Thomas Zimmermann +Date: Wed, 22 Nov 2023 13:09:31 +0100 +Subject: drm: Fix TODO list mentioning non-KMS drivers + +From: Thomas Zimmermann + +commit 9cf5ca1f485cae406968947a92bf304603999fa1 upstream. + +Non-KMS drivers have been removed from DRM. Update the TODO list +accordingly. + +Signed-off-by: Thomas Zimmermann +Fixes: a276afc19eec ("drm: Remove some obsolete drm pciids(tdfx, mga, i810, savage, r128, sis, via)") +Cc: Cai Huoqing +Cc: Daniel Vetter +Cc: Dave Airlie +Cc: Thomas Zimmermann +Cc: Maarten Lankhorst +Cc: Maxime Ripard +Cc: David Airlie +Cc: Daniel Vetter +Cc: Jonathan Corbet +Cc: dri-devel@lists.freedesktop.org +Cc: # v6.3+ +Cc: linux-doc@vger.kernel.org +Reviewed-by: David Airlie +Reviewed-by: Daniel Vetter +Acked-by: Alex Deucher +Link: https://patchwork.freedesktop.org/patch/msgid/20231122122449.11588-3-tzimmermann@suse.de +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/gpu/todo.rst | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst +index 503d57c75215..41a264bf84ce 100644 +--- 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 structure and calling drm_dev_register(). + - 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 + +-- +2.43.0 + diff --git a/queue-6.6/drm-tidss-fix-atomic_flush-check.patch b/queue-6.6/drm-tidss-fix-atomic_flush-check.patch new file mode 100644 index 00000000000..131f2fb8a78 --- /dev/null +++ b/queue-6.6/drm-tidss-fix-atomic_flush-check.patch @@ -0,0 +1,54 @@ +From 95d4b471953411854f9c80b568da7fcf753f3801 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen +Date: Thu, 9 Nov 2023 09:38:03 +0200 +Subject: drm/tidss: Fix atomic_flush check + +From: Tomi Valkeinen + +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: +Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") +Reviewed-by: Aradhya Bhatia +Link: https://lore.kernel.org/r/20231109-tidss-probe-v2-10-ac91b5ea35c0@ideasonboard.com +Signed-off-by: Tomi Valkeinen +Signed-off-by: Greg Kroah-Hartman +--- + 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.6/drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch b/queue-6.6/drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch new file mode 100644 index 00000000000..e299b8b05e9 --- /dev/null +++ b/queue-6.6/drm-virtio-disable-damage-clipping-if-fb-changed-since-last-page-flip.patch @@ -0,0 +1,58 @@ +From 0240db231dfe5ee5b7a3a03cba96f0844b7a673d Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +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 + +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: # v6.4+ +Reported-by: nerdopolis +Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218115 +Suggested-by: Sima Vetter +Signed-off-by: Javier Martinez Canillas +Reviewed-by: Thomas Zimmermann +Reviewed-by: Zack Rusin +Acked-by: Sima Vetter +Link: https://patchwork.freedesktop.org/patch/msgid/20231123221315.3579454-3-javierm@redhat.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c +index 20de599658c1..a72a2dbda031 100644 +--- 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 *plane, + { + 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(struct drm_plane *plane, + 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)) +-- +2.43.0 + diff --git a/queue-6.6/series b/queue-6.6/series index 3dbaebc3e15..4ba887ec6fa 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -252,3 +252,12 @@ xfs-read-only-mounts-with-fsopen-mount-api-are-busted.patch gpiolib-acpi-ignore-touchpad-wakeup-on-gpd-g1619-04.patch cpufreq-intel_pstate-refine-computation-of-p-state-for-given-frequency.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-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 -- 2.47.3