Skip to contentSkip to conversation

DC Patches for July 31, 2023

PATCH In review Aurabindo Pillai 3 participants 11 messages Jul 26, 2023 – Aug 29, 2023

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

cover DC Patches for July 31, 2023

This DC patchset is rather small. In summary, we have:

* Fix for warning with MST hardware and IGT test failure
* Correct sequence for enabling/disable symclk
* Some code cleanups

===========================

Alvin Lee (1):
drm/amd/display: Implement interface for notify cursor support change

Aric Cyr (1):
drm/amd/display: Promote DC to 2.3.245

Aurabindo Pillai (1):
Revert "drm/amd/display: Implement zpos property"

Fangzhi Zuo (1):
drm/amd/display: Temporary Disable MST DP Colorspace Property

Joshua Aberback (1):
drm/amd/display: Clean up flip pending timeout handling

Taimur Hassan (2):
drm/amd/display: Add symclk enable/disable during stream
enable/disable
drm/amd/display: Fix typo in enable and disable symclk_se

 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  2 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_plane.c   |  9 --------
 drivers/gpu/drm/amd/display/dc/core/dc.c      | 14 +++++++++++
 drivers/gpu/drm/amd/display/dc/dc.h           | 12 +++++++++-
 .../display/dc/dce110/dce110_hw_sequencer.c   |  6 ++++-
 .../drm/amd/display/dc/dcn20/dcn20_hwseq.c    | 23 +++++++++++--------
 drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h  | 10 ++++++++
 .../amd/display/dc/inc/hw/stream_encoder.h    |  1 +
 .../amd/display/dc/link/hwss/link_hwss_dio.c  |  3 +++
 9 files changed, 59 insertions(+), 21 deletions(-)
Signature · 1 line
2.41.0
#1 lore raw

PATCH 1/7 drm/amd/display: Add symclk enable/disable during stream enable/disable

From: Taimur Hassan <[email protected]>

[Why & How]
Using dig_stream_mapper, program symclk_en and symclk_fe_src_sel when enabling or disabling the corresponding stream.

---
 .../gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c  | 4 +++-
 drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c       | 6 +++++-
 drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h             | 9 +++++++++
 drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h   | 1 +
 drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c | 3 +++
 5 files changed, 21 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -1
index 20d4d08a6a2f..1eb4f884e5bb 100644
@@ -1150,6 +1150,7 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 	struct timing_generator *tg = pipe_ctx->stream_res.tg;
 	struct dtbclk_dto_params dto_params = {0};
 	int dp_hpo_inst;
+	struct stream_encoder *stream_enc = pipe_ctx->stream_res.stream_enc;
 
 	if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal)) {
 		pipe_ctx->stream_res.stream_enc->funcs->stop_hdmi_info_packets(
@@ -1176,7 +1177,8 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 		dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
 		dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
 		dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
-	}
+	} else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST && dccg->funcs->disable_symclk_se)
+		dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst);
 
 	if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
 		/* TODO: This looks like a bug to me as we are disabling HPO IO when
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +5 -1
index e32d3246e82a..e0a73d99b784 100644
@@ -2719,6 +2719,8 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx)
 	struct dce_hwseq *hws = dc->hwseq;
 	unsigned int k1_div = PIXEL_RATE_DIV_NA;
 	unsigned int k2_div = PIXEL_RATE_DIV_NA;
+	struct link_encoder *link_enc = link_enc_cfg_get_link_enc(pipe_ctx->stream->link);
+	struct stream_encoder *stream_enc = pipe_ctx->stream_res.stream_enc;
 
 	if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
 		if (dc->hwseq->funcs.setup_hpo_hw_control)
@@ -2738,7 +2740,9 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx)
 		dto_params.timing = &pipe_ctx->stream->timing;
 		dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency(dc->clk_mgr);
 		dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
-	}
+	} else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST && dccg->funcs->enable_symclk_se)
+		dccg->funcs->enable_symclk_se(dccg,
+			stream_enc->stream_enc_inst, link_enc->transmitter - TRANSMITTER_UNIPHY_A);
 
 	if (hws->funcs.calculate_dccg_k1_k2_values && dc->res_pool->dccg->funcs->set_pixel_rate_div) {
 		hws->funcs.calculate_dccg_k1_k2_values(pipe_ctx, &k1_div, &k2_div);
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +9 -0
index 93592281de32..c378cb287a3a 100644
@@ -172,6 +172,15 @@ struct dccg_funcs {
 			struct dccg *dccg,
 			unsigned int dpp_inst,
 			bool clock_on);
+
+	void (*enable_symclk_se)(
+			struct dccg *dccg,
+			uint32_t stream_enc_inst,
+			uint32_t link_enc_inst);
+
+	void (*disable_symclk_se)(
+			struct dccg *dccg,
+			uint32_t stream_enc_inst);
 };
 
 #endif //__DAL_DCCG_H__
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +1 -0
index c4fbbf08ef86..a6dedf3c7d74 100644
@@ -269,6 +269,7 @@ struct stream_encoder_funcs {
 		struct stream_encoder *enc, unsigned int pix_per_container);
 	void (*enable_fifo)(struct stream_encoder *enc);
 	void (*disable_fifo)(struct stream_encoder *enc);
+	void (*map_stream_to_link)(struct stream_encoder *enc, uint32_t stream_enc_inst, uint32_t link_enc_inst);
 };
 
 struct hpo_dp_stream_encoder_state {
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_dio.c +3 -0
index bebf9c4c8702..d19a0a958fbb 100644
@@ -46,6 +46,9 @@ void setup_dio_stream_encoder(struct pipe_ctx *pipe_ctx)
 	if (dc_is_dp_signal(pipe_ctx->stream->signal))
 		pipe_ctx->stream->ctx->dc->link_srv->dp_trace_source_sequence(pipe_ctx->stream->link,
 				DPCD_SOURCE_SEQ_AFTER_CONNECT_DIG_FE_BE);
+	if (stream_enc->funcs->map_stream_to_link)
+		stream_enc->funcs->map_stream_to_link(stream_enc,
+				stream_enc->stream_enc_inst, link_enc->transmitter - TRANSMITTER_UNIPHY_A);
 	if (stream_enc->funcs->enable_fifo)
 		stream_enc->funcs->enable_fifo(stream_enc);
 }
Signature · 1 line
2.41.0
#2 lore raw

PATCH 2/7 drm/amd/display: Fix typo in enable and disable symclk_se

In reply to Aurabindo Pillai

From: Taimur Hassan <[email protected]>

[Why & How]
Symclk should be based on link_enc_inst, and symclk_fe_sel should be based on stream_enc_inst.

---
 drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +++-
 drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h                | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -1
index 1eb4f884e5bb..b4698108a7e9 100644
@@ -1150,6 +1150,7 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 	struct timing_generator *tg = pipe_ctx->stream_res.tg;
 	struct dtbclk_dto_params dto_params = {0};
 	int dp_hpo_inst;
+	struct link_encoder *link_enc = link_enc_cfg_get_link_enc(pipe_ctx->stream->link);
 	struct stream_encoder *stream_enc = pipe_ctx->stream_res.stream_enc;
 
 	if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal)) {
@@ -1178,7 +1179,8 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 		dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
 		dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
 	} else if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST && dccg->funcs->disable_symclk_se)
-		dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst);
+		dccg->funcs->disable_symclk_se(dccg, stream_enc->stream_enc_inst,
+				link_enc->transmitter - TRANSMITTER_UNIPHY_A);
 
 	if (dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
 		/* TODO: This looks like a bug to me as we are disabling HPO IO when
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +2 -1
index c378cb287a3a..3e2f0f64c98c 100644
@@ -180,7 +180,8 @@ struct dccg_funcs {
 
 	void (*disable_symclk_se)(
 			struct dccg *dccg,
-			uint32_t stream_enc_inst);
+			uint32_t stream_enc_inst,
+			uint32_t link_enc_inst);
 };
 
 #endif //__DAL_DCCG_H__
Signature · 1 line
2.41.0
#3 lore raw

PATCH 3/7 drm/amd/display: Clean up flip pending timeout handling

In reply to Aurabindo Pillai

From: Joshua Aberback <[email protected]>

[Why]
Adjust timeout handling code for easier runtime manipulation during debug. Change has no functional effect by default.

---
 .../gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c  | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +9 -8
index e0a73d99b784..fc1af33dbe3c 100644
@@ -1269,20 +1269,21 @@ void dcn20_pipe_control_lock(
 	}
 
 	if (flip_immediate && lock) {
-		const int TIMEOUT_FOR_FLIP_PENDING = 100000;
+		const int TIMEOUT_FOR_FLIP_PENDING_US = 100000;
+		unsigned int polling_interval_us = 1;
 		int i;
 
 		temp_pipe = pipe;
 		while (temp_pipe) {
 			if (temp_pipe->plane_state && temp_pipe->plane_state->flip_immediate) {
-				for (i = 0; i < TIMEOUT_FOR_FLIP_PENDING; ++i) {
+				for (i = 0; i < TIMEOUT_FOR_FLIP_PENDING_US / polling_interval_us; ++i) {
 					if (!temp_pipe->plane_res.hubp->funcs->hubp_is_flip_pending(temp_pipe->plane_res.hubp))
 						break;
-					udelay(1);
+					udelay(polling_interval_us);
 				}
 
 				/* no reason it should take this long for immediate flips */
-				ASSERT(i != TIMEOUT_FOR_FLIP_PENDING);
+				ASSERT(i != TIMEOUT_FOR_FLIP_PENDING_US);
 			}
 			temp_pipe = temp_pipe->bottom_pipe;
 		}
@@ -1952,7 +1953,8 @@ void dcn20_post_unlock_program_front_end(
 		struct dc_state *context)
 {
 	int i;
-	const unsigned int TIMEOUT_FOR_PIPE_ENABLE_MS = 100;
+	const unsigned int TIMEOUT_FOR_PIPE_ENABLE_US = 100000;
+	unsigned int polling_interval_us = 1;
 	struct dce_hwseq *hwseq = dc->hwseq;
 
 	DC_LOGGER_INIT(dc->ctx->logger);
@@ -1974,10 +1976,9 @@ void dcn20_post_unlock_program_front_end(
 				pipe->stream->mall_stream_config.type != SUBVP_PHANTOM) {
 			struct hubp *hubp = pipe->plane_res.hubp;
 			int j = 0;
-
-			for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_MS*1000
+			for (j = 0; j < TIMEOUT_FOR_PIPE_ENABLE_US / polling_interval_us
 					&& hubp->funcs->hubp_is_flip_pending(hubp); j++)
-				udelay(1);
+				udelay(polling_interval_us);
 		}
 	}
 
Signature · 1 line
2.41.0
#4 lore raw

PATCH 4/7 drm/amd/display: Temporary Disable MST DP Colorspace Property

In reply to Aurabindo Pillai

From: Fangzhi Zuo <[email protected]>

Create MST colorsapce property for downstream device would trigger warning message "RIP: 0010:drm_mode_object_add+0x8e/0xa0 [drm]"

After driver is loaded and drm device is registered, create dp colorspace property triggers warning storm at WARN_ON(!dev->driver->load && dev->registered && !obj_free_cb);

Temporary disabling MST dp colorspace property for now.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index 77d970a2ee69..f88a7c0ce8f3 100644
@@ -7309,7 +7309,7 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm,
 	if (connector_type == DRM_MODE_CONNECTOR_HDMIA) {
 		if (!drm_mode_create_hdmi_colorspace_property(&aconnector->base, supported_colorspaces))
 			drm_connector_attach_colorspace_property(&aconnector->base);
-	} else if (connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
+	} else if ((connector_type == DRM_MODE_CONNECTOR_DisplayPort && !aconnector->mst_root) ||
 		   connector_type == DRM_MODE_CONNECTOR_eDP) {
 		if (!drm_mode_create_dp_colorspace_property(&aconnector->base, supported_colorspaces))
 			drm_connector_attach_colorspace_property(&aconnector->base);
Signature · 1 line
2.41.0
#5 lore raw

PATCH 5/7 drm/amd/display: Implement interface for notify cursor support change

In reply to Aurabindo Pillai

From: Alvin Lee <[email protected]>

[Description]
Add new interface for notifying OS of cursor support changes

---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 14 ++++++++++++++
 drivers/gpu/drm/amd/display/dc/dc.h      | 10 ++++++++++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +14 -0
index 7cac14f493f6..dfd31b169412 100644
@@ -5337,3 +5337,17 @@ bool dc_abm_save_restore(
 	return false;
 }
 
+void dc_query_current_properties(struct dc *dc, struct dc_current_properties *properties)
+{
+	unsigned int i;
+	bool subvp_in_use = false;
+
+	for (i = 0; i < dc->current_state->stream_count; i++) {
+		if (dc->current_state->streams[i]->mall_stream_config.type != SUBVP_NONE) {
+			subvp_in_use = true;
+			break;
+		}
+	}
+	properties->cursor_size_limit = subvp_in_use ? 64 : dc->caps.max_cursor_size;
+}
+
drivers/gpu/drm/amd/display/dc/dc.h +10 -0
index eadb53853131..0b704f1a32a6 100644
@@ -908,6 +908,14 @@ struct dc_debug_options {
 };
 
 struct gpu_info_soc_bounding_box_v1_0;
+
+/* Generic structure that can be used to query properties of DC. More fields
+ * can be added as required.
+ */
+struct dc_current_properties {
+	unsigned int cursor_size_limit;
+};
+
 struct dc {
 	struct dc_debug_options debug;
 	struct dc_versions versions;
@@ -2276,6 +2284,8 @@ void dc_process_dmub_dpia_hpd_int_enable(const struct dc *dc,
 
 void dc_print_dmub_diagnostic_data(const struct dc *dc);
 
+void dc_query_current_properties(struct dc *dc, struct dc_current_properties *properties);
+
 /* DSC Interfaces */
 #include "dc_dsc.h"
 
Signature · 1 line
2.41.0
#6 lore raw

PATCH 6/7 Revert "drm/amd/display: Implement zpos property"

In reply to Aurabindo Pillai

This reverts commit 6c8ff1683d30024c8cff137d30b740a405cc084e.

This patch causes IGT test case 'kms_atomic@plane-immutable-zpos' to fail on AMDGPU hardware.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -9
index 2198df96ed6f..8eeca160d434 100644
@@ -1468,15 +1468,6 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
 		drm_plane_create_blend_mode_property(plane, blend_caps);
 	}
 
-	if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
-		drm_plane_create_zpos_immutable_property(plane, 0);
-	} else if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
-		unsigned int zpos = 1 + drm_plane_index(plane);
-		drm_plane_create_zpos_property(plane, zpos, 1, 254);
-	} else if (plane->type == DRM_PLANE_TYPE_CURSOR) {
-		drm_plane_create_zpos_immutable_property(plane, 255);
-	}
-
 	if (plane->type == DRM_PLANE_TYPE_PRIMARY &&
 	    plane_cap &&
 	    (plane_cap->pixel_format_support.nv12 ||
Signature · 1 line
2.41.0
#7 lore raw

Re: [PATCH 6/7] Revert "drm/amd/display: Implement zpos property"

Quoted 17 lines · Aurabindo Pillai

This reverts commit 6c8ff1683d30024c8cff137d30b740a405cc084e.

This patch causes IGT test case 'kms_atomic@plane-immutable-zpos' to fail on AMDGPU hardware.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
index 2198df96ed6f..8eeca160d434 100644
@@ -1468,15 +1468,6 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
 		drm_plane_create_blend_mode_property(plane, blend_caps);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1478

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -8
 	}
 
-	if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
-		drm_plane_create_zpos_immutable_property(plane, 0);
-	} else if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
-		unsigned int zpos = 1 + drm_plane_index(plane);
-		drm_plane_create_zpos_property(plane, zpos, 1, 254);
-	} else if (plane->type == DRM_PLANE_TYPE_CURSOR) {
-		drm_plane_create_zpos_immutable_property(plane, 255);
-	}

Hi Jay and Nicholas,

I'm examining this regression and, looking at the test code, I consider this failure is caused by an incorrect assumption in the IGT test in which any zpos values must be in the normalized range of 0 and N planes per CRTC.

	for (int k = 0; k < n_planes; k++) {
		int zpos;
		igt_plane_t *temp;

		temp = &display->pipes[pipe->pipe].planes[k];

		if (!igt_plane_has_prop(temp, IGT_PLANE_ZPOS))
			continue;

		zpos = igt_plane_get_prop(temp, IGT_PLANE_ZPOS);

		igt_assert_lt(zpos, n_planes);  // test case fails here

		plane_ptr[zpos] = temp;
	}

I didn't find anything in the DRM documentation that imposes this behavior. Also, the plane composition in the test is working correctly with this patch and without this likely-misleading assert. In addition, enabling zpos property increases the coverage of kms_atomic@plane-immutable-zpos test (previously this part of the test was just bypassed), so it's not a regression per se. Therefore, I'm inclined to send a fix to IGT, instead of implementing a behavior that fit the test but may not fit well AMD display machinery.

But first I wonder if you guys find any other test or visual check that fail with this feature?

I checked other IGT KMS plane tests and AMD MPO tests (in amd_plane) and results are preserved. If there are no other issues besides IGT plane-immutable-zpos, I'll proceed with sending the change to IGT.

Thanks,

Melissa

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -1
-
 	if (plane->type == DRM_PLANE_TYPE_PRIMARY &&
 	    plane_cap &&
 	    (plane_cap->pixel_format_support.nv12 ||
Signature · 1 line
2.41.0
maintainer
#8 lore raw

Re: [PATCH 6/7] Revert "drm/amd/display: Implement zpos property"

Quoted 65 lines · Melissa Wen
Quoted 17 lines · Aurabindo Pillai

This reverts commit 6c8ff1683d30024c8cff137d30b740a405cc084e.

This patch causes IGT test case 'kms_atomic@plane-immutable-zpos' to fail on AMDGPU hardware.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 9 ---------
  1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
index 2198df96ed6f..8eeca160d434 100644
@@ -1468,15 +1468,6 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
  		drm_plane_create_blend_mode_property(plane, blend_caps);

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1478

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -8
  	}
 
-	if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
-		drm_plane_create_zpos_immutable_property(plane, 0);
-	} else if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
-		unsigned int zpos = 1 + drm_plane_index(plane);
-		drm_plane_create_zpos_property(plane, zpos, 1, 254);
-	} else if (plane->type == DRM_PLANE_TYPE_CURSOR) {
-		drm_plane_create_zpos_immutable_property(plane, 255);
-	}

Hi Jay and Nicholas,

I'm examining this regression and, looking at the test code, I consider this failure is caused by an incorrect assumption in the IGT test in which any zpos values must be in the normalized range of 0 and N planes per CRTC.

	for (int k = 0; k < n_planes; k++) {
		int zpos;
		igt_plane_t *temp;

		temp = &display->pipes[pipe->pipe].planes[k];

		if (!igt_plane_has_prop(temp, IGT_PLANE_ZPOS))
			continue;

		zpos = igt_plane_get_prop(temp, IGT_PLANE_ZPOS);

		igt_assert_lt(zpos, n_planes);  // test case fails here

		plane_ptr[zpos] = temp;
	}

I didn't find anything in the DRM documentation that imposes this behavior. Also, the plane composition in the test is working correctly with this patch and without this likely-misleading assert. In addition, enabling zpos property increases the coverage of kms_atomic@plane-immutable-zpos test (previously this part of the test was just bypassed), so it's not a regression per se. Therefore, I'm inclined to send a fix to IGT, instead of implementing a behavior that fit the test but may not fit well AMD display machinery.

But first I wonder if you guys find any other test or visual check that fail with this feature?

Quoted 7 lines

I checked other IGT KMS plane tests and AMD MPO tests (in amd_plane) and results are preserved. If there are no other issues besides IGT plane-immutable-zpos, I'll proceed with sending the change to IGT.

Thanks,

Melissa

Hi Melissa,

Thanks for taking a look at the IGT test. Looks like the IGT failures are the only concerns, and I agree that it doesn't make sense to require zpos to be normalized between 0 and number of planes.

Thanks,
Leo

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -1
-
  	if (plane->type == DRM_PLANE_TYPE_PRIMARY &&
  	    plane_cap &&
  	    (plane_cap->pixel_format_support.nv12 ||
Signature · 1 line
2.41.0
#9 lore raw

Re: [PATCH 6/7] Revert "drm/amd/display: Implement zpos property"

Quoted 73 lines · Leo Li
Quoted 70 lines · Melissa Wen
Quoted 16 lines · Aurabindo Pillai

This reverts commit 6c8ff1683d30024c8cff137d30b740a405cc084e.

This patch causes IGT test case 'kms_atomic@plane-immutable-zpos' to fail on AMDGPU hardware.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c | 9 ---------
  1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -0
index 2198df96ed6f..8eeca160d434 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm, · line 1477

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -8
@@ -1468,15 +1468,6 @@ int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,
  		drm_plane_create_blend_mode_property(plane, blend_caps);
  	}
-	if (plane->type == DRM_PLANE_TYPE_PRIMARY) {
-		drm_plane_create_zpos_immutable_property(plane, 0);
-	} else if (plane->type == DRM_PLANE_TYPE_OVERLAY) {
-		unsigned int zpos = 1 + drm_plane_index(plane);
-		drm_plane_create_zpos_property(plane, zpos, 1, 254);
-	} else if (plane->type == DRM_PLANE_TYPE_CURSOR) {
-		drm_plane_create_zpos_immutable_property(plane, 255);
-	}

Hi Jay and Nicholas,

I'm examining this regression and, looking at the test code, I consider this failure is caused by an incorrect assumption in the IGT test in which any zpos values must be in the normalized range of 0 and N planes per CRTC.

	for (int k = 0; k < n_planes; k++) {
		int zpos;
		igt_plane_t *temp;

		temp = &display->pipes[pipe->pipe].planes[k];

		if (!igt_plane_has_prop(temp, IGT_PLANE_ZPOS))
			continue;

		zpos = igt_plane_get_prop(temp, IGT_PLANE_ZPOS);

		igt_assert_lt(zpos, n_planes);  // test case fails here

		plane_ptr[zpos] = temp;
	}

I didn't find anything in the DRM documentation that imposes this behavior. Also, the plane composition in the test is working correctly with this patch and without this likely-misleading assert. In addition, enabling zpos property increases the coverage of kms_atomic@plane-immutable-zpos test (previously this part of the test was just bypassed), so it's not a regression per se. Therefore, I'm inclined to send a fix to IGT, instead of implementing a behavior that fit the test but may not fit well AMD display machinery.

But first I wonder if you guys find any other test or visual check that fail with this feature?

I checked other IGT KMS plane tests and AMD MPO tests (in amd_plane) and results are preserved. If there are no other issues besides IGT plane-immutable-zpos, I'll proceed with sending the change to IGT.

Thanks,

Quoted 7 lines
Quoted 1 line

Melissa

Hi Melissa,

Thanks for taking a look at the IGT test. Looks like the IGT failures are the only concerns, and I agree that it doesn't make sense to require zpos to be normalized between 0 and number of planes.

Hi Leo,

Thanks for the feedback.

I've also checked that msm driver creates zpos properties in a similar way of this commit here, so I sent and applied the IGT test change:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/commit/cb77add45011b129e21f3cb2a4089a73dde56179

With that, could you guys revert this commit reversion?

Thanks,

Melissa

Quoted 12 lines

Thanks,
Leo

Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +0 -1
-
  	if (plane->type == DRM_PLANE_TYPE_PRIMARY &&
  	    plane_cap &&
  	    (plane_cap->pixel_format_support.nv12 ||
Signature · 1 line
2.41.0
#10 lore raw

PATCH 7/7 drm/amd/display: Promote DC to 2.3.245

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 0b704f1a32a6..ee9226f3ab7c 100644
@@ -47,7 +47,7 @@ struct aux_payload;
 struct set_config_cmd_payload;
 struct dmub_notification;
 
-#define DC_VER "3.2.244"
+#define DC_VER "3.2.245"
 
 #define MAX_SURFACES 3
 #define MAX_PLANES 6
Signature · 1 line
2.41.0