Re: Regression in 6.2.10 monitors connected via MST hub stay black

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I applied the patch to 6.2.10 and it works.

To be able to apply it, I had to adapt slightly (renamed 'mst_output_port' to 'port'). I attached the patch I applied.

Thanks you for working on the issue!

On 11/04/2023 02.47, Mario Limonciello wrote:
That's great, thanks!  So we do have a path to getting this fixed without a revert then, it just might be a few steps.

Can you try to apply that directly to 6.2.y as well to see if it helps there too?

On 4/10/23 16:35, Veronika Schwan wrote:
Hi,

6.3-rc6 alone fails the same way.
When the commit is added, it works.

On 10/04/2023 21.22, Limonciello, Mario wrote:
[Public]

And if 6.3-rc6 fails the same way, please one more check with 6.3-rc6 + this commit:
https://gitlab.freedesktop.org/agd5f/linux/-/commit/c7c4fe5d0b0a

Hi,

Can you by chance cross reference 6.3-rc6?
It's quite possible we're missing some other commits to backport at the same
time.

Thanks,

-----Original Message-----
From: Veronika Schwan <veronika@xxxxxxxxxxxxxxxxx>
Sent: Monday, April 10, 2023 14:15
To: Zuo, Jerry <Jerry.Zuo@xxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx; Limonciello, Mario
<Mario.Limonciello@xxxxxxx>
Subject: Regression in 6.2.10 monitors connected via MST hub stay black

I found a regression while updating from 6.2.9 to 6.2.10 (Arch Linux).
After upgrading to 6.2.10, my external monitors stopped working (no
input) when starting my display manager.
My hardware:
Lenovo T14s AMD gen 1
Lenovo USB-C Dock Gen 2 40AS (firmware up to date: 13.24)
2 monitors connected via dock and thus via an MST hub

Reverting commit d7b5638bd3374a47f0b038449118b12d8d6e391c fixes the
issue.

Best regards,
Veronika
From c7c4fe5d0b0af3e7e39890453e9220079831ffe1 Mon Sep 17 00:00:00 2001
From: Wayne Lin <Wayne.Lin@xxxxxxx>
Date: Fri, 17 Feb 2023 13:26:56 +0800
Subject: [PATCH] drm/amd/display: Pass the right info to drm_dp_remove_payload

[Why & How]
drm_dp_remove_payload() interface was changed. Correct amdgpu dm code
to pass the right parameter to the drm helper function.

Reviewed-by: Jerry Zuo <Jerry.Zuo@xxxxxxx>
Acked-by: Qingqing Zhuo <qingqing.zhuo@xxxxxxx>
Signed-off-by: Wayne Lin <Wayne.Lin@xxxxxxx>
Tested-by: Daniel Wheeler <daniel.wheeler@xxxxxxx>
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 57 ++++++++++++++++---
 1 file changed, 50 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 1be04c613deb..8d598b322e5b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -177,6 +177,40 @@ void dm_helpers_dp_update_branch_info(
 	const struct dc_link *link)
 {}
 
+static void dm_helpers_construct_old_payload(
+			struct dc_link *link,
+			int pbn_per_slot,
+			struct drm_dp_mst_atomic_payload *new_payload,
+			struct drm_dp_mst_atomic_payload *old_payload)
+{
+	struct link_mst_stream_allocation_table current_link_table =
+									link->mst_stream_alloc_table;
+	struct link_mst_stream_allocation *dc_alloc;
+	int i;
+
+	*old_payload = *new_payload;
+
+	/* Set correct time_slots/PBN of old payload.
+	 * other fields (delete & dsc_enabled) in
+	 * struct drm_dp_mst_atomic_payload are don't care fields
+	 * while calling drm_dp_remove_payload()
+	 */
+	for (i = 0; i < current_link_table.stream_count; i++) {
+		dc_alloc =
+			&current_link_table.stream_allocations[i];
+
+		if (dc_alloc->vcp_id == new_payload->vcpi) {
+			old_payload->time_slots = dc_alloc->slot_count;
+			old_payload->pbn = dc_alloc->slot_count * pbn_per_slot;
+			break;
+		}
+	}
+
+	/* make sure there is an old payload*/
+	ASSERT(i != current_link_table.stream_count);
+
+}
+
 /*
  * Writes payload allocation table in immediate downstream device.
  */
@@ -188,7 +222,7 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
 {
 	struct amdgpu_dm_connector *aconnector;
 	struct drm_dp_mst_topology_state *mst_state;
-	struct drm_dp_mst_atomic_payload *payload;
+	struct drm_dp_mst_atomic_payload *target_payload, *new_payload, old_payload;
 	struct drm_dp_mst_topology_mgr *mst_mgr;
 
 	aconnector = (struct amdgpu_dm_connector *)stream->dm_stream_context;
@@ -204,17 +238,26 @@ bool dm_helpers_dp_mst_write_payload_allocation_table(
 	mst_state = to_drm_dp_mst_topology_state(mst_mgr->base.state);
 
 	/* It's OK for this to fail */
-	payload = drm_atomic_get_mst_payload_state(mst_state, aconnector->port);
-	if (enable)
-		drm_dp_add_payload_part1(mst_mgr, mst_state, payload);
-	else
-		drm_dp_remove_payload(mst_mgr, mst_state, payload, payload);
+	new_payload = drm_atomic_get_mst_payload_state(mst_state, aconnector->port);
+
+	if (enable) {
+		target_payload = new_payload;
+
+		drm_dp_add_payload_part1(mst_mgr, mst_state, new_payload);
+	} else {
+		/* construct old payload by VCPI*/
+		dm_helpers_construct_old_payload(stream->link, mst_state->pbn_div,
+						new_payload, &old_payload);
+		target_payload = &old_payload;
+
+		drm_dp_remove_payload(mst_mgr, mst_state, &old_payload, new_payload);
+	}
 
 	/* mst_mgr->->payloads are VC payload notify MST branch using DPCD or
 	 * AUX message. The sequence is slot 1-63 allocated sequence for each
 	 * stream. AMD ASIC stream slot allocation should follow the same
 	 * sequence. copy DRM MST allocation to dc */
-	fill_dc_mst_payload_table_from_drm(stream->link, enable, payload, proposed_table);
+	fill_dc_mst_payload_table_from_drm(stream->link, enable, target_payload, proposed_table);
 
 	return true;
 }
-- 
GitLab


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux