All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] DC Patches April 26, 2023
@ 2023-04-26 16:27 Alan Liu
  2023-04-26 16:27 ` [PATCH 1/8] drm/amd/display: Workaround wrong HDR colorimetry with some receivers Alan Liu
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, solomon.chiu, Daniel Wheeler,
	Aurabindo.Pillai, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.165.0
- Add w/a to disable DP dual mode on certain ports
- Revert "Update scaler recout data for visual confirm"
- Filter out invalid bits in pipe_fuses
- Adding debug option to override Z8 watermark values
- Change default Z8 watermark values
- Workaround wrong HDR colorimetry with some receivers

Cc: Daniel Wheeler <daniel.wheeler@amd.com>

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

Aric Cyr (1):
  drm/amd/display: 3.2.234

George Shen (1):
  drm/amd/display: Add w/a to disable DP dual mode on certain ports

Ilya Bakoulin (1):
  drm/amd/display: Workaround wrong HDR colorimetry with some receivers

Leo Chen (2):
  drm/amd/display: Change default Z8 watermark values
  drm/amd/display: Adding debug option to override Z8 watermark values

Leo Ma (1):
  drm/amd/display: revert "Update scaler recout data for visual confirm"

Samson Tam (1):
  drm/amd/display: filter out invalid bits in pipe_fuses

 drivers/gpu/drm/amd/display/dc/core/dc.c       |  7 +++++++
 .../gpu/drm/amd/display/dc/core/dc_resource.c  | 17 -----------------
 drivers/gpu/drm/amd/display/dc/dc.h            |  8 +++++++-
 .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  | 18 +++++++++++++++++-
 .../drm/amd/display/dc/dcn32/dcn32_resource.c  | 11 ++++++++++-
 .../amd/display/dc/dcn321/dcn321_resource.c    | 10 +++++++++-
 .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c   | 11 +++++++++++
 .../drm/amd/display/dc/dml/dcn314/dcn314_fpu.c |  4 ++--
 .../drm/amd/display/dc/link/link_detection.c   |  4 ++++
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h    | 10 +++++++++-
 10 files changed, 76 insertions(+), 24 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/8] drm/amd/display: Workaround wrong HDR colorimetry with some receivers
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
@ 2023-04-26 16:27 ` Alan Liu
  2023-04-26 16:27   ` Alan Liu
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Ilya Bakoulin, Aric Cyr, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, Alan Liu,
	solomon.chiu, Aurabindo.Pillai, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Ilya Bakoulin <Ilya.Bakoulin@amd.com>

[Why]
Some scalers do not pick up color space updates unless the DP link
is disabled/re-enabled which can result in incorrect/washed out
HDR colors in some cases.

[How]
Call set_dpms_on to disable the link, re-train and re-enable with the
updated output color space.

Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Ilya Bakoulin <Ilya.Bakoulin@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 7 +++++++
 drivers/gpu/drm/amd/display/dc/dc.h      | 1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 1fe040544051..7b68ff0f9c4a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3268,6 +3268,13 @@ static void commit_planes_do_stream_update(struct dc *dc,
 						dc->hwss.prepare_bandwidth(dc, dc->current_state);
 					dc->link_srv->set_dpms_on(dc->current_state, pipe_ctx);
 				}
+			} else if (pipe_ctx->stream->link->wa_flags.blank_stream_on_ocs_change && stream_update->output_color_space
+					&& !stream->dpms_off && dc_is_dp_signal(pipe_ctx->stream->signal)) {
+				/*
+				 * Workaround for firmware issue in some receivers where they don't pick up
+				 * correct output color space unless DP link is disabled/re-enabled
+				 */
+				dc->link_srv->set_dpms_on(dc->current_state, pipe_ctx);
 			}
 
 			if (stream_update->abm_level && pipe_ctx->stream_res.abm) {
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 4424e7abb801..892e3adb99d9 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -1506,6 +1506,7 @@ struct dc_link {
 		/* Forced DPIA into TBT3 compatibility mode. */
 		bool dpia_forced_tbt3_mode;
 		bool dongle_mode_timing_override;
+		bool blank_stream_on_ocs_change;
 	} wa_flags;
 	struct link_mst_stream_allocation_table mst_stream_alloc_table;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/8] drm/amd/display: Change default Z8 watermark values
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
@ 2023-04-26 16:27   ` Alan Liu
  2023-04-26 16:27   ` Alan Liu
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: Harry.Wentland, Sunpeng.Li, Bhawanpreet.Lakha, Rodrigo.Siqueira,
	Aurabindo.Pillai, qingqing.zhuo, roman.li, wayne.lin,
	stylon.wang, solomon.chiu, pavle.kotarac, agustin.gutierrez,
	Leo Chen, Nicholas Kazlauskas, Mario Limonciello, Alex Deucher,
	stable, Alan Liu

From: Leo Chen <sancchen@amd.com>

[Why & How]
Previous Z8 watermark values were causing flickering and OTC underflow.
Updating Z8 watermark values based on the measurement.

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Leo Chen <sancchen@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
index 19370b872a91..1d00eb9e73c6 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
@@ -149,8 +149,8 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc = {
 	.num_states = 5,
 	.sr_exit_time_us = 16.5,
 	.sr_enter_plus_exit_time_us = 18.5,
-	.sr_exit_z8_time_us = 210.0,
-	.sr_enter_plus_exit_z8_time_us = 310.0,
+	.sr_exit_z8_time_us = 268.0,
+	.sr_enter_plus_exit_z8_time_us = 393.0,
 	.writeback_latency_us = 12.0,
 	.dram_channel_width_bytes = 4,
 	.round_trip_ping_latency_dcfclk_cycles = 106,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/8] drm/amd/display: Change default Z8 watermark values
@ 2023-04-26 16:27   ` Alan Liu
  0 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, stable, Nicholas Kazlauskas,
	solomon.chiu, Aurabindo.Pillai, Mario Limonciello, wayne.lin,
	Alex Deucher, Bhawanpreet.Lakha, Leo Chen, agustin.gutierrez,
	pavle.kotarac

From: Leo Chen <sancchen@amd.com>

[Why & How]
Previous Z8 watermark values were causing flickering and OTC underflow.
Updating Z8 watermark values based on the measurement.

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Leo Chen <sancchen@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
index 19370b872a91..1d00eb9e73c6 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c
@@ -149,8 +149,8 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc = {
 	.num_states = 5,
 	.sr_exit_time_us = 16.5,
 	.sr_enter_plus_exit_time_us = 18.5,
-	.sr_exit_z8_time_us = 210.0,
-	.sr_enter_plus_exit_z8_time_us = 310.0,
+	.sr_exit_z8_time_us = 268.0,
+	.sr_enter_plus_exit_z8_time_us = 393.0,
 	.writeback_latency_us = 12.0,
 	.dram_channel_width_bytes = 4,
 	.round_trip_ping_latency_dcfclk_cycles = 106,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/8] drm/amd/display: Adding debug option to override Z8 watermark values
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
  2023-04-26 16:27 ` [PATCH 1/8] drm/amd/display: Workaround wrong HDR colorimetry with some receivers Alan Liu
  2023-04-26 16:27   ` Alan Liu
@ 2023-04-26 16:27 ` Alan Liu
  2023-04-26 16:27 ` [PATCH 4/8] drm/amd/display: filter out invalid bits in pipe_fuses Alan Liu
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Nicholas Kazlauskas, solomon.chiu,
	Aurabindo.Pillai, wayne.lin, Bhawanpreet.Lakha, Leo Chen,
	agustin.gutierrez, pavle.kotarac

From: Leo Chen <sancchen@amd.com>

[Why & How]
Adding debug options to override Z8 watermark values for testing purposes.

Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Leo Chen <sancchen@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc.h                  |  4 ++++
 drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 892e3adb99d9..fea68383bb61 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -700,6 +700,8 @@ struct dc_virtual_addr_space_config {
 struct dc_bounding_box_overrides {
 	int sr_exit_time_ns;
 	int sr_enter_plus_exit_time_ns;
+	int sr_exit_z8_time_ns;
+	int sr_enter_plus_exit_z8_time_ns;
 	int urgent_latency_ns;
 	int percent_of_ideal_drambw;
 	int dram_clock_change_latency_ns;
@@ -769,6 +771,8 @@ struct dc_debug_options {
 	int sr_enter_plus_exit_time_dpm0_ns;
 	int sr_exit_time_ns;
 	int sr_enter_plus_exit_time_ns;
+	int sr_exit_z8_time_ns;
+	int sr_enter_plus_exit_z8_time_ns;
 	int urgent_latency_ns;
 	uint32_t underflow_assert_delay_us;
 	int percent_of_ideal_drambw;
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
index a5b1e4bb1a22..3407f9a2c6a1 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c
@@ -1890,6 +1890,17 @@ void dcn20_patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st
 				dc->bb_overrides.sr_enter_plus_exit_time_ns / 1000.0;
 	}
 
+	if ((int)(bb->sr_exit_z8_time_us * 1000)
+				!= dc->bb_overrides.sr_exit_z8_time_ns
+			&& dc->bb_overrides.sr_exit_z8_time_ns) {
+		bb->sr_exit_z8_time_us = dc->bb_overrides.sr_exit_z8_time_ns / 1000.0;
+	}
+
+	if ((int)(bb->sr_enter_plus_exit_z8_time_us * 1000)
+				!= dc->bb_overrides.sr_enter_plus_exit_z8_time_ns
+			&& dc->bb_overrides.sr_enter_plus_exit_z8_time_ns) {
+		bb->sr_enter_plus_exit_z8_time_us = dc->bb_overrides.sr_enter_plus_exit_z8_time_ns / 1000.0;
+	}
 	if ((int)(bb->urgent_latency_us * 1000) != dc->bb_overrides.urgent_latency_ns
 			&& dc->bb_overrides.urgent_latency_ns) {
 		bb->urgent_latency_us = dc->bb_overrides.urgent_latency_ns / 1000.0;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/8] drm/amd/display: filter out invalid bits in pipe_fuses
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
                   ` (2 preceding siblings ...)
  2023-04-26 16:27 ` [PATCH 3/8] drm/amd/display: Adding debug option to override " Alan Liu
@ 2023-04-26 16:27 ` Alan Liu
  2023-04-26 16:27 ` [PATCH 5/8] drm/amd/display: revert "Update scaler recout data for visual confirm" Alan Liu
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Rodrigo.Siqueira, roman.li, Samson Tam, solomon.chiu,
	Aurabindo.Pillai, Alvin Lee, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Samson Tam <Samson.Tam@amd.com>

[Why]
Reading pipe_fuses from register may have invalid bits set, which may
 affect the num_pipes erroneously.

[How]
Add read_pipes_fuses() call and filter bits based on expected number
 of pipes.

Reviewed-by: Alvin Lee <Alvin.Lee2@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Samson Tam <Samson.Tam@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c  | 10 +++++++++-
 .../gpu/drm/amd/display/dc/dcn321/dcn321_resource.c    | 10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
index 7feeba78c0c9..a49323885874 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
@@ -2082,6 +2082,14 @@ static struct resource_funcs dcn32_res_pool_funcs = {
 	.restore_mall_state = dcn32_restore_mall_state,
 };
 
+static uint32_t read_pipe_fuses(struct dc_context *ctx)
+{
+	uint32_t value = REG_READ(CC_DC_PIPE_DIS);
+	/* DCN32 support max 4 pipes */
+	value = value & 0xf;
+	return value;
+}
+
 
 static bool dcn32_resource_construct(
 	uint8_t num_virtual_links,
@@ -2125,7 +2133,7 @@ static bool dcn32_resource_construct(
 	pool->base.res_cap = &res_cap_dcn32;
 	/* max number of pipes for ASIC before checking for pipe fuses */
 	num_pipes  = pool->base.res_cap->num_timing_generator;
-	pipe_fuses = REG_READ(CC_DC_PIPE_DIS);
+	pipe_fuses = read_pipe_fuses(ctx);
 
 	for (i = 0; i < pool->base.res_cap->num_timing_generator; i++)
 		if (pipe_fuses & 1 << i)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c b/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c
index 63bd6928c82f..4c1e0f5a5f09 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c
@@ -1633,6 +1633,14 @@ static struct resource_funcs dcn321_res_pool_funcs = {
 	.restore_mall_state = dcn32_restore_mall_state,
 };
 
+static uint32_t read_pipe_fuses(struct dc_context *ctx)
+{
+	uint32_t value = REG_READ(CC_DC_PIPE_DIS);
+	/* DCN321 support max 4 pipes */
+	value = value & 0xf;
+	return value;
+}
+
 
 static bool dcn321_resource_construct(
 	uint8_t num_virtual_links,
@@ -1675,7 +1683,7 @@ static bool dcn321_resource_construct(
 	pool->base.res_cap = &res_cap_dcn321;
 	/* max number of pipes for ASIC before checking for pipe fuses */
 	num_pipes  = pool->base.res_cap->num_timing_generator;
-	pipe_fuses = REG_READ(CC_DC_PIPE_DIS);
+	pipe_fuses = read_pipe_fuses(ctx);
 
 	for (i = 0; i < pool->base.res_cap->num_timing_generator; i++)
 		if (pipe_fuses & 1 << i)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/8] drm/amd/display: revert "Update scaler recout data for visual confirm"
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
                   ` (3 preceding siblings ...)
  2023-04-26 16:27 ` [PATCH 4/8] drm/amd/display: filter out invalid bits in pipe_fuses Alan Liu
@ 2023-04-26 16:27 ` Alan Liu
  2023-04-26 16:27 ` [PATCH 6/8] drm/amd/display: Add w/a to disable DP dual mode on certain ports Alan Liu
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	Martin Leung, Rodrigo.Siqueira, roman.li, solomon.chiu,
	Aurabindo.Pillai, wayne.lin, Leo Ma, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Leo Ma <hanghong.ma@amd.com>

This reverts commit 8552024d1e2a008b6df544845d09120cfea9508b.

A regression is found on this change, so revert it for the time being
and resubmit when issue is fixed.

Reviewed-by: Martin Leung <Martin.Leung@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Leo Ma <hanghong.ma@amd.com>
---
 .../gpu/drm/amd/display/dc/core/dc_resource.c  | 17 -----------------
 .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  | 18 +++++++++++++++++-
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 193e09b05f5a..7e1e5532f88f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -69,9 +69,6 @@
 #include "../dcn32/dcn32_resource.h"
 #include "../dcn321/dcn321_resource.h"
 
-#define VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT 3
-#define VISUAL_CONFIRM_RECT_HEIGHT_MIN 1
-#define VISUAL_CONFIRM_RECT_HEIGHT_MAX 10
 
 #define DC_LOGGER_INIT(logger)
 
@@ -811,8 +808,6 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)
 	struct rect surf_clip = plane_state->clip_rect;
 	bool split_tb = stream->view_format == VIEW_3D_FORMAT_TOP_AND_BOTTOM;
 	int split_count, split_idx;
-	struct dpp *dpp = pipe_ctx->plane_res.dpp;
-	unsigned short visual_confirm_rect_height = VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT;
 
 	calculate_split_count_and_index(pipe_ctx, &split_count, &split_idx);
 	if (stream->view_format == VIEW_3D_FORMAT_SIDE_BY_SIDE)
@@ -881,18 +876,6 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)
 				data->recout.width = data->h_active - data->recout.x;
 		}
 	}
-
-	/* Check bounds to ensure the VC bar height was set to a sane value */
-	if (dpp != NULL) {
-		if ((dpp->ctx->dc->debug.visual_confirm_rect_height >= VISUAL_CONFIRM_RECT_HEIGHT_MIN) &&
-			(dpp->ctx->dc->debug.visual_confirm_rect_height <= VISUAL_CONFIRM_RECT_HEIGHT_MAX)) {
-			visual_confirm_rect_height = dpp->ctx->dc->debug.visual_confirm_rect_height;
-		}
-
-		if (dpp->ctx->dc->debug.visual_confirm != VISUAL_CONFIRM_DISABLE)
-			data->recout.height = data->recout.height -
-					2 * (dpp->inst + visual_confirm_rect_height);
-	}
 }
 
 static void calculate_scaling_ratios(struct pipe_ctx *pipe_ctx)
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
index 7e140c35a0ce..b33955928bd0 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c
@@ -39,6 +39,9 @@
 #define BLACK_OFFSET_RGB_Y 0x0
 #define BLACK_OFFSET_CBCR  0x8000
 
+#define VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT 3
+#define VISUAL_CONFIRM_RECT_HEIGHT_MIN 1
+#define VISUAL_CONFIRM_RECT_HEIGHT_MAX 10
 
 #define REG(reg)\
 	dpp->tf_regs->reg
@@ -588,6 +591,18 @@ static void dpp1_dscl_set_manual_ratio_init(
 static void dpp1_dscl_set_recout(struct dcn10_dpp *dpp,
 				 const struct rect *recout)
 {
+	int visual_confirm_on = 0;
+	unsigned short visual_confirm_rect_height = VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT;
+
+	if (dpp->base.ctx->dc->debug.visual_confirm != VISUAL_CONFIRM_DISABLE)
+		visual_confirm_on = 1;
+
+	/* Check bounds to ensure the VC bar height was set to a sane value */
+	if ((dpp->base.ctx->dc->debug.visual_confirm_rect_height >= VISUAL_CONFIRM_RECT_HEIGHT_MIN) &&
+			(dpp->base.ctx->dc->debug.visual_confirm_rect_height <= VISUAL_CONFIRM_RECT_HEIGHT_MAX)) {
+		visual_confirm_rect_height = dpp->base.ctx->dc->debug.visual_confirm_rect_height;
+	}
+
 	REG_SET_2(RECOUT_START, 0,
 		  /* First pixel of RECOUT in the active OTG area */
 		  RECOUT_START_X, recout->x,
@@ -598,7 +613,8 @@ static void dpp1_dscl_set_recout(struct dcn10_dpp *dpp,
 		  /* Number of RECOUT horizontal pixels */
 		  RECOUT_WIDTH, recout->width,
 		  /* Number of RECOUT vertical lines */
-		  RECOUT_HEIGHT, recout->height);
+		  RECOUT_HEIGHT, recout->height
+			 - visual_confirm_on * 2 * (dpp->base.inst + visual_confirm_rect_height));
 }
 
 /**
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/8] drm/amd/display: Add w/a to disable DP dual mode on certain ports
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
                   ` (4 preceding siblings ...)
  2023-04-26 16:27 ` [PATCH 5/8] drm/amd/display: revert "Update scaler recout data for visual confirm" Alan Liu
@ 2023-04-26 16:27 ` Alan Liu
  2023-04-26 16:27 ` [PATCH 7/8] drm/amd/display: [FW Promotion] Release 0.0.165.0 Alan Liu
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Sunpeng.Li, Harry.Wentland, qingqing.zhuo,
	George Shen, Rodrigo.Siqueira, roman.li, solomon.chiu,
	Aurabindo.Pillai, Michael Strauss, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: George Shen <george.shen@amd.com>

[Why]
Certain ports on DCN3.2 configs do not properly populate the BIOS
info table flag to indicate DP dual mode is unsupported.

[How]
Add a workaround to disable DP dual mode on the ports with the missing
BIOS info table flag.

Reviewed-by: Michael Strauss <Michael.Strauss@amd.com>
Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: George Shen <george.shen@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc.h                   | 1 +
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 1 +
 drivers/gpu/drm/amd/display/dc/link/link_detection.c  | 4 ++++
 3 files changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index fea68383bb61..fe60816653d0 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -887,6 +887,7 @@ struct dc_debug_options {
 	bool override_odm_optimization;
 	bool minimize_dispclk_using_odm;
 	bool disable_subvp_high_refresh;
+	bool disable_dp_plus_plus_wa;
 };
 
 struct gpu_info_soc_bounding_box_v1_0;
diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
index a49323885874..4de2f8813dce 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c
@@ -729,6 +729,7 @@ static const struct dc_debug_options debug_defaults_drv = {
 	.disable_fpo_vactive = false,
 	.disable_boot_optimizations = false,
 	.disable_subvp_high_refresh = true,
+	.disable_dp_plus_plus_wa = true,
 };
 
 static const struct dc_debug_options debug_defaults_diags = {
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
index a131e30fd7d6..17904de4f155 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
@@ -593,6 +593,10 @@ static bool detect_dp(struct dc_link *link,
 			/* DP SST branch */
 			link->type = dc_connection_sst_branch;
 	} else {
+		if (link->dc->debug.disable_dp_plus_plus_wa &&
+				link->link_enc->features.flags.bits.IS_UHBR20_CAPABLE)
+			return false;
+
 		/* DP passive dongles */
 		sink_caps->signal = dp_passive_dongle_detection(link->ddc,
 								sink_caps,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 7/8] drm/amd/display: [FW Promotion] Release 0.0.165.0
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
                   ` (5 preceding siblings ...)
  2023-04-26 16:27 ` [PATCH 6/8] drm/amd/display: Add w/a to disable DP dual mode on certain ports Alan Liu
@ 2023-04-26 16:27 ` Alan Liu
  2023-04-26 16:27 ` [PATCH 8/8] drm/amd/display: 3.2.234 Alan Liu
  2023-05-01 15:16 ` [PATCH 0/8] DC Patches April 26, 2023 Wheeler, Daniel
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Anthony Koo, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	Aurabindo.Pillai, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Anthony Koo <Anthony.Koo@amd.com>

- Add dmub boot options to disable ips states on init

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
---
 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
index 09d4d0d9b92c..af1f50742371 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -398,6 +398,12 @@ enum dmub_lvtma_status_bit {
 	DMUB_LVTMA_STATUS_BIT_EDP_ON = (1 << 1),
 };
 
+enum dmub_ips_disable_type {
+	DMUB_IPS_DISABLE_IPS1 = 1,
+	DMUB_IPS_DISABLE_IPS2 = 2,
+	DMUB_IPS_DISABLE_IPS2_Z10 = 3,
+};
+
 /**
  * union dmub_fw_boot_options - Boot option definitions for SCRATCH14
  */
@@ -423,7 +429,9 @@ union dmub_fw_boot_options {
 		uint32_t usb4_dpia_bw_alloc_supported: 1; /* 1 if USB4 dpia BW allocation supported */
 		uint32_t disable_clk_ds: 1; /* 1 if disallow dispclk_ds and dppclk_ds*/
 		uint32_t disable_timeout_recovery : 1; /* 1 if timeout recovery should be disabled */
-		uint32_t reserved : 13; /**< reserved */
+		uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/
+		uint32_t ips_disable: 2; /* options to disable ips support*/
+		uint32_t reserved : 10; /**< reserved */
 	} bits; /**< boot bits */
 	uint32_t all; /**< 32-bit access to bits */
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 8/8] drm/amd/display: 3.2.234
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
                   ` (6 preceding siblings ...)
  2023-04-26 16:27 ` [PATCH 7/8] drm/amd/display: [FW Promotion] Release 0.0.165.0 Alan Liu
@ 2023-04-26 16:27 ` Alan Liu
  2023-05-01 15:16 ` [PATCH 0/8] DC Patches April 26, 2023 Wheeler, Daniel
  8 siblings, 0 replies; 11+ messages in thread
From: Alan Liu @ 2023-04-26 16:27 UTC (permalink / raw)
  To: amd-gfx
  Cc: stylon.wang, Alan Liu, Aric Cyr, Sunpeng.Li, Harry.Wentland,
	qingqing.zhuo, Rodrigo.Siqueira, roman.li, solomon.chiu,
	Aurabindo.Pillai, wayne.lin, Bhawanpreet.Lakha,
	agustin.gutierrez, pavle.kotarac

From: Aric Cyr <aric.cyr@amd.com>

This version brings along following fixes:
- FW Release 0.0.165.0
- Add w/a to disable DP dual mode on certain ports
- Revert "Update scaler recout data for visual confirm"
- Filter out invalid bits in pipe_fuses
- Adding debug option to override Z8 watermark values
- Change default Z8 watermark values
- Workaround wrong HDR colorimetry with some receivers

Acked-by: Alan Liu <HaoPing.Liu@amd.com>
Signed-off-by: Aric Cyr <aric.cyr@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index fe60816653d0..7e3f20a3a02f 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -45,7 +45,7 @@ struct aux_payload;
 struct set_config_cmd_payload;
 struct dmub_notification;
 
-#define DC_VER "3.2.233"
+#define DC_VER "3.2.234"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* RE: [PATCH 0/8] DC Patches April 26, 2023
  2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
                   ` (7 preceding siblings ...)
  2023-04-26 16:27 ` [PATCH 8/8] drm/amd/display: 3.2.234 Alan Liu
@ 2023-05-01 15:16 ` Wheeler, Daniel
  8 siblings, 0 replies; 11+ messages in thread
From: Wheeler, Daniel @ 2023-05-01 15:16 UTC (permalink / raw)
  To: Liu, HaoPing (Alan), amd-gfx
  Cc: Wang, Chao-kai (Stylon), Liu, HaoPing (Alan), Li, Sun peng (Leo),
	Wentland, Harry, Zhuo, Qingqing (Lillian),
	Siqueira, Rodrigo, Li, Roman, Chiu,  Solomon, Pillai, Aurabindo,
	Lin, Wayne, Lakha, Bhawanpreet, Gutierrez, Agustin, Kotarac,
	Pavle

[Public]

Hi all,
 
This week this patchset was tested on the following systems:
 
Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U 
Lenovo Thinkpad T13s Gen4 with AMD Ryzen 5 6600U
Reference AMD RX6800
 
These systems were tested on the following display types: 
eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U])
VGA and DVI (1680x1050 60HZ [DP to VGA/DVI, USB-C to DVI/VGA])
DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz [Includes USB-C to DP/HDMI adapters])
 
MST tested with Startech MST14DP123DP and 2x 4k 60Hz displays
DSC tested with Cable Matters 101075 (DP to 3x DP), and 201375 (USB-C to 3x DP) with 3x 4k60 displays
HP Hook G2 with 1 and 2 4k60 Displays
 
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
Changing display configurations and settings
Benchmark testing
Feature testing (Freesync, etc.)
 
Automated testing includes (but is not limited to):
Script testing (scripts to automate some of the manual checks)
IGT testing
 
The patchset consists of the amd-staging-drm-next branch (Head commit - f53eb9bfc5d7 BACKPORT: ASoC: SOF: fix compilation issue with readb/writeb helper) with new patches added on top of it. This branch is used for both Ubuntu and Chrome OS testing (ChromeOS on a bi-weekly basis).
 
 
Tested on Ubuntu 22.04.1 and Chrome OS
 
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
 
 
Thank you,
 
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com

-----Original Message-----
From: Alan Liu <HaoPing.Liu@amd.com> 
Sent: April 26, 2023 12:27 PM
To: amd-gfx@lists.freedesktop.org
Cc: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Siqueira, Rodrigo <Rodrigo.Siqueira@amd.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com>; Zhuo, Qingqing (Lillian) <Qingqing.Zhuo@amd.com>; Li, Roman <Roman.Li@amd.com>; Lin, Wayne <Wayne.Lin@amd.com>; Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Chiu, Solomon <Solomon.Chiu@amd.com>; Kotarac, Pavle <Pavle.Kotarac@amd.com>; Gutierrez, Agustin <Agustin.Gutierrez@amd.com>; Liu, HaoPing (Alan) <HaoPing.Liu@amd.com>; Wheeler, Daniel <Daniel.Wheeler@amd.com>
Subject: [PATCH 0/8] DC Patches April 26, 2023

This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.165.0
- Add w/a to disable DP dual mode on certain ports
- Revert "Update scaler recout data for visual confirm"
- Filter out invalid bits in pipe_fuses
- Adding debug option to override Z8 watermark values
- Change default Z8 watermark values
- Workaround wrong HDR colorimetry with some receivers

Cc: Daniel Wheeler <daniel.wheeler@amd.com>

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

Aric Cyr (1):
  drm/amd/display: 3.2.234

George Shen (1):
  drm/amd/display: Add w/a to disable DP dual mode on certain ports

Ilya Bakoulin (1):
  drm/amd/display: Workaround wrong HDR colorimetry with some receivers

Leo Chen (2):
  drm/amd/display: Change default Z8 watermark values
  drm/amd/display: Adding debug option to override Z8 watermark values

Leo Ma (1):
  drm/amd/display: revert "Update scaler recout data for visual confirm"

Samson Tam (1):
  drm/amd/display: filter out invalid bits in pipe_fuses

 drivers/gpu/drm/amd/display/dc/core/dc.c       |  7 +++++++
 .../gpu/drm/amd/display/dc/core/dc_resource.c  | 17 -----------------
 drivers/gpu/drm/amd/display/dc/dc.h            |  8 +++++++-
 .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c  | 18 +++++++++++++++++-  .../drm/amd/display/dc/dcn32/dcn32_resource.c  | 11 ++++++++++-
 .../amd/display/dc/dcn321/dcn321_resource.c    | 10 +++++++++-
 .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c   | 11 +++++++++++
 .../drm/amd/display/dc/dml/dcn314/dcn314_fpu.c |  4 ++--
 .../drm/amd/display/dc/link/link_detection.c   |  4 ++++
 .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h    | 10 +++++++++-
 10 files changed, 76 insertions(+), 24 deletions(-)

--
2.34.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-01 15:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 16:27 [PATCH 0/8] DC Patches April 26, 2023 Alan Liu
2023-04-26 16:27 ` [PATCH 1/8] drm/amd/display: Workaround wrong HDR colorimetry with some receivers Alan Liu
2023-04-26 16:27 ` [PATCH 2/8] drm/amd/display: Change default Z8 watermark values Alan Liu
2023-04-26 16:27   ` Alan Liu
2023-04-26 16:27 ` [PATCH 3/8] drm/amd/display: Adding debug option to override " Alan Liu
2023-04-26 16:27 ` [PATCH 4/8] drm/amd/display: filter out invalid bits in pipe_fuses Alan Liu
2023-04-26 16:27 ` [PATCH 5/8] drm/amd/display: revert "Update scaler recout data for visual confirm" Alan Liu
2023-04-26 16:27 ` [PATCH 6/8] drm/amd/display: Add w/a to disable DP dual mode on certain ports Alan Liu
2023-04-26 16:27 ` [PATCH 7/8] drm/amd/display: [FW Promotion] Release 0.0.165.0 Alan Liu
2023-04-26 16:27 ` [PATCH 8/8] drm/amd/display: 3.2.234 Alan Liu
2023-05-01 15:16 ` [PATCH 0/8] DC Patches April 26, 2023 Wheeler, Daniel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.