Skip to contentSkip to conversation

DC Patches for 2021 April 19

PATCH In review Aurabindo Pillai 2 participants 23 messages Apr 16, 2021 – Apr 19, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover DC Patches for 2021 April 19

This DC patchset brings improvements in multiple areas. In summary, we highlight:

* DC v3.2.132
* Fw v0.0.62
* Bug fixes across HDCP, DSC, FreeSync, etc

--

Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.62

Anthony Wang (2):
drm/amd/display: Add DSC check to seamless boot validation drm/amd/display: disable seamless boot for external DP

Aric Cyr (2):
drm/amd/display: Fix FreeSync when RGB MPO in use drm/amd/display: 3.2.132

Bing Guo (1):
drm/amd/display: add helper for enabling mst stream features

David Galiffi (1):
drm/amd/display: Fixed typo in function name.

Dillon Varone (2):
drm/amd/display: Fix call to pass bpp in 16ths of a bit drm/amd/display: Report Proper Quantization Range in AVI Infoframe

Dingchen (David) Zhang (4):
drm/amd/display: update hdcp display using correct CP type. drm/amd/display: add handling for hdcp2 rx id list validation drm/amd/display: force CP to DESIRED when removing display. drm/amd/display: fix HDCP drm prop update for MST

Hugo Hu (1):
drm/amd/display: treat memory as a single-channel for asymmetric
memory v2

Michael Strauss (1):
drm/amd/display: Add link rate optimization logs for ILR

Nicholas Kazlauskas (1):
drm/amd/display: Always poll for rxstatus in authenticate

Robin Singh (2):
drm/amd/display: fixed divide by zero kernel crash during dsc
enablement
drm/amd/display: removed unused function
dc_link_reallocate_mst_payload.

Wesley Chalmers (1):
drm/amd/display: Unconditionally clear training pattern set after lt

 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    | 130 +++++++++++++-----
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.h    |   6 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  25 ++++
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   4 +-
 .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c |  48 ++++++-
 .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c  |   4 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c      |  15 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |  72 +++-------
 .../gpu/drm/amd/display/dc/core/dc_link_dp.c  |  18 ++-
 .../gpu/drm/amd/display/dc/core/dc_resource.c |  33 +++--
 drivers/gpu/drm/amd/display/dc/dc.h           |   6 +-
 drivers/gpu/drm/amd/display/dc/dc_link.h      |   1 -
 .../display/dc/dce110/dce110_hw_sequencer.c   |   4 +
 .../gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c |  15 +-
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |   2 +
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   |   4 +-
 .../display/modules/hdcp/hdcp1_execution.c    |   2 -
 .../display/modules/hdcp/hdcp2_execution.c    |   2 -
 .../drm/amd/display/modules/hdcp/hdcp_psp.c   |   2 +
 19 files changed, 257 insertions(+), 136 deletions(-)
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

PATCH 1/19 drm/amd/display: fixed divide by zero kernel crash during dsc enablement

From: Robin Singh <[email protected]>

[why]
During dsc enable, a divide by zero condition triggered the kernel crash.

[how]
An IGT test, which enable the DSC, was crashing at the time of restore the default dsc status, becaue of h_totals value becoming 0. So add a check before divide condition. If h_total is zero, gracefully ignore and set the default value.

kernel panic log:

	[  128.758827] divide error: 0000 [#1] PREEMPT SMP NOPTI
	[  128.762714] CPU: 5 PID: 4562 Comm: amd_dp_dsc Tainted: G        W         5.4.19-android-x86_64 #1
	[  128.769728] Hardware name: ADVANCED MICRO DEVICES, INC. Mauna/Mauna, BIOS WMN0B13N Nov 11 2020
	[  128.777695] RIP: 0010:hubp2_vready_at_or_After_vsync+0x37/0x7a [amdgpu]
	[  128.785707] Code: 80 02 00 00 48 89 f3 48 8b 7f 08 b ......
	[  128.805696] RSP: 0018:ffffad8f82d43628 EFLAGS: 00010246
	......
	[  128.857707] CR2: 00007106d8465000 CR3: 0000000426530000 CR4: 0000000000140ee0
	[  128.865695] Call Trace:
	[  128.869712] hubp3_setup+0x1f/0x7f [amdgpu]
	[  128.873705] dcn20_update_dchubp_dpp+0xc8/0x54a [amdgpu]
	[  128.877706] dcn20_program_front_end_for_ctx+0x31d/0x463 [amdgpu]
	[  128.885706] dc_commit_state+0x3d2/0x658 [amdgpu]
	[  128.889707] amdgpu_dm_atomic_commit_tail+0x4b3/0x1e7c [amdgpu]
	[  128.897699] ? dm_read_reg_func+0x41/0xb5 [amdgpu]
	[  128.901707] ? dm_read_reg_func+0x41/0xb5 [amdgpu]
	[  128.905706] ? __is_insn_slot_addr+0x43/0x48
	[  128.909706] ? fill_plane_buffer_attributes+0x29e/0x3dc [amdgpu]
	[  128.917705] ? dm_plane_helper_prepare_fb+0x255/0x284 [amdgpu]
	[  128.921700] ? usleep_range+0x7c/0x7c
	[  128.925705] ? preempt_count_sub+0xf/0x18
	[  128.929706] ? _raw_spin_unlock_irq+0x13/0x24
	[  128.933732] ? __wait_for_common+0x11e/0x18f
	[  128.937705] ? _raw_spin_unlock_irq+0x13/0x24
	[  128.941706] ? __wait_for_common+0x11e/0x18f
	[  128.945705] commit_tail+0x8b/0xd2 [drm_kms_helper]
	[  128.949707] drm_atomic_helper_commit+0xd8/0xf5 [drm_kms_helper]
	[  128.957706] amdgpu_dm_atomic_commit+0x337/0x360 [amdgpu]
	[  128.961705] ? drm_atomic_check_only+0x543/0x68d [drm]
	[  128.969705] ? drm_atomic_set_property+0x760/0x7af [drm]
	[  128.973704] ? drm_mode_atomic_ioctl+0x6f3/0x85a [drm]
	[  128.977705] drm_mode_atomic_ioctl+0x6f3/0x85a [drm]
	[  128.985705] ? drm_atomic_set_property+0x7af/0x7af [drm]
	[  128.989706] drm_ioctl_kernel+0x82/0xda [drm]
	[  128.993706] drm_ioctl+0x225/0x319 [drm]
	[  128.997707] ? drm_atomic_set_property+0x7af/0x7af [drm]
	[  129.001706] ? preempt_count_sub+0xf/0x18
	[  129.005713] amdgpu_drm_ioctl+0x4b/0x76 [amdgpu]
	[  129.009705] vfs_ioctl+0x1d/0x2a
	[  129.013705] do_vfs_ioctl+0x419/0x43d
	[  129.017707] ksys_ioctl+0x52/0x71
	[  129.021707] __x64_sys_ioctl+0x16/0x19
	[  129.025706] do_syscall_64+0x78/0x85
	[  129.029705] entry_SYSCALL_64_after_hwframe+0x44/0xa9
---
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c +9 -6
index bec7059f6d5d..a1318c31bcfa 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2012-17 Advanced Micro Devices, Inc.
+ * Copyright 2012-2021 Advanced Micro Devices, Inc.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -181,11 +181,14 @@ void hubp2_vready_at_or_After_vsync(struct hubp *hubp,
 	else
 		Set HUBP_VREADY_AT_OR_AFTER_VSYNC = 0
 	*/
-	if ((pipe_dest->vstartup_start - (pipe_dest->vready_offset+pipe_dest->vupdate_width
-		+ pipe_dest->vupdate_offset) / pipe_dest->htotal) <= pipe_dest->vblank_end) {
-		value = 1;
-	} else
-		value = 0;
+	if (pipe_dest->htotal != 0) {
+		if ((pipe_dest->vstartup_start - (pipe_dest->vready_offset+pipe_dest->vupdate_width
+			+ pipe_dest->vupdate_offset) / pipe_dest->htotal) <= pipe_dest->vblank_end) {
+			value = 1;
+		} else
+			value = 0;
+	}
+
 	REG_UPDATE(DCHUBP_CNTL, HUBP_VREADY_AT_OR_AFTER_VSYNC, value);
 }
 
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw

PATCH 2/19 drm/amd/display: Add DSC check to seamless boot validation

In reply to Aurabindo Pillai

From: Anthony Wang <[email protected]>

[Why & How]
We want to immediately fail seamless boot validation if DSC is active, as VBIOS currently does not support DSC timings. Add a check for the relevant flag in dc_validate_seamless_boot_timing.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +4 -0
index 757820a3f068..724ddce8aa41 100644
@@ -1400,6 +1400,10 @@ bool dc_validate_seamless_boot_timing(const struct dc *dc,
 	if (crtc_timing->v_sync_width != hw_crtc_timing.v_sync_width)
 		return false;
 
+	/* block DSC for now, as VBIOS does not currently support DSC timings */
+	if (crtc_timing->flags.DSC)
+		return false;
+
 	if (dc_is_dp_signal(link->connector_signal)) {
 		unsigned int pix_clk_100hz;
 
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 3/19 drm/amd/display: update hdcp display using correct CP type.

In reply to Aurabindo Pillai

From: "Dingchen (David) Zhang" <[email protected]>

[why]
currently we enforce to update hdcp display using TYPE0, but there is case that connector CP type prop be TYPE1 instead of type0.

[how]
using the drm prop of CP type of the connector as input argument.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +7 -1
index 60f91853bd82..616f5b1ea3a8 100644
@@ -434,6 +434,7 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
 	int link_index = aconnector->dc_link->link_index;
 	struct mod_hdcp_display *display = &hdcp_work[link_index].display;
 	struct mod_hdcp_link *link = &hdcp_work[link_index].link;
+	struct drm_connector_state *conn_state;
 
 	if (config->dpms_off) {
 		hdcp_remove_display(hdcp_work, link_index, aconnector);
@@ -459,8 +460,13 @@ static void update_config(void *handle, struct cp_psp_stream_config *config)
 	display->adjust.disable = MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION;
 	link->adjust.auth_delay = 3;
 	link->adjust.hdcp1.disable = 0;
+	conn_state = aconnector->base.state;
 
-	hdcp_update_display(hdcp_work, link_index, aconnector, DRM_MODE_HDCP_CONTENT_TYPE0, false);
+	pr_debug("[HDCP_DM] display %d, CP %d, type %d\n", aconnector->base.index,
+			(!!aconnector->base.state) ? aconnector->base.state->content_protection : -1,
+			(!!aconnector->base.state) ? aconnector->base.state->hdcp_content_type : -1);
+
+	hdcp_update_display(hdcp_work, link_index, aconnector, conn_state->hdcp_content_type, false);
 }
 
 
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 4/19 drm/amd/display: add handling for hdcp2 rx id list validation

In reply to Aurabindo Pillai

From: "Dingchen (David) Zhang" <[email protected]>

[why]
the current implementation of hdcp2 rx id list validation does not have handler/checker for invalid message status, e.g. HMAC, the V parameter calculated from PSP not matching the V prime from Rx.

[how]
return a generic FAILURE for any message status not SUCCESS or REVOKED.

---
 drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/modules/hdcp/hdcp_psp.c +2 -0
index 9d7ca316dc3f..26f96c05e0ec 100644
@@ -791,6 +791,8 @@ enum mod_hdcp_status mod_hdcp_hdcp2_validate_rx_id_list(struct mod_hdcp *hdcp)
 			   TA_HDCP2_MSG_AUTHENTICATION_STATUS__RECEIVERID_REVOKED) {
 			hdcp->connection.is_hdcp2_revoked = 1;
 			status = MOD_HDCP_STATUS_HDCP2_RX_ID_LIST_REVOKED;
+		} else {
+			status = MOD_HDCP_STATUS_HDCP2_VALIDATE_RX_ID_LIST_FAILURE;
 		}
 	}
 	mutex_unlock(&psp->hdcp_context.mutex);
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

PATCH 5/19 drm/amd/display: disable seamless boot for external DP

In reply to Aurabindo Pillai

From: Anthony Wang <[email protected]>

[Why]
Primary feature use case is with eDP panels.

[How]
Fail seamless boot validation if display is not an eDP panel.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -4
index 724ddce8aa41..ee4970491d7b 100644
@@ -1323,11 +1323,10 @@ bool dc_validate_seamless_boot_timing(const struct dc *dc,
 	struct dc_link *link = sink->link;
 	unsigned int i, enc_inst, tg_inst = 0;
 
-	// Seamless port only support single DP and EDP so far
-	if ((sink->sink_signal != SIGNAL_TYPE_DISPLAY_PORT &&
-		sink->sink_signal != SIGNAL_TYPE_EDP) ||
-		sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
+	/* Support seamless boot on EDP displays only */
+	if (sink->sink_signal != SIGNAL_TYPE_EDP) {
 		return false;
+	}
 
 	/* Check for enabled DIG to identify enabled display */
 	if (!link->link_enc->funcs->is_dig_enabled(link->link_enc))
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

PATCH 6/19 drm/amd/display: removed unused function dc_link_reallocate_mst_payload.

In reply to Aurabindo Pillai

From: Robin Singh <[email protected]>

[Why]
Found that dc_link_reallocate_mst_payload is not used anymore in any of the use case scenario.

[How]
removed dc_link_reallocate_mst_payload function definition and declaration.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 44 -------------------
 drivers/gpu/drm/amd/display/dc/dc_link.h      |  1 -
 2 files changed, 45 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -44
index 9507b08567b4..fa384923cfc1 100644
@@ -3136,50 +3136,6 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
 	return DC_OK;
 }
 
-enum dc_status dc_link_reallocate_mst_payload(struct dc_link *link)
-{
-	int i;
-	struct pipe_ctx *pipe_ctx;
-
-	// Clear all of MST payload then reallocate
-	for (i = 0; i < MAX_PIPES; i++) {
-		pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
-
-		/* driver enable split pipe for external monitors
-		 * we have to check pipe_ctx is split pipe or not
-		 * If it's split pipe, driver using top pipe to
-		 * reaallocate.
-		 */
-		if (!pipe_ctx || pipe_ctx->top_pipe)
-			continue;
-
-		if (pipe_ctx->stream && pipe_ctx->stream->link == link &&
-				pipe_ctx->stream->dpms_off == false &&
-				pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
-			deallocate_mst_payload(pipe_ctx);
-		}
-	}
-
-	for (i = 0; i < MAX_PIPES; i++) {
-		pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
-
-		if (!pipe_ctx || pipe_ctx->top_pipe)
-			continue;
-
-		if (pipe_ctx->stream && pipe_ctx->stream->link == link &&
-				pipe_ctx->stream->dpms_off == false &&
-				pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
-			/* enable/disable PHY will clear connection between BE and FE
-			 * need to restore it.
-			 */
-			link->link_enc->funcs->connect_dig_be_to_fe(link->link_enc,
-									pipe_ctx->stream_res.stream_enc->id, true);
-			dc_link_allocate_mst_payload(pipe_ctx);
-		}
-	}
-
-	return DC_OK;
-}
 
 #if defined(CONFIG_DRM_AMD_DC_HDCP)
 static void update_psp_stream_config(struct pipe_ctx *pipe_ctx, bool dpms_off)
drivers/gpu/drm/amd/display/dc/dc_link.h +0 -1
index b0013e674864..054bab45ee17 100644
@@ -276,7 +276,6 @@ enum dc_detect_reason {
 bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);
 bool dc_link_get_hpd_state(struct dc_link *dc_link);
 enum dc_status dc_link_allocate_mst_payload(struct pipe_ctx *pipe_ctx);
-enum dc_status dc_link_reallocate_mst_payload(struct dc_link *link);
 
 /* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).
  * Return:
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#7 lore raw

PATCH 7/19 drm/amd/display: treat memory as a single-channel for asymmetric memory v2

In reply to Aurabindo Pillai

From: Hugo Hu <[email protected]>

Previous change had been reverted since it caused hang. Remake change to avoid defect.

[Why]
1. Driver use umachannelnumber to calculate watermarks for stutter. In asymmetric memory config, the actual bandwidth is less than dual-channel. The bandwidth should be the same as single-channel.
2. We found single rank dimm need additional delay time for stutter.

[How]
Get information from each DIMM. Treat memory config as a single-channel for asymmetric memory in bandwidth calculating.
Add additional delay time for single rank dimm.

Fixes 8a3e4b2516 ("drm/amd/display: System black screen hangs on driver load")
---
 .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 48 ++++++++++++++++++-
 drivers/gpu/drm/amd/display/dc/dc.h           |  2 +
 2 files changed, 48 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +46 -2
index 73e8878b03b6..a06e86853bb9 100644
@@ -769,6 +769,43 @@ static struct wm_table ddr4_wm_table_rn = {
 	}
 };
 
+static struct wm_table ddr4_1R_wm_table_rn = {
+	.entries = {
+		{
+			.wm_inst = WM_A,
+			.wm_type = WM_TYPE_PSTATE_CHG,
+			.pstate_latency_us = 11.72,
+			.sr_exit_time_us = 13.90,
+			.sr_enter_plus_exit_time_us = 14.80,
+			.valid = true,
+		},
+		{
+			.wm_inst = WM_B,
+			.wm_type = WM_TYPE_PSTATE_CHG,
+			.pstate_latency_us = 11.72,
+			.sr_exit_time_us = 13.90,
+			.sr_enter_plus_exit_time_us = 14.80,
+			.valid = true,
+		},
+		{
+			.wm_inst = WM_C,
+			.wm_type = WM_TYPE_PSTATE_CHG,
+			.pstate_latency_us = 11.72,
+			.sr_exit_time_us = 13.90,
+			.sr_enter_plus_exit_time_us = 14.80,
+			.valid = true,
+		},
+		{
+			.wm_inst = WM_D,
+			.wm_type = WM_TYPE_PSTATE_CHG,
+			.pstate_latency_us = 11.72,
+			.sr_exit_time_us = 13.90,
+			.sr_enter_plus_exit_time_us = 14.80,
+			.valid = true,
+		},
+	}
+};
+
 static struct wm_table lpddr4_wm_table_rn = {
 	.entries = {
 		{
@@ -953,8 +990,12 @@ void rn_clk_mgr_construct(
 		} else {
 			if (is_green_sardine)
 				rn_bw_params.wm_table = ddr4_wm_table_gs;
-			else
-				rn_bw_params.wm_table = ddr4_wm_table_rn;
+			else {
+				if (ctx->dc->config.is_single_rank_dimm)
+					rn_bw_params.wm_table = ddr4_1R_wm_table_rn;
+				else
+					rn_bw_params.wm_table = ddr4_wm_table_rn;
+			}
 		}
 		/* Saved clocks configured at boot for debug purposes */
 		rn_dump_clk_registers(&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info);
@@ -972,6 +1013,9 @@ void rn_clk_mgr_construct(
 		if (status == PP_SMU_RESULT_OK &&
 		    ctx->dc_bios && ctx->dc_bios->integrated_info) {
 			rn_clk_mgr_helper_populate_bw_params (clk_mgr->base.bw_params, &clock_table, ctx->dc_bios->integrated_info);
+			/* treat memory config as single channel if memory is asymmetrics. */
+			if (ctx->dc->config.is_asymmetric_memory)
+				clk_mgr->base.bw_params->num_channels = 1;
 		}
 	}
 
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
index 82a324a618db..870cd7c6a387 100644
@@ -308,6 +308,8 @@ struct dc_config {
 #endif
 	uint64_t vblank_alignment_dto_params;
 	uint8_t  vblank_alignment_max_frame_time_diff;
+	bool is_asymmetric_memory;
+	bool is_single_rank_dimm;
 };
 
 enum visual_confirm {
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#8 lore raw

PATCH 8/19 drm/amd/display: Fix FreeSync when RGB MPO in use

In reply to Aurabindo Pillai

From: Aric Cyr <[email protected]>

[WHY]
We should skip programming manual trigger on non-primary planes when MPO is enabled.

[HOW]
Implement an explicit mechanism for skipping manual trigger programming for planes that shouldn't cause the frame to end.

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/dc.h      | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -1
index ee4970491d7b..79c652eaddb6 100644
@@ -2833,7 +2833,8 @@ static void commit_planes_for_stream(struct dc *dc,
 
 		if (pipe_ctx->bottom_pipe || pipe_ctx->next_odm_pipe ||
 				!pipe_ctx->stream || pipe_ctx->stream != stream ||
-				!pipe_ctx->plane_state->update_flags.bits.addr_update)
+				!pipe_ctx->plane_state->update_flags.bits.addr_update ||
+				pipe_ctx->plane_state->skip_manual_trigger)
 			continue;
 
 		if (pipe_ctx->stream_res.tg->funcs->program_manual_trigger)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
index 870cd7c6a387..ed19b9b39af0 100644
@@ -907,6 +907,8 @@ struct dc_plane_state {
 
 	union surface_update_flags update_flags;
 	bool flip_int_enabled;
+	bool skip_manual_trigger;
+
 	/* private to DC core */
 	struct dc_plane_status status;
 	struct dc_context *ctx;
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#9 lore raw

PATCH 9/19 drm/amd/display: Unconditionally clear training pattern set after lt

In reply to Aurabindo Pillai

From: Wesley Chalmers <[email protected]>

[WHY]
While Link Training is being performed,
and the LTTPRs are in Non-LTTPR or LTTPR Transparent mode, any DPCD registers besides those used for Link Training are not to be accessed.

The spec defines the link training registers as DP_TRAINING_PATTERN_SET (102h) to DP_TRAINING_LANE3_SET (106h), and DP_LANE0_1_STATUS (202h) to DP_ADJUST_REQUEST_LANE2_3 (207h).

[HOW]
Move the current write to DPCD Address DP_LINK_TRAINING_PATTERN_SET out of its conditional block.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +4 -5
index e6f8f3c255bc..bbf2865b25c5 100644
@@ -1132,11 +1132,6 @@ static inline enum link_training_result perform_link_training_int(
 	enum link_training_result status)
 {
 	union lane_count_set lane_count_set = { {0} };
-	union dpcd_training_pattern dpcd_pattern = { {0} };
-
-	/* 3. set training not in progress*/
-	dpcd_pattern.v1_4.TRAINING_PATTERN_SET = DPCD_TRAINING_PATTERN_VIDEOIDLE;
-	dpcd_set_training_pattern(link, dpcd_pattern);
 
 	/* 4. mainlink output idle pattern*/
 	dp_set_hw_test_pattern(link, DP_TEST_PATTERN_VIDEO_MODE, NULL, 0);
@@ -1560,6 +1555,7 @@ enum link_training_result dc_link_dp_perform_link_training(
 {
 	enum link_training_result status = LINK_TRAINING_SUCCESS;
 	struct link_training_settings lt_settings;
+	union dpcd_training_pattern dpcd_pattern = { { 0 } };
 
 	bool fec_enable;
 	uint8_t repeater_cnt;
@@ -1624,6 +1620,9 @@ enum link_training_result dc_link_dp_perform_link_training(
 		}
 	}
 
+	/* 3. set training not in progress*/
+	dpcd_pattern.v1_4.TRAINING_PATTERN_SET = DPCD_TRAINING_PATTERN_VIDEOIDLE;
+	dpcd_set_training_pattern(link, dpcd_pattern);
 	if ((status == LINK_TRAINING_SUCCESS) || !skip_video_pattern) {
 		status = perform_link_training_int(link,
 				&lt_settings,
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#10 lore raw

PATCH 10/19 drm/amd/display: Add link rate optimization logs for ILR

In reply to Aurabindo Pillai

From: Michael Strauss <[email protected]>

[Why&How]
Add logs to verify ILR optimization behaviour on boot

---
 drivers/gpu/drm/amd/display/dc/core/dc.c                 | 1 +
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c         | 9 +++++++--
 .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c  | 4 ++++
 3 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +1 -0
index 79c652eaddb6..4713f09bcbf1 100644
@@ -1434,6 +1434,7 @@ bool dc_validate_seamless_boot_timing(const struct dc *dc,
 	}
 
 	if (is_edp_ilr_optimization_required(link, crtc_timing)) {
+		DC_LOG_EVENT_LINK_TRAINING("Seamless boot disabled to optimize eDP link rate\n");
 		return false;
 	}
 
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +7 -2
index bbf2865b25c5..3ff3d9e90983 100644
@@ -4739,8 +4739,10 @@ bool is_edp_ilr_optimization_required(struct dc_link *link, struct dc_crtc_timin
 	core_link_read_dpcd(link, DP_LINK_BW_SET,
 				&link_bw_set, sizeof(link_bw_set));
 
-	if (link_bw_set)
+	if (link_bw_set) {
+		DC_LOG_EVENT_LINK_TRAINING("eDP ILR: Optimization required, VBIOS used link_bw_set\n");
 		return true;
+	}
 
 	// Read DPCD 00115h to find the edp link rate set used
 	core_link_read_dpcd(link, DP_LINK_RATE_SET,
@@ -4755,9 +4757,12 @@ bool is_edp_ilr_optimization_required(struct dc_link *link, struct dc_crtc_timin
 	decide_edp_link_settings(link, &link_setting, req_bw);
 
 	if (link->dpcd_caps.edp_supported_link_rates[link_rate_set] != link_setting.link_rate ||
-			lane_count_set.bits.LANE_COUNT_SET != link_setting.lane_count)
+			lane_count_set.bits.LANE_COUNT_SET != link_setting.lane_count) {
+		DC_LOG_EVENT_LINK_TRAINING("eDP ILR: Optimization required, VBIOS link_rate_set not optimal\n");
 		return true;
+	}
 
+	DC_LOG_EVENT_LINK_TRAINING("eDP ILR: No optimization required, VBIOS set optimal link_rate_set\n");
 	return false;
 }
 
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +4 -0
index dd903b267ca5..5ddeee96bf23 100644
@@ -1695,6 +1695,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
 	bool can_apply_edp_fast_boot = false;
 	bool can_apply_seamless_boot = false;
 	bool keep_edp_vdd_on = false;
+	DC_LOGGER_INIT();
+
 
 	get_edp_links_with_sink(dc, edp_links_with_sink, &edp_with_sink_num);
 	get_edp_links(dc, edp_links, &edp_num);
@@ -1717,6 +1719,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
 					edp_stream = edp_streams[0];
 					can_apply_edp_fast_boot = !is_edp_ilr_optimization_required(edp_stream->link, &edp_stream->timing);
 					edp_stream->apply_edp_fast_boot_optimization = can_apply_edp_fast_boot;
+					if (can_apply_edp_fast_boot)
+						DC_LOG_EVENT_LINK_TRAINING("eDP fast boot disabled to optimize link rate\n");
 
 					break;
 				}
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#11 lore raw

PATCH 11/19 drm/amd/display: Always poll for rxstatus in authenticate

In reply to Aurabindo Pillai

From: Nicholas Kazlauskas <[email protected]>

[Why]
Requirement from the spec - we shouldn't be potentially exiting out early based on encryption status.

[How]
Drop the calls from HDCP1 and HDCP2 execution that exit out early based on link encryption status.

---
 drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c | 2 --
 drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c | 2 --
 2 files changed, 4 deletions(-)
drivers/gpu/drm/amd/display/modules/hdcp/hdcp1_execution.c +0 -2
index eeac14300a2a..2cbd931363bd 100644
@@ -427,8 +427,6 @@ static enum mod_hdcp_status authenticated_dp(struct mod_hdcp *hdcp,
 		event_ctx->unexpected_event = 1;
 		goto out;
 	}
-	if (!mod_hdcp_is_link_encryption_enabled(hdcp))
-		goto out;
 
 	if (status == MOD_HDCP_STATUS_SUCCESS)
 		mod_hdcp_execute_and_set(mod_hdcp_read_bstatus,
drivers/gpu/drm/amd/display/modules/hdcp/hdcp2_execution.c +0 -2
index f164f6a5d4dc..c1331facdcb4 100644
@@ -564,8 +564,6 @@ static enum mod_hdcp_status authenticated(struct mod_hdcp *hdcp,
 		event_ctx->unexpected_event = 1;
 		goto out;
 	}
-	if (!mod_hdcp_is_link_encryption_enabled(hdcp))
-		goto out;
 
 	process_rxstatus(hdcp, event_ctx, input, &status);
 
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#12 lore raw

PATCH 12/19 drm/amd/display: Fixed typo in function name.

In reply to Aurabindo Pillai

From: David Galiffi <[email protected]>

[How & Why]
Changed "prsent" to "present".

---
 drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +2 -2
index 577e7f97045e..652fa89fae5f 100644
@@ -432,7 +432,7 @@ static void dcn3_get_memclk_states_from_smu(struct clk_mgr *clk_mgr_base)
 			clk_mgr->base.ctx->dc, clk_mgr_base->bw_params);
 }
 
-static bool dcn3_is_smu_prsent(struct clk_mgr *clk_mgr_base)
+static bool dcn3_is_smu_present(struct clk_mgr *clk_mgr_base)
 {
 	struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
 	return clk_mgr->smu_present;
@@ -500,7 +500,7 @@ static struct clk_mgr_funcs dcn3_funcs = {
 		.are_clock_states_equal = dcn3_are_clock_states_equal,
 		.enable_pme_wa = dcn3_enable_pme_wa,
 		.notify_link_rate_change = dcn30_notify_link_rate_change,
-		.is_smu_present = dcn3_is_smu_prsent
+		.is_smu_present = dcn3_is_smu_present
 };
 
 static void dcn3_init_clocks_fpga(struct clk_mgr *clk_mgr)
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#13 lore raw

PATCH 13/19 drm/amd/display: force CP to DESIRED when removing display.

In reply to Aurabindo Pillai

From: "Dingchen (David) Zhang" <[email protected]>

[why]
It is possible that the commit from userspace to cause link stream disable and hdcp auth reset when the HDCP has been enabled at the moment. We'd expect the CP prop back to DESIRED from ENABLED.

[how]
In the helper of hdcp display removal, we check and change the CP prop to DESIRED if at the moment CP is ENABLED before the auth reset and removal of linked list element.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c  | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +13 -0
index 616f5b1ea3a8..50f6b3a86931 100644
@@ -160,6 +160,7 @@ static void link_lock(struct hdcp_workqueue *work, bool lock)
 			mutex_unlock(&work[i].mutex);
 	}
 }
+
 void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
 			 unsigned int link_index,
 			 struct amdgpu_dm_connector *aconnector,
@@ -222,10 +223,22 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
 			 struct amdgpu_dm_connector *aconnector)
 {
 	struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index];
+	struct drm_connector_state *conn_state = aconnector->base.state;
 
 	mutex_lock(&hdcp_w->mutex);
 	hdcp_w->aconnector = aconnector;
 
+	/* the removal of display will invoke auth reset -> hdcp destroy and
+	 * we'd expect the CP prop changed back to DESIRED if at the time ENABLED.
+	 * the CP prop change should occur before the element removed from linked list.
+	 */
+	if (conn_state && conn_state->content_protection == DRM_MODE_CONTENT_PROTECTION_ENABLED) {
+		conn_state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+
+		pr_debug("[HDCP_DM] display %d, CP 2 -> 1, type %u, DPMS %u\n",
+			 aconnector->base.index, conn_state->hdcp_content_type, aconnector->base.dpms);
+	}
+
 	mod_hdcp_remove_display(&hdcp_w->hdcp, aconnector->base.index, &hdcp_w->output);
 
 	process_output(hdcp_w);
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author Reviewed-by Dingchen Zhang Acked-by on v1 13/19
#14 lore raw

Re: [PATCH 13/19] drm/amd/display: force CP to DESIRED when removing display.

[AMD Official Use Only - Internal Distribution Only]

This patch introduces a null pointer deref on MST hotplug, so this shall be dropped.

--

Thanks & Regards,
Aurabindo Pillai
________________________________
From: Aurabindo Pillai <[email protected]>
Sent: Friday, April 16, 2021 10:34 AM
To: [email protected] <[email protected]>
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing <[email protected]>; Brol, Eryk <[email protected]>; R, Bindu <[email protected]>; Jacob, Anson <[email protected]>; Zhang, Dingchen (David) <[email protected]>; Zhang, Dingchen (David) <[email protected]>
Subject: [PATCH 13/19] drm/amd/display: force CP to DESIRED when removing display.

From: "Dingchen (David) Zhang" <[email protected]>

[why]
It is possible that the commit from userspace to cause link stream disable and hdcp auth reset when the HDCP has been enabled at the moment. We'd expect the CP prop back to DESIRED from ENABLED.

[how]
In the helper of hdcp display removal, we check and change the CP prop to DESIRED if at the moment CP is ENABLED before the auth reset and removal of linked list element.

---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c  | 13 +++++++++++++
 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +13 -0
index 616f5b1ea3a8..50f6b3a86931 100644
@@ -160,6 +160,7 @@ static void link_lock(struct hdcp_workqueue *work, bool lock)
                         mutex_unlock(&work[i].mutex);
         }
 }
+
 void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
                          unsigned int link_index,
                          struct amdgpu_dm_connector *aconnector,
@@ -222,10 +223,22 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
                          struct amdgpu_dm_connector *aconnector)
 {
         struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index];
+       struct drm_connector_state *conn_state = aconnector->base.state;
 
         mutex_lock(&hdcp_w->mutex);
         hdcp_w->aconnector = aconnector;
 
+       /* the removal of display will invoke auth reset -> hdcp destroy and
+        * we'd expect the CP prop changed back to DESIRED if at the time ENABLED.
+        * the CP prop change should occur before the element removed from linked list.
+        */
+       if (conn_state && conn_state->content_protection == DRM_MODE_CONTENT_PROTECTION_ENABLED) {
+               conn_state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
+
+               pr_debug("[HDCP_DM] display %d, CP 2 -> 1, type %u, DPMS %u\n",
+                        aconnector->base.index, conn_state->hdcp_content_type, aconnector->base.dpms);
+       }
+
         mod_hdcp_remove_display(&hdcp_w->hdcp, aconnector->base.index, &hdcp_w->output);
 
         process_output(hdcp_w);

--
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#15 lore raw

PATCH 14/19 drm/amd/display: fix HDCP drm prop update for MST

In reply to Aurabindo Pillai

From: "Dingchen (David) Zhang" <[email protected]>

[why]
For MST topology with 1 physical link and multiple connectors (>=2), e.g. daisy cahined MST + SST, or 1-to-multi MST hub, if userspace set to enable the HDCP simultaneously on all connected outputs, the commit tail iteratively call the hdcp_update_display() for each display (connector). However, the hdcp workqueue data structure for each link has only one DM connector and encryption status members, which means the work queue of property_validate/update() would only be triggered for the last connector within this physical link, and therefore the HDCP property value of other connectors would stay on DESIRED instead of switching to ENABLED, which is NOT as expected.

[how]
Use array of MAX_NUM_OF_DISPLAY for both aconnector and encryption status in hdcp workqueue data structure for each physical link. For property validate/update work queue, we iterates over the array and do similar operation/check for each connected display.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    | 109 +++++++++++++-----
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.h    |   6 +-
 2 files changed, 81 insertions(+), 34 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +78 -31
index 50f6b3a86931..2ec076af9e89 100644
@@ -171,9 +171,10 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
 	struct mod_hdcp_display *display = &hdcp_work[link_index].display;
 	struct mod_hdcp_link *link = &hdcp_work[link_index].link;
 	struct mod_hdcp_display_query query;
+	unsigned int conn_index = aconnector->base.index;
 
 	mutex_lock(&hdcp_w->mutex);
-	hdcp_w->aconnector = aconnector;
+	hdcp_w->aconnector[conn_index] = aconnector;
 
 	query.display = NULL;
 	mod_hdcp_query_display(&hdcp_w->hdcp, aconnector->base.index, &query);
@@ -205,7 +206,7 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
 					      msecs_to_jiffies(DRM_HDCP_CHECK_PERIOD_MS));
 		} else {
 			display->adjust.disable = MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION;
-			hdcp_w->encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+			hdcp_w->encryption_status[conn_index] = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
 			cancel_delayed_work(&hdcp_w->property_validate_dwork);
 		}
 
@@ -224,9 +225,10 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
 {
 	struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index];
 	struct drm_connector_state *conn_state = aconnector->base.state;
+	unsigned int conn_index = aconnector->base.index;
 
 	mutex_lock(&hdcp_w->mutex);
-	hdcp_w->aconnector = aconnector;
+	hdcp_w->aconnector[conn_index] = aconnector;
 
 	/* the removal of display will invoke auth reset -> hdcp destroy and
 	 * we'd expect the CP prop changed back to DESIRED if at the time ENABLED.
@@ -247,13 +249,16 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
 void hdcp_reset_display(struct hdcp_workqueue *hdcp_work, unsigned int link_index)
 {
 	struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index];
+	unsigned int conn_index;
 
 	mutex_lock(&hdcp_w->mutex);
 
 	mod_hdcp_reset_connection(&hdcp_w->hdcp,  &hdcp_w->output);
 
 	cancel_delayed_work(&hdcp_w->property_validate_dwork);
-	hdcp_w->encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+
+	for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index)
+		hdcp_w->encryption_status[conn_index] = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
 
 	process_output(hdcp_w);
 
@@ -290,38 +295,67 @@ static void event_callback(struct work_struct *work)
 
 
 }
+
+static struct amdgpu_dm_connector *find_first_connected_output(struct hdcp_workqueue *hdcp_work)
+{
+	unsigned int conn_index;
+
+	for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index) {
+		if (hdcp_work->aconnector[conn_index])
+			return hdcp_work->aconnector[conn_index];
+	}
+
+	return NULL;
+}
+
 static void event_property_update(struct work_struct *work)
 {
 
 	struct hdcp_workqueue *hdcp_work = container_of(work, struct hdcp_workqueue, property_update_work);
-	struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
-	struct drm_device *dev = hdcp_work->aconnector->base.dev;
+	struct amdgpu_dm_connector *aconnector = find_first_connected_output(hdcp_work);
+	struct drm_device *dev;
 	long ret;
+	unsigned int conn_index;
+	struct drm_connector *connector;
+	struct drm_connector_state *conn_state;
+
+	if (!aconnector)
+		return;
+
+	dev = aconnector->base.dev;
 
 	drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
 	mutex_lock(&hdcp_work->mutex);
 
+	for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index) {
+		aconnector = hdcp_work->aconnector[conn_index];
+
+		if (!aconnector)
+			continue;
 
-	if (aconnector->base.state->commit) {
-		ret = wait_for_completion_interruptible_timeout(&aconnector->base.state->commit->hw_done, 10 * HZ);
+		connector = &aconnector->base;
+		conn_state = aconnector->base.state;
+		if (conn_state->commit) {
+			ret = wait_for_completion_interruptible_timeout(&conn_state->commit->hw_done, 10 * HZ);
 
-		if (ret == 0) {
-			DRM_ERROR("HDCP state unknown! Setting it to DESIRED");
-			hdcp_work->encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+			if (ret == 0) {
+				DRM_ERROR("HDCP state unknown! Setting it to DESIRED");
+				hdcp_work->encryption_status[conn_index] = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+			}
 		}
-	}
 
-	if (hdcp_work->encryption_status != MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF) {
-		if (aconnector->base.state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE0 &&
-		    hdcp_work->encryption_status <= MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE0_ON)
-			drm_hdcp_update_content_protection(&aconnector->base, DRM_MODE_CONTENT_PROTECTION_ENABLED);
-		else if (aconnector->base.state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE1 &&
-			 hdcp_work->encryption_status == MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE1_ON)
-			drm_hdcp_update_content_protection(&aconnector->base, DRM_MODE_CONTENT_PROTECTION_ENABLED);
-	} else {
-		drm_hdcp_update_content_protection(&aconnector->base, DRM_MODE_CONTENT_PROTECTION_DESIRED);
-	}
+		if (hdcp_work->encryption_status[conn_index] != MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF) {
+			if (conn_state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE0 &&
+			    hdcp_work->encryption_status[conn_index] <= MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE0_ON)
+				drm_hdcp_update_content_protection(connector, DRM_MODE_CONTENT_PROTECTION_ENABLED);
+			else if (conn_state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE1 &&
+				 hdcp_work->encryption_status[conn_index] == MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE1_ON)
+				drm_hdcp_update_content_protection(connector, DRM_MODE_CONTENT_PROTECTION_ENABLED);
+		} else {
+			drm_hdcp_update_content_protection(connector, DRM_MODE_CONTENT_PROTECTION_DESIRED);
+		}
 
+	}
 
 	mutex_unlock(&hdcp_work->mutex);
 	drm_modeset_unlock(&dev->mode_config.connection_mutex);
@@ -332,19 +366,28 @@ static void event_property_validate(struct work_struct *work)
 	struct hdcp_workqueue *hdcp_work =
 		container_of(to_delayed_work(work), struct hdcp_workqueue, property_validate_dwork);
 	struct mod_hdcp_display_query query;
-	struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
-
-	if (!aconnector)
-		return;
+	struct amdgpu_dm_connector *aconnector;
+	unsigned int conn_index;
 
 	mutex_lock(&hdcp_work->mutex);
 
-	query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
-	mod_hdcp_query_display(&hdcp_work->hdcp, aconnector->base.index, &query);
+	for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index) {
+		aconnector = hdcp_work->aconnector[conn_index];
+
+		if (!aconnector)
+			continue;
+
+		query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+		mod_hdcp_query_display(&hdcp_work->hdcp, aconnector->base.index, &query);
 
-	if (query.encryption_status != hdcp_work->encryption_status) {
-		hdcp_work->encryption_status = query.encryption_status;
-		schedule_work(&hdcp_work->property_update_work);
+		pr_debug("[HDCP_DM] display %d, CP %u, (query->enc_st, work->enc_st): (%d, %d)\n",
+			 aconnector->base.index, aconnector->base.state->content_protection,
+			 query.encryption_status, hdcp_work->encryption_status[conn_index]);
+
+		if (query.encryption_status != hdcp_work->encryption_status[conn_index]) {
+			hdcp_work->encryption_status[conn_index] = query.encryption_status;
+			schedule_work(&hdcp_work->property_update_work);
+		}
 	}
 
 	mutex_unlock(&hdcp_work->mutex);
@@ -655,6 +698,10 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct
 		hdcp_work[i].hdcp.config.ddc.funcs.read_i2c = lp_read_i2c;
 		hdcp_work[i].hdcp.config.ddc.funcs.write_dpcd = lp_write_dpcd;
 		hdcp_work[i].hdcp.config.ddc.funcs.read_dpcd = lp_read_dpcd;
+
+		memset(hdcp_work[i].aconnector, 0, sizeof(struct amdgpu_dm_connector *) * MAX_NUM_OF_DISPLAYS);
+		memset(hdcp_work[i].encryption_status, 0,
+			sizeof(enum mod_hdcp_encryption_status) * MAX_NUM_OF_DISPLAYS);
 	}
 
 	cp_psp->funcs.update_stream_config = update_config;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.h +3 -3
index 09294ff122fe..570863160d60 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019 Advanced Micro Devices, Inc.
+ * Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -43,7 +43,7 @@ struct hdcp_workqueue {
 	struct delayed_work callback_dwork;
 	struct delayed_work watchdog_timer_dwork;
 	struct delayed_work property_validate_dwork;
-	struct amdgpu_dm_connector *aconnector;
+	struct amdgpu_dm_connector *aconnector[MAX_NUM_OF_DISPLAYS];
 	struct mutex mutex;
 
 	struct mod_hdcp hdcp;
@@ -51,7 +51,7 @@ struct hdcp_workqueue {
 	struct mod_hdcp_display display;
 	struct mod_hdcp_link link;
 
-	enum mod_hdcp_encryption_status encryption_status;
+	enum mod_hdcp_encryption_status encryption_status[MAX_NUM_OF_DISPLAYS];
 	uint8_t max_link;
 
 	uint8_t *srm;
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author Reviewed-by Dingchen Zhang Acked-by on v1 14/19
#16 lore raw

Re: [PATCH 14/19] drm/amd/display: fix HDCP drm prop update for MST

[AMD Official Use Only - Internal Distribution Only]

This patch is a related change for the MST null pointer deref regression, so will be dropped.

--

Thanks & Regards,
Aurabindo Pillai
________________________________
From: Aurabindo Pillai <[email protected]>
Sent: Friday, April 16, 2021 10:34 AM
To: [email protected] <[email protected]>
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing <[email protected]>; Brol, Eryk <[email protected]>; R, Bindu <[email protected]>; Jacob, Anson <[email protected]>; Zhang, Dingchen (David) <[email protected]>; Zhang, Dingchen (David) <[email protected]>
Subject: [PATCH 14/19] drm/amd/display: fix HDCP drm prop update for MST

From: "Dingchen (David) Zhang" <[email protected]>

[why]
For MST topology with 1 physical link and multiple connectors (>=2), e.g. daisy cahined MST + SST, or 1-to-multi MST hub, if userspace set to enable the HDCP simultaneously on all connected outputs, the commit tail iteratively call the hdcp_update_display() for each display (connector). However, the hdcp workqueue data structure for each link has only one DM connector and encryption status members, which means the work queue of property_validate/update() would only be triggered for the last connector within this physical link, and therefore the HDCP property value of other connectors would stay on DESIRED instead of switching to ENABLED, which is NOT as expected.

[how]
Use array of MAX_NUM_OF_DISPLAY for both aconnector and encryption status in hdcp workqueue data structure for each physical link. For property validate/update work queue, we iterates over the array and do similar operation/check for each connected display.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    | 109 +++++++++++++-----
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.h    |   6 +-
 2 files changed, 81 insertions(+), 34 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c +78 -31
index 50f6b3a86931..2ec076af9e89 100644
@@ -171,9 +171,10 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
         struct mod_hdcp_display *display = &hdcp_work[link_index].display;
         struct mod_hdcp_link *link = &hdcp_work[link_index].link;
         struct mod_hdcp_display_query query;
+       unsigned int conn_index = aconnector->base.index;
 
         mutex_lock(&hdcp_w->mutex);
-       hdcp_w->aconnector = aconnector;
+       hdcp_w->aconnector[conn_index] = aconnector;
 
         query.display = NULL;
         mod_hdcp_query_display(&hdcp_w->hdcp, aconnector->base.index, &query);
@@ -205,7 +206,7 @@ void hdcp_update_display(struct hdcp_workqueue *hdcp_work,
                                               msecs_to_jiffies(DRM_HDCP_CHECK_PERIOD_MS));
                 } else {
                         display->adjust.disable = MOD_HDCP_DISPLAY_DISABLE_AUTHENTICATION;
-                       hdcp_w->encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+                       hdcp_w->encryption_status[conn_index] = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
                         cancel_delayed_work(&hdcp_w->property_validate_dwork);
                 }
 
@@ -224,9 +225,10 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
 {
         struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index];
         struct drm_connector_state *conn_state = aconnector->base.state;
+       unsigned int conn_index = aconnector->base.index;
 
         mutex_lock(&hdcp_w->mutex);
-       hdcp_w->aconnector = aconnector;
+       hdcp_w->aconnector[conn_index] = aconnector;
 
         /* the removal of display will invoke auth reset -> hdcp destroy and
          * we'd expect the CP prop changed back to DESIRED if at the time ENABLED.
@@ -247,13 +249,16 @@ static void hdcp_remove_display(struct hdcp_workqueue *hdcp_work,
 void hdcp_reset_display(struct hdcp_workqueue *hdcp_work, unsigned int link_index)
 {
         struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index];
+       unsigned int conn_index;
 
         mutex_lock(&hdcp_w->mutex);
 
         mod_hdcp_reset_connection(&hdcp_w->hdcp,  &hdcp_w->output);
 
         cancel_delayed_work(&hdcp_w->property_validate_dwork);
-       hdcp_w->encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+
+       for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index)
+               hdcp_w->encryption_status[conn_index] = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
 
         process_output(hdcp_w);
 
@@ -290,38 +295,67 @@ static void event_callback(struct work_struct *work)
 
 
 }
+
+static struct amdgpu_dm_connector *find_first_connected_output(struct hdcp_workqueue *hdcp_work)
+{
+       unsigned int conn_index;
+
+       for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index) {
+               if (hdcp_work->aconnector[conn_index])
+                       return hdcp_work->aconnector[conn_index];
+       }
+
+       return NULL;
+}
+
 static void event_property_update(struct work_struct *work)
 {
 
         struct hdcp_workqueue *hdcp_work = container_of(work, struct hdcp_workqueue, property_update_work);
-       struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
-       struct drm_device *dev = hdcp_work->aconnector->base.dev;
+       struct amdgpu_dm_connector *aconnector = find_first_connected_output(hdcp_work);
+       struct drm_device *dev;
         long ret;
+       unsigned int conn_index;
+       struct drm_connector *connector;
+       struct drm_connector_state *conn_state;
+
+       if (!aconnector)
+               return;
+
+       dev = aconnector->base.dev;
 
         drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
         mutex_lock(&hdcp_work->mutex);
 
+       for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index) {
+               aconnector = hdcp_work->aconnector[conn_index];
+
+               if (!aconnector)
+                       continue;
 
-       if (aconnector->base.state->commit) {
-               ret = wait_for_completion_interruptible_timeout(&aconnector->base.state->commit->hw_done, 10 * HZ);
+               connector = &aconnector->base;
+               conn_state = aconnector->base.state;
+               if (conn_state->commit) {
+                       ret = wait_for_completion_interruptible_timeout(&conn_state->commit->hw_done, 10 * HZ);
 
-               if (ret == 0) {
-                       DRM_ERROR("HDCP state unknown! Setting it to DESIRED");
-                       hdcp_work->encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+                       if (ret == 0) {
+                               DRM_ERROR("HDCP state unknown! Setting it to DESIRED");
+                               hdcp_work->encryption_status[conn_index] = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+                       }
                 }
-       }
 
-       if (hdcp_work->encryption_status != MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF) {
-               if (aconnector->base.state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE0 &&
-                   hdcp_work->encryption_status <= MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE0_ON)
-                       drm_hdcp_update_content_protection(&aconnector->base, DRM_MODE_CONTENT_PROTECTION_ENABLED);
-               else if (aconnector->base.state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE1 &&
-                        hdcp_work->encryption_status == MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE1_ON)
-                       drm_hdcp_update_content_protection(&aconnector->base, DRM_MODE_CONTENT_PROTECTION_ENABLED);
-       } else {
-               drm_hdcp_update_content_protection(&aconnector->base, DRM_MODE_CONTENT_PROTECTION_DESIRED);
-       }
+               if (hdcp_work->encryption_status[conn_index] != MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF) {
+                       if (conn_state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE0 &&
+                           hdcp_work->encryption_status[conn_index] <= MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE0_ON)
+                               drm_hdcp_update_content_protection(connector, DRM_MODE_CONTENT_PROTECTION_ENABLED);
+                       else if (conn_state->hdcp_content_type == DRM_MODE_HDCP_CONTENT_TYPE1 &&
+                                hdcp_work->encryption_status[conn_index] == MOD_HDCP_ENCRYPTION_STATUS_HDCP2_TYPE1_ON)
+                               drm_hdcp_update_content_protection(connector, DRM_MODE_CONTENT_PROTECTION_ENABLED);
+               } else {
+                       drm_hdcp_update_content_protection(connector, DRM_MODE_CONTENT_PROTECTION_DESIRED);
+               }
 
+       }
 
         mutex_unlock(&hdcp_work->mutex);
         drm_modeset_unlock(&dev->mode_config.connection_mutex);
@@ -332,19 +366,28 @@ static void event_property_validate(struct work_struct *work)
         struct hdcp_workqueue *hdcp_work =
                 container_of(to_delayed_work(work), struct hdcp_workqueue, property_validate_dwork);
         struct mod_hdcp_display_query query;
-       struct amdgpu_dm_connector *aconnector = hdcp_work->aconnector;
-
-       if (!aconnector)
-               return;
+       struct amdgpu_dm_connector *aconnector;
+       unsigned int conn_index;
 
         mutex_lock(&hdcp_work->mutex);
 
-       query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
-       mod_hdcp_query_display(&hdcp_work->hdcp, aconnector->base.index, &query);
+       for (conn_index = 0; conn_index < MAX_NUM_OF_DISPLAYS; ++conn_index) {
+               aconnector = hdcp_work->aconnector[conn_index];
+
+               if (!aconnector)
+                       continue;
+
+               query.encryption_status = MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF;
+               mod_hdcp_query_display(&hdcp_work->hdcp, aconnector->base.index, &query);
 
-       if (query.encryption_status != hdcp_work->encryption_status) {
-               hdcp_work->encryption_status = query.encryption_status;
-               schedule_work(&hdcp_work->property_update_work);
+               pr_debug("[HDCP_DM] display %d, CP %u, (query->enc_st, work->enc_st): (%d, %d)\n",
+                        aconnector->base.index, aconnector->base.state->content_protection,
+                        query.encryption_status, hdcp_work->encryption_status[conn_index]);
+
+               if (query.encryption_status != hdcp_work->encryption_status[conn_index]) {
+                       hdcp_work->encryption_status[conn_index] = query.encryption_status;
+                       schedule_work(&hdcp_work->property_update_work);
+               }
         }
 
         mutex_unlock(&hdcp_work->mutex);
@@ -655,6 +698,10 @@ struct hdcp_workqueue *hdcp_create_workqueue(struct amdgpu_device *adev, struct
                 hdcp_work[i].hdcp.config.ddc.funcs.read_i2c = lp_read_i2c;
                 hdcp_work[i].hdcp.config.ddc.funcs.write_dpcd = lp_write_dpcd;
                 hdcp_work[i].hdcp.config.ddc.funcs.read_dpcd = lp_read_dpcd;
+
+               memset(hdcp_work[i].aconnector, 0, sizeof(struct amdgpu_dm_connector *) * MAX_NUM_OF_DISPLAYS);
+               memset(hdcp_work[i].encryption_status, 0,
+                       sizeof(enum mod_hdcp_encryption_status) * MAX_NUM_OF_DISPLAYS);
         }
 
         cp_psp->funcs.update_stream_config = update_config;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.h +3 -3
index 09294ff122fe..570863160d60 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright 2019 Advanced Micro Devices, Inc.
+ * Copyright (C) 2019-2020 Advanced Micro Devices, Inc. All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -43,7 +43,7 @@ struct hdcp_workqueue {
         struct delayed_work callback_dwork;
         struct delayed_work watchdog_timer_dwork;
         struct delayed_work property_validate_dwork;
-       struct amdgpu_dm_connector *aconnector;
+       struct amdgpu_dm_connector *aconnector[MAX_NUM_OF_DISPLAYS];
         struct mutex mutex;
 
         struct mod_hdcp hdcp;
@@ -51,7 +51,7 @@ struct hdcp_workqueue {
         struct mod_hdcp_display display;
         struct mod_hdcp_link link;
 
-       enum mod_hdcp_encryption_status encryption_status;
+       enum mod_hdcp_encryption_status encryption_status[MAX_NUM_OF_DISPLAYS];
         uint8_t max_link;
 
         uint8_t *srm;

--
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#17 lore raw

PATCH 15/19 drm/amd/display: Fix call to pass bpp in 16ths of a bit

In reply to Aurabindo Pillai

From: Dillon Varone <[email protected]>

[Why & How?]
Call to dc_dsc_compute_bandwidth_range should have min and max bpp in 16ths of a bit. Multiply min and max bpp from policy.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +2 -2
index 73cdb9fe981a..b23f7d6a1409 100644
@@ -745,8 +745,8 @@ static bool compute_mst_dsc_configs_for_link(struct drm_atomic_state *state,
 		if (!dc_dsc_compute_bandwidth_range(
 				stream->sink->ctx->dc->res_pool->dscs[0],
 				stream->sink->ctx->dc->debug.dsc_min_slice_height_override,
-				dsc_policy.min_target_bpp,
-				dsc_policy.max_target_bpp,
+				dsc_policy.min_target_bpp * 16,
+				dsc_policy.max_target_bpp * 16,
 				&stream->sink->dsc_caps.dsc_dec_caps,
 				&stream->timing, &params[count].bw_range))
 			params[count].bw_range.stream_kbps = dc_bandwidth_in_kbps_from_timing(&stream->timing);
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#18 lore raw

PATCH 16/19 drm/amd/display: Report Proper Quantization Range in AVI Infoframe

In reply to Aurabindo Pillai

From: Dillon Varone <[email protected]>

[Why?]
When a monitor does not set both QS and QY bits, DC does not set Q0, Q1, QY0 and QY1 bits in AVI infoframe. Setting RGB bits should be separate from setting YCC bits.

[How?]
Separate logic for setting RGB and YCC quantization range bits in the AVI infoframe.

---
 .../gpu/drm/amd/display/dc/core/dc_resource.c | 33 +++++++++++--------
 1 file changed, 19 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +19 -14
index ac7a75887f95..8cb937c046aa 100644
@@ -2506,26 +2506,31 @@ static void set_avi_info_frame(
 		hdmi_info.bits.ITC = itc_value;
 	}
 
+	if (stream->qs_bit == 1) {
+		if (color_space == COLOR_SPACE_SRGB ||
+			color_space == COLOR_SPACE_2020_RGB_FULLRANGE)
+			hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_FULL_RANGE;
+		else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
+					color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE)
+			hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_LIMITED_RANGE;
+		else
+			hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_DEFAULT_RANGE;
+	} else
+		hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_DEFAULT_RANGE;
+
 	/* TODO : We should handle YCC quantization */
 	/* but we do not have matrix calculation */
-	if (stream->qs_bit == 1 &&
-			stream->qy_bit == 1) {
+	if (stream->qy_bit == 1) {
 		if (color_space == COLOR_SPACE_SRGB ||
-			color_space == COLOR_SPACE_2020_RGB_FULLRANGE) {
-			hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_FULL_RANGE;
+			color_space == COLOR_SPACE_2020_RGB_FULLRANGE)
 			hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-		} else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
-					color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE) {
-			hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_LIMITED_RANGE;
+		else if (color_space == COLOR_SPACE_SRGB_LIMITED ||
+					color_space == COLOR_SPACE_2020_RGB_LIMITEDRANGE)
 			hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-		} else {
-			hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_DEFAULT_RANGE;
+		else
 			hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
-		}
-	} else {
-		hdmi_info.bits.Q0_Q1   = RGB_QUANTIZATION_DEFAULT_RANGE;
-		hdmi_info.bits.YQ0_YQ1   = YYC_QUANTIZATION_LIMITED_RANGE;
-	}
+	} else
+		hdmi_info.bits.YQ0_YQ1 = YYC_QUANTIZATION_LIMITED_RANGE;
 
 	///VIC
 	format = stream->timing.timing_3d_format;
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#19 lore raw

PATCH 17/19 drm/amd/display: add helper for enabling mst stream features

In reply to Aurabindo Pillai

From: Bing Guo <[email protected]>

[Why]
Some MST devices uses different method to enable mst specific stream features.

[How]
Add dm_helpers_mst_enable_stream features. This can be modified later when we are ready to implement those features.

---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 25 +++++++++++++++++
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 28 +++++++++++--------
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 ++
 3 files changed, 44 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +25 -0
index 103e29905b57..e8b325a828c1 100644
@@ -711,3 +711,28 @@ bool dm_helpers_dmub_outbox0_interrupt_control(struct dc_context *ctx, bool enab
 			 enable ? "en" : "dis", ret);
 	return ret;
 }
+
+void dm_helpers_mst_enable_stream_features(const struct dc_stream_state *stream)
+{
+	/* TODO: virtual DPCD */
+	struct dc_link *link = stream->link;
+	union down_spread_ctrl old_downspread;
+	union down_spread_ctrl new_downspread;
+
+	if (link->aux_access_disabled)
+		return;
+
+	if (!dm_helpers_dp_read_dpcd(link->ctx, link, DP_DOWNSPREAD_CTRL,
+				     &old_downspread.raw,
+				     sizeof(old_downspread)))
+		return;
+
+	new_downspread.raw = old_downspread.raw;
+	new_downspread.bits.IGNORE_MSA_TIMING_PARAM =
+		(stream->ignore_msa_timing_param) ? 1 : 0;
+
+	if (new_downspread.raw != old_downspread.raw)
+		dm_helpers_dp_write_dpcd(link->ctx, link, DP_DOWNSPREAD_CTRL,
+					 &new_downspread.raw,
+					 sizeof(new_downspread));
+}
drivers/gpu/drm/amd/display/dc/core/dc_link.c +17 -11
index fa384923cfc1..f4374d83662a 100644
@@ -1679,21 +1679,27 @@ void link_destroy(struct dc_link **link)
 static void enable_stream_features(struct pipe_ctx *pipe_ctx)
 {
 	struct dc_stream_state *stream = pipe_ctx->stream;
-	struct dc_link *link = stream->link;
-	union down_spread_ctrl old_downspread;
-	union down_spread_ctrl new_downspread;
 
-	core_link_read_dpcd(link, DP_DOWNSPREAD_CTRL,
-			&old_downspread.raw, sizeof(old_downspread));
+	if (pipe_ctx->stream->signal != SIGNAL_TYPE_DISPLAY_PORT_MST) {
+		struct dc_link *link = stream->link;
+		union down_spread_ctrl old_downspread;
+		union down_spread_ctrl new_downspread;
+
+		core_link_read_dpcd(link, DP_DOWNSPREAD_CTRL,
+				&old_downspread.raw, sizeof(old_downspread));
 
-	new_downspread.raw = old_downspread.raw;
+		new_downspread.raw = old_downspread.raw;
 
-	new_downspread.bits.IGNORE_MSA_TIMING_PARAM =
-			(stream->ignore_msa_timing_param) ? 1 : 0;
+		new_downspread.bits.IGNORE_MSA_TIMING_PARAM =
+				(stream->ignore_msa_timing_param) ? 1 : 0;
 
-	if (new_downspread.raw != old_downspread.raw) {
-		core_link_write_dpcd(link, DP_DOWNSPREAD_CTRL,
-			&new_downspread.raw, sizeof(new_downspread));
+		if (new_downspread.raw != old_downspread.raw) {
+			core_link_write_dpcd(link, DP_DOWNSPREAD_CTRL,
+				&new_downspread.raw, sizeof(new_downspread));
+		}
+
+	} else {
+		dm_helpers_mst_enable_stream_features(stream);
 	}
 }
 
drivers/gpu/drm/amd/display/dc/dm_helpers.h +2 -0
index f41db27c44de..7617fab9e1f9 100644
@@ -147,6 +147,8 @@ bool dm_helpers_dp_write_dsc_enable(
 bool dm_helpers_is_dp_sink_present(
 		struct dc_link *link);
 
+void dm_helpers_mst_enable_stream_features(const struct dc_stream_state *stream);
+
 enum dc_edid_status dm_helpers_read_local_edid(
 		struct dc_context *ctx,
 		struct dc_link *link,
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#20 lore raw

PATCH 18/19 drm/amd/display: [FW Promotion] Release 0.0.62

In reply to Aurabindo Pillai

From: Anthony Koo <[email protected]>

---
 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +2 -2
index ba93e139a47e..4195ff10c514 100644
@@ -47,10 +47,10 @@
 
 /* Firmware versioning. */
 #ifdef DMUB_EXPOSE_VERSION
-#define DMUB_FW_VERSION_GIT_HASH 0xcf6f1711c
+#define DMUB_FW_VERSION_GIT_HASH 0x23db9b126
 #define DMUB_FW_VERSION_MAJOR 0
 #define DMUB_FW_VERSION_MINOR 0
-#define DMUB_FW_VERSION_REVISION 61
+#define DMUB_FW_VERSION_REVISION 62
 #define DMUB_FW_VERSION_TEST 0
 #define DMUB_FW_VERSION_VBIOS 0
 #define DMUB_FW_VERSION_HOTFIX 0
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#21 lore raw

PATCH 19/19 drm/amd/display: 3.2.132

In reply to Aurabindo Pillai

From: Aric Cyr <[email protected]>

---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
index ed19b9b39af0..100d434f7a03 100644
@@ -45,7 +45,7 @@
 /* forward declaration */
 struct aux_payload;
 
-#define DC_VER "3.2.131"
+#define DC_VER "3.2.132"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
Signature · 6 lines
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Tested-by on the v1 series
#22 lore raw
In reply to Aurabindo Pillai

[AMD Official Use Only - Internal Distribution Only]

Hi all,

This week this patchset was tested on a HP Envy 360, with Ryzen 5 4500U, on the following display types: eDP 1080p 60hz, 4k 60hz (via USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI), 1680*1050 60hz (via USB-C to DP and then DP to DVI/VGA)
Tested on a Sapphire Pulse RX5700XT on the following display types:
4k 60hz (via DP/HDMI), 1440p 144hz (via DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)

Also tested on a Reference AMD RX6800 on the following display types:
4k 60hz (via DP/HDMI and USB-C to DP/HDMI), 1440p 144hz (via USB-C to DP/HDMI and USB-C to DP/HDMI), 1680*1050 60hz (via DP to DVI/VGA)

Tested using a Startech MST hub at 2x 4k 60hz on all systems, using DP.

We have noticed a regression on the RX6800 that points to these patches, and as such they have been dropped from this patchset:
drm/amd/display: force CP to DESIRED when removing display.
drm/amd/display: fix HDCP drm prop update for MST


Thank you,

Dan Wheeler
Technologist | AMD
SW Display------------------------------------------------------------------------------------------------------------------ 1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook |  Twitter |  amd.com

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Aurabindo Pillai
Sent: April 16, 2021 10:34 AM
To: [email protected]
Cc: Brol, Eryk <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing <[email protected]>; Siqueira, Rodrigo <[email protected]>; Jacob, Anson <[email protected]>; Pillai, Aurabindo <[email protected]>; Lakha, Bhawanpreet <[email protected]>; R, Bindu <[email protected]>
Subject: [PATCH 00/19] DC Patches for 2021 April 19

This DC patchset brings improvements in multiple areas. In summary, we highlight:

* DC v3.2.132
* Fw v0.0.62
* Bug fixes across HDCP, DSC, FreeSync, etc

--

Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.62

Anthony Wang (2):
drm/amd/display: Add DSC check to seamless boot validation drm/amd/display: disable seamless boot for external DP

Aric Cyr (2):
drm/amd/display: Fix FreeSync when RGB MPO in use drm/amd/display: 3.2.132

Bing Guo (1):
drm/amd/display: add helper for enabling mst stream features

David Galiffi (1):
drm/amd/display: Fixed typo in function name.

Dillon Varone (2):
drm/amd/display: Fix call to pass bpp in 16ths of a bit drm/amd/display: Report Proper Quantization Range in AVI Infoframe

Dingchen (David) Zhang (4):
drm/amd/display: update hdcp display using correct CP type. drm/amd/display: add handling for hdcp2 rx id list validation drm/amd/display: force CP to DESIRED when removing display. drm/amd/display: fix HDCP drm prop update for MST

Hugo Hu (1):
drm/amd/display: treat memory as a single-channel for asymmetric
memory v2

Michael Strauss (1):
drm/amd/display: Add link rate optimization logs for ILR

Nicholas Kazlauskas (1):
drm/amd/display: Always poll for rxstatus in authenticate

Robin Singh (2):
drm/amd/display: fixed divide by zero kernel crash during dsc
enablement
drm/amd/display: removed unused function
dc_link_reallocate_mst_payload.

Wesley Chalmers (1):
drm/amd/display: Unconditionally clear training pattern set after lt

 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.c    | 130 +++++++++++++-----
 .../amd/display/amdgpu_dm/amdgpu_dm_hdcp.h    |   6 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c |  25 ++++
 .../display/amdgpu_dm/amdgpu_dm_mst_types.c   |   4 +-
 .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c |  48 ++++++-
 .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c  |   4 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c      |  15 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c |  72 +++-------  .../gpu/drm/amd/display/dc/core/dc_link_dp.c  |  18 ++-  .../gpu/drm/amd/display/dc/core/dc_resource.c |  33 +++--
 drivers/gpu/drm/amd/display/dc/dc.h           |   6 +-
 drivers/gpu/drm/amd/display/dc/dc_link.h      |   1 -
 .../display/dc/dce110/dce110_hw_sequencer.c   |   4 +
 .../gpu/drm/amd/display/dc/dcn20/dcn20_hubp.c |  15 +-
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |   2 +
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h   |   4 +-
 .../display/modules/hdcp/hdcp1_execution.c    |   2 -
 .../display/modules/hdcp/hdcp2_execution.c    |   2 -
 .../drm/amd/display/modules/hdcp/hdcp_psp.c   |   2 +
 19 files changed, 257 insertions(+), 136 deletions(-)

--
2.31.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cdaniel.wheeler%40amd.com%7C0a93a7750f574b38722e08d900e4bbbe%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637541804686826849%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=kxcn%2FAwrz%2F9fKJdhEww0DPlQZUysvci5nxxE%2Fj5eGfQ%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx