AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
@ 2021-10-17 11:34 Claudio Suarez
  2021-10-17 11:34 ` [PATCH 1/3] drm/amdgpu: update drm_display_info correctly when the edid is read Claudio Suarez
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Claudio Suarez @ 2021-10-17 11:34 UTC (permalink / raw)
  To: amd-gfx; +Cc: Claudio Suarez


From the TODO list Documentation/gpu/todo.rst
-----------------------
Once EDID is parsed, the monitor HDMI support information is available through
drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
retrieve the same information, which is less efficient.

Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
drm_display_info.is_hdmi if applicable.
-----------------------
The task is divided in three small patches. The last patch depends on the
first one.



Claudio Suarez (3):
  drm/amdgpu: update drm_display_info correctly when the edid is read
  drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the
    code
  drm/amdgpu: replace drm_detect_hdmi_monitor() with
    drm_display_info.is_hdmi

 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 17 +++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 +-
 .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +--
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +-
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 37 +++++--------------
 drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
 8 files changed, 29 insertions(+), 44 deletions(-)

-- 
2.33.0




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

* [PATCH 1/3] drm/amdgpu: update drm_display_info correctly when the edid is read
  2021-10-17 11:34 [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
@ 2021-10-17 11:34 ` Claudio Suarez
  2021-10-17 11:34 ` [PATCH 2/3] drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the code Claudio Suarez
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Claudio Suarez @ 2021-10-17 11:34 UTC (permalink / raw)
  To: amd-gfx; +Cc: Claudio Suarez

drm_display_info is updated by drm_get_edid() or
drm_connector_update_edid_property(). In the amdgpu driver it is almost
always updated when the edid is read in amdgpu_connector_get_edid(),
but not always.  Change amdgpu_connector_get_edid() and
amdgpu_connector_free_edid() to keep drm_display_info updated.

Signed-off-by: Claudio Suarez <cssk@net-c.es>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 5 ++++-
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index b9c11c2b2885..647aecee1185 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -315,8 +315,10 @@ static void amdgpu_connector_get_edid(struct drm_connector *connector)
 	if (!amdgpu_connector->edid) {
 		/* some laptops provide a hardcoded edid in rom for LCDs */
 		if (((connector->connector_type == DRM_MODE_CONNECTOR_LVDS) ||
-		     (connector->connector_type == DRM_MODE_CONNECTOR_eDP)))
+		     (connector->connector_type == DRM_MODE_CONNECTOR_eDP))) {
 			amdgpu_connector->edid = amdgpu_connector_get_hardcoded_edid(adev);
+			drm_connector_update_edid_property(connector, amdgpu_connector->edid);
+		}
 	}
 }
 
@@ -326,6 +328,7 @@ static void amdgpu_connector_free_edid(struct drm_connector *connector)
 
 	kfree(amdgpu_connector->edid);
 	amdgpu_connector->edid = NULL;
+	drm_connector_update_edid_property(connector, NULL);
 }
 
 static int amdgpu_connector_ddc_get_modes(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 1ea31dcc7a8b..02ecd216a556 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2583,13 +2583,12 @@ void amdgpu_dm_update_connector_after_detect(
 			aconnector->edid =
 				(struct edid *)sink->dc_edid.raw_edid;
 
-			drm_connector_update_edid_property(connector,
-							   aconnector->edid);
 			if (aconnector->dc_link->aux_mode)
 				drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
 						    aconnector->edid);
 		}
 
+		drm_connector_update_edid_property(connector, aconnector->edid);
 		amdgpu_dm_update_freesync_caps(connector, aconnector->edid);
 		update_connector_ext_caps(aconnector);
 	} else {
-- 
2.33.0




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

* [PATCH 2/3] drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the code
  2021-10-17 11:34 [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
  2021-10-17 11:34 ` [PATCH 1/3] drm/amdgpu: update drm_display_info correctly when the edid is read Claudio Suarez
@ 2021-10-17 11:34 ` Claudio Suarez
  2021-10-17 11:35 ` [PATCH 3/3] drm/amdgpu: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
  2021-10-18 13:37 ` [PATCH 0/3] drm/amdgpu " Harry Wentland
  3 siblings, 0 replies; 11+ messages in thread
From: Claudio Suarez @ 2021-10-17 11:34 UTC (permalink / raw)
  To: amd-gfx; +Cc: Claudio Suarez

Use drm_edid_get_monitor_name() instead of duplicating the code that
parses the EDID in dm_helpers_parse_edid_caps()

Signed-off-by: Claudio Suarez <cssk@net-c.es>
---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c  | 18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 6fee12c91ef5..bc58ee29306a 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -59,7 +59,6 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
 	int sad_count = -1;
 	int sadb_count = -1;
 	int i = 0;
-	int j = 0;
 	uint8_t *sadb = NULL;
 
 	enum dc_edid_status result = EDID_OK;
@@ -78,20 +77,9 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
 	edid_caps->manufacture_week = edid_buf->mfg_week;
 	edid_caps->manufacture_year = edid_buf->mfg_year;
 
-	/* One of the four detailed_timings stores the monitor name. It's
-	 * stored in an array of length 13. */
-	for (i = 0; i < 4; i++) {
-		if (edid_buf->detailed_timings[i].data.other_data.type == 0xfc) {
-			while (j < 13 && edid_buf->detailed_timings[i].data.other_data.data.str.str[j]) {
-				if (edid_buf->detailed_timings[i].data.other_data.data.str.str[j] == '\n')
-					break;
-
-				edid_caps->display_name[j] =
-					edid_buf->detailed_timings[i].data.other_data.data.str.str[j];
-				j++;
-			}
-		}
-	}
+	drm_edid_get_monitor_name(edid_buf,
+				  edid_caps->display_name,
+				  AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS);
 
 	edid_caps->edid_hdmi = drm_detect_hdmi_monitor(
 			(struct edid *) edid->raw_edid);
-- 
2.33.0




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

* [PATCH 3/3] drm/amdgpu: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-10-17 11:34 [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
  2021-10-17 11:34 ` [PATCH 1/3] drm/amdgpu: update drm_display_info correctly when the edid is read Claudio Suarez
  2021-10-17 11:34 ` [PATCH 2/3] drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the code Claudio Suarez
@ 2021-10-17 11:35 ` Claudio Suarez
  2021-10-18 13:37 ` [PATCH 0/3] drm/amdgpu " Harry Wentland
  3 siblings, 0 replies; 11+ messages in thread
From: Claudio Suarez @ 2021-10-17 11:35 UTC (permalink / raw)
  To: amd-gfx; +Cc: Claudio Suarez

Once EDID is parsed, the monitor HDMI support information is available
through drm_display_info.is_hdmi. The amdgpu driver still calls
drm_detect_hdmi_monitor() to retrieve the same information, which
is less efficient. Change to drm_display_info.is_hdmi

This is a TODO task in Documentation/gpu/todo.rst

Signed-off-by: Claudio Suarez <cssk@net-c.es>
---
 .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 12 ++++++------
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 ++--
 .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +++---
 .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 19 +++++++------------
 drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
 drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
 7 files changed, 21 insertions(+), 26 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
index 647aecee1185..0710c19d5e2f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c
@@ -108,7 +108,7 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
 	case DRM_MODE_CONNECTOR_DVII:
 	case DRM_MODE_CONNECTOR_HDMIB:
 		if (amdgpu_connector->use_digital) {
-			if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+			if (connector->display_info.is_hdmi) {
 				if (connector->display_info.bpc)
 					bpc = connector->display_info.bpc;
 			}
@@ -116,7 +116,7 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
 		break;
 	case DRM_MODE_CONNECTOR_DVID:
 	case DRM_MODE_CONNECTOR_HDMIA:
-		if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+		if (connector->display_info.is_hdmi) {
 			if (connector->display_info.bpc)
 				bpc = connector->display_info.bpc;
 		}
@@ -125,7 +125,7 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
 		dig_connector = amdgpu_connector->con_priv;
 		if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) ||
 		    (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP) ||
-		    drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+		    connector->display_info.is_hdmi) {
 			if (connector->display_info.bpc)
 				bpc = connector->display_info.bpc;
 		}
@@ -149,7 +149,7 @@ int amdgpu_connector_get_monitor_bpc(struct drm_connector *connector)
 		break;
 	}
 
-	if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+	if (connector->display_info.is_hdmi) {
 		/*
 		 * Pre DCE-8 hw can't handle > 12 bpc, and more than 12 bpc doesn't make
 		 * much sense without support for > 12 bpc framebuffers. RGB 4:4:4 at
@@ -1173,7 +1173,7 @@ static enum drm_mode_status amdgpu_connector_dvi_mode_valid(struct drm_connector
 		    (amdgpu_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) ||
 		    (amdgpu_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)) {
 			return MODE_OK;
-		} else if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+		} else if (connector->display_info.is_hdmi) {
 			/* HDMI 1.3+ supports max clock of 340 Mhz */
 			if (mode->clock > 340000)
 				return MODE_CLOCK_HIGH;
@@ -1465,7 +1465,7 @@ static enum drm_mode_status amdgpu_connector_dp_mode_valid(struct drm_connector
 		    (amdgpu_dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) {
 			return amdgpu_atombios_dp_mode_valid_helper(connector, mode);
 		} else {
-			if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+			if (connector->display_info.is_hdmi) {
 				/* HDMI 1.3+ supports max clock of 340 Mhz */
 				if (mode->clock > 340000)
 					return MODE_CLOCK_HIGH;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index dc50c05f23fc..0bd9d7a4d76f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -1364,7 +1364,7 @@ bool amdgpu_display_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
 		if ((!(mode->flags & DRM_MODE_FLAG_INTERLACE)) &&
 		    ((amdgpu_encoder->underscan_type == UNDERSCAN_ON) ||
 		     ((amdgpu_encoder->underscan_type == UNDERSCAN_AUTO) &&
-		      drm_detect_hdmi_monitor(amdgpu_connector_edid(connector)) &&
+		      connector->display_info.is_hdmi &&
 		      amdgpu_display_is_hdtv_mode(mode)))) {
 			if (amdgpu_encoder->underscan_hborder != 0)
 				amdgpu_crtc->h_border = amdgpu_encoder->underscan_hborder;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c
index af4ef84e27a7..c96e458ed088 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c
@@ -222,7 +222,7 @@ bool amdgpu_dig_monitor_is_duallink(struct drm_encoder *encoder,
 	case DRM_MODE_CONNECTOR_HDMIB:
 		if (amdgpu_connector->use_digital) {
 			/* HDMI 1.3 supports up to 340 Mhz over single link */
-			if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+			if (connector->display_info.is_hdmi) {
 				if (pixel_clock > 340000)
 					return true;
 				else
@@ -244,7 +244,7 @@ bool amdgpu_dig_monitor_is_duallink(struct drm_encoder *encoder,
 			return false;
 		else {
 			/* HDMI 1.3 supports up to 340 Mhz over single link */
-			if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector))) {
+			if (connector->display_info.is_hdmi) {
 				if (pixel_clock > 340000)
 					return true;
 				else
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
index 6134ed964027..a92d86e12718 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
@@ -469,7 +469,7 @@ int amdgpu_atombios_encoder_get_encoder_mode(struct drm_encoder *encoder)
 			if (amdgpu_connector->use_digital &&
 			    (amdgpu_connector->audio == AMDGPU_AUDIO_ENABLE))
 				return ATOM_ENCODER_MODE_HDMI;
-			else if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector)) &&
+			else if (connector->display_info.is_hdmi &&
 				 (amdgpu_connector->audio == AMDGPU_AUDIO_AUTO))
 				return ATOM_ENCODER_MODE_HDMI;
 			else if (amdgpu_connector->use_digital)
@@ -488,7 +488,7 @@ int amdgpu_atombios_encoder_get_encoder_mode(struct drm_encoder *encoder)
 		if (amdgpu_audio != 0) {
 			if (amdgpu_connector->audio == AMDGPU_AUDIO_ENABLE)
 				return ATOM_ENCODER_MODE_HDMI;
-			else if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector)) &&
+			else if (connector->display_info.is_hdmi &&
 				 (amdgpu_connector->audio == AMDGPU_AUDIO_AUTO))
 				return ATOM_ENCODER_MODE_HDMI;
 			else
@@ -506,7 +506,7 @@ int amdgpu_atombios_encoder_get_encoder_mode(struct drm_encoder *encoder)
 		} else if (amdgpu_audio != 0) {
 			if (amdgpu_connector->audio == AMDGPU_AUDIO_ENABLE)
 				return ATOM_ENCODER_MODE_HDMI;
-			else if (drm_detect_hdmi_monitor(amdgpu_connector_edid(connector)) &&
+			else if (connector->display_info.is_hdmi &&
 				 (amdgpu_connector->audio == AMDGPU_AUDIO_AUTO))
 				return ATOM_ENCODER_MODE_HDMI;
 			else
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index bc58ee29306a..fb33dd0a1f52 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -50,10 +50,12 @@
  *	void
  * */
 enum dc_edid_status dm_helpers_parse_edid_caps(
-		struct dc_context *ctx,
+		struct dc_link *link,
 		const struct dc_edid *edid,
 		struct dc_edid_caps *edid_caps)
 {
+	struct amdgpu_dm_connector *aconnector = link->priv;
+	struct drm_connector *connector = &aconnector->base;
 	struct edid *edid_buf = (struct edid *) edid->raw_edid;
 	struct cea_sad *sads;
 	int sad_count = -1;
@@ -81,8 +83,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps(
 				  edid_caps->display_name,
 				  AUDIO_INFO_DISPLAY_NAME_SIZE_IN_CHARS);
 
-	edid_caps->edid_hdmi = drm_detect_hdmi_monitor(
-			(struct edid *) edid->raw_edid);
+	edid_caps->edid_hdmi = connector->display_info.is_hdmi;
 
 	sad_count = drm_edid_to_sad((struct edid *) edid->raw_edid, &sads);
 	if (sad_count <= 0)
@@ -598,14 +599,8 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		/* We don't need the original edid anymore */
 		kfree(edid);
 
-		/* connector->display_info will be parsed from EDID and saved
-		 * into drm_connector->display_info from edid by call stack
-		 * below:
-		 * drm_parse_ycbcr420_deep_color_info
-		 * drm_parse_hdmi_forum_vsdb
-		 * drm_parse_cea_ext
-		 * drm_add_display_info
-		 * drm_connector_update_edid_property
+		/* connector->display_info is parsed from EDID and saved
+		 * into drm_connector->display_info
 		 *
 		 * drm_connector->display_info will be used by amdgpu_dm funcs,
 		 * like fill_stream_properties_from_drm_display_mode
@@ -613,7 +608,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
 		amdgpu_dm_update_connector_after_detect(aconnector);
 
 		edid_status = dm_helpers_parse_edid_caps(
-						ctx,
+						link,
 						&sink->dc_edid,
 						&sink->edid_caps);
 
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index c798c65d4276..5efe89fe6c2c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3254,7 +3254,7 @@ struct dc_sink *dc_link_add_remote_sink(
 		goto fail_add_sink;
 
 	edid_status = dm_helpers_parse_edid_caps(
-			link->ctx,
+			link,
 			&dc_sink->dc_edid,
 			&dc_sink->edid_caps);
 
diff --git a/drivers/gpu/drm/amd/display/dc/dm_helpers.h b/drivers/gpu/drm/amd/display/dc/dm_helpers.h
index 9ab854293ace..94dc80060610 100644
--- a/drivers/gpu/drm/amd/display/dc/dm_helpers.h
+++ b/drivers/gpu/drm/amd/display/dc/dm_helpers.h
@@ -59,7 +59,7 @@ void dm_helpers_free_gpu_mem(
 		void *pvMem);
 
 enum dc_edid_status dm_helpers_parse_edid_caps(
-	struct dc_context *ctx,
+	struct dc_link *link,
 	const struct dc_edid *edid,
 	struct dc_edid_caps *edid_caps);
 
-- 
2.33.0




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

* Re: [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-10-17 11:34 [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
                   ` (2 preceding siblings ...)
  2021-10-17 11:35 ` [PATCH 3/3] drm/amdgpu: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
@ 2021-10-18 13:37 ` Harry Wentland
  2021-10-18 15:16   ` Claudio Suarez
  2021-12-04 11:09   ` Claudio Suarez
  3 siblings, 2 replies; 11+ messages in thread
From: Harry Wentland @ 2021-10-18 13:37 UTC (permalink / raw)
  To: Claudio Suarez, amd-gfx

On 2021-10-17 07:34, Claudio Suarez wrote:
> 
> From the TODO list Documentation/gpu/todo.rst
> -----------------------
> Once EDID is parsed, the monitor HDMI support information is available through
> drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
> retrieve the same information, which is less efficient.
> 
> Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
> drm_display_info.is_hdmi if applicable.
> -----------------------
> The task is divided in three small patches. The last patch depends on the
> first one.
> 

Thanks.

This series is
Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> 
> 
> Claudio Suarez (3):
>   drm/amdgpu: update drm_display_info correctly when the edid is read
>   drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the
>     code
>   drm/amdgpu: replace drm_detect_hdmi_monitor() with
>     drm_display_info.is_hdmi
> 
>  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 17 +++++----
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 +-
>  .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +--
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +-
>  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 37 +++++--------------
>  drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
>  drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
>  8 files changed, 29 insertions(+), 44 deletions(-)
> 


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

* Re: [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-10-18 13:37 ` [PATCH 0/3] drm/amdgpu " Harry Wentland
@ 2021-10-18 15:16   ` Claudio Suarez
  2021-12-04 11:09   ` Claudio Suarez
  1 sibling, 0 replies; 11+ messages in thread
From: Claudio Suarez @ 2021-10-18 15:16 UTC (permalink / raw)
  To: Harry Wentland; +Cc: amd-gfx

On Mon, Oct 18, 2021 at 09:37:13AM -0400, Harry Wentland wrote:
> On 2021-10-17 07:34, Claudio Suarez wrote:
> > 
> > From the TODO list Documentation/gpu/todo.rst
> > -----------------------
> > Once EDID is parsed, the monitor HDMI support information is available through
> > drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
> > retrieve the same information, which is less efficient.
> > 
> > Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
> > drm_display_info.is_hdmi if applicable.
> > -----------------------
> > The task is divided in three small patches. The last patch depends on the
> > first one.
> > 
> 
> Thanks.
> 
> This series is
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> 
> Harry
> 

Thanks a lot for your comments and your review, Harry!

BR
Claudio Suarez.




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

* Re: [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-10-18 13:37 ` [PATCH 0/3] drm/amdgpu " Harry Wentland
  2021-10-18 15:16   ` Claudio Suarez
@ 2021-12-04 11:09   ` Claudio Suarez
  2021-12-06 22:15     ` Alex Deucher
  1 sibling, 1 reply; 11+ messages in thread
From: Claudio Suarez @ 2021-12-04 11:09 UTC (permalink / raw)
  To: Harry Wentland; +Cc: amd-gfx


Hello,

These patches

https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg69247.html

are not uploaded to the linux source. I suppose I have to ping here.

Best regards,
Claudio Suarez.




On Mon, Oct 18, 2021 at 09:37:13AM -0400, Harry Wentland wrote:
> On 2021-10-17 07:34, Claudio Suarez wrote:
> > 
> > From the TODO list Documentation/gpu/todo.rst
> > -----------------------
> > Once EDID is parsed, the monitor HDMI support information is available through
> > drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
> > retrieve the same information, which is less efficient.
> > 
> > Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
> > drm_display_info.is_hdmi if applicable.
> > -----------------------
> > The task is divided in three small patches. The last patch depends on the
> > first one.
> > 
> 
> Thanks.
> 
> This series is
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> 
> Harry
> 
> > 
> > 
> > Claudio Suarez (3):
> >   drm/amdgpu: update drm_display_info correctly when the edid is read
> >   drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the
> >     code
> >   drm/amdgpu: replace drm_detect_hdmi_monitor() with
> >     drm_display_info.is_hdmi
> > 
> >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 17 +++++----
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 +-
> >  .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +--
> >  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +-
> >  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 37 +++++--------------
> >  drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
> >  drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
> >  8 files changed, 29 insertions(+), 44 deletions(-)
> > 
> 



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

* Re: [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-12-04 11:09   ` Claudio Suarez
@ 2021-12-06 22:15     ` Alex Deucher
  2021-12-06 23:13       ` Claudio Suarez
  2021-12-07 13:45       ` Claudio Suarez
  0 siblings, 2 replies; 11+ messages in thread
From: Alex Deucher @ 2021-12-06 22:15 UTC (permalink / raw)
  To: Claudio Suarez; +Cc: Harry Wentland, amd-gfx list

Do you have push rights to drm-misc?  IIRC, these patches depend on
the is_hdmi changes that recently went into drm-misc, so these patches
should probably go upstream via drm-misc rather than amdgpu.

Alex

On Mon, Dec 6, 2021 at 5:21 AM Claudio Suarez <cssk@net-c.es> wrote:
>
>
> Hello,
>
> These patches
>
> https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg69247.html
>
> are not uploaded to the linux source. I suppose I have to ping here.
>
> Best regards,
> Claudio Suarez.
>
>
>
>
> On Mon, Oct 18, 2021 at 09:37:13AM -0400, Harry Wentland wrote:
> > On 2021-10-17 07:34, Claudio Suarez wrote:
> > >
> > > From the TODO list Documentation/gpu/todo.rst
> > > -----------------------
> > > Once EDID is parsed, the monitor HDMI support information is available through
> > > drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
> > > retrieve the same information, which is less efficient.
> > >
> > > Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
> > > drm_display_info.is_hdmi if applicable.
> > > -----------------------
> > > The task is divided in three small patches. The last patch depends on the
> > > first one.
> > >
> >
> > Thanks.
> >
> > This series is
> > Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> >
> > Harry
> >
> > >
> > >
> > > Claudio Suarez (3):
> > >   drm/amdgpu: update drm_display_info correctly when the edid is read
> > >   drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the
> > >     code
> > >   drm/amdgpu: replace drm_detect_hdmi_monitor() with
> > >     drm_display_info.is_hdmi
> > >
> > >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 17 +++++----
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
> > >  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 +-
> > >  .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +--
> > >  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +-
> > >  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 37 +++++--------------
> > >  drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
> > >  drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
> > >  8 files changed, 29 insertions(+), 44 deletions(-)
> > >
> >
>
>

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

* Re: [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-12-06 22:15     ` Alex Deucher
@ 2021-12-06 23:13       ` Claudio Suarez
  2021-12-07 13:45       ` Claudio Suarez
  1 sibling, 0 replies; 11+ messages in thread
From: Claudio Suarez @ 2021-12-06 23:13 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Harry Wentland, amd-gfx list

On Mon, Dec 06, 2021 at 05:15:11PM -0500, Alex Deucher wrote:
> Do you have push rights to drm-misc?

No, I am sorry. I have not.

Best regards.
Claudio Suarez.


  IIRC, these patches depend on
> the is_hdmi changes that recently went into drm-misc, so these patches
> should probably go upstream via drm-misc rather than amdgpu.
> 
> Alex
> 
> On Mon, Dec 6, 2021 at 5:21 AM Claudio Suarez <cssk@net-c.es> wrote:
> >
> >
> > Hello,
> >
> > These patches
> >
> > https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg69247.html
> >
> > are not uploaded to the linux source. I suppose I have to ping here.
> >
> > Best regards,
> > Claudio Suarez.
> >
> >
> >
> >
> > On Mon, Oct 18, 2021 at 09:37:13AM -0400, Harry Wentland wrote:
> > > On 2021-10-17 07:34, Claudio Suarez wrote:
> > > >
> > > > From the TODO list Documentation/gpu/todo.rst
> > > > -----------------------
> > > > Once EDID is parsed, the monitor HDMI support information is available through
> > > > drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
> > > > retrieve the same information, which is less efficient.
> > > >
> > > > Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
> > > > drm_display_info.is_hdmi if applicable.
> > > > -----------------------
> > > > The task is divided in three small patches. The last patch depends on the
> > > > first one.
> > > >
> > >
> > > Thanks.
> > >
> > > This series is
> > > Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> > >
> > > Harry
> > >
> > > >
> > > >
> > > > Claudio Suarez (3):
> > > >   drm/amdgpu: update drm_display_info correctly when the edid is read
> > > >   drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the
> > > >     code
> > > >   drm/amdgpu: replace drm_detect_hdmi_monitor() with
> > > >     drm_display_info.is_hdmi
> > > >
> > > >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 17 +++++----
> > > >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
> > > >  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 +-
> > > >  .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +--
> > > >  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +-
> > > >  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 37 +++++--------------
> > > >  drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
> > > >  drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
> > > >  8 files changed, 29 insertions(+), 44 deletions(-)
> > > >
> > >
> >
> >



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

* Re: [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-12-06 22:15     ` Alex Deucher
  2021-12-06 23:13       ` Claudio Suarez
@ 2021-12-07 13:45       ` Claudio Suarez
  2021-12-07 17:47         ` Alex Deucher
  1 sibling, 1 reply; 11+ messages in thread
From: Claudio Suarez @ 2021-12-07 13:45 UTC (permalink / raw)
  To: Alex Deucher; +Cc: Harry Wentland, amd-gfx list

On Mon, Dec 06, 2021 at 05:15:11PM -0500, Alex Deucher wrote:
> Do you have push rights to drm-misc?  IIRC, these patches depend on
> the is_hdmi changes that recently went into drm-misc, so these patches
> should probably go upstream via drm-misc rather than amdgpu.

Sorry, I have missed to answer the second part.
This patch depends on nothing. The only dependency is
a92d083d08b0 (drm/edid: Add flag to drm_display_info to identify HDMI sinks, 2020-02-26)
and it is in the kernel source since February 2020.

These patches are not uploaded to misc:
https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
I don't think these patches will go upstream via drm-misc.
The only post was to this list.

I thought this is the list for pathches to amd drivers.
Hope I am not wrong.

Best regards,
Claudio Suarez


> 
> Alex
> 
> On Mon, Dec 6, 2021 at 5:21 AM Claudio Suarez <cssk@net-c.es> wrote:
> >
> >
> > Hello,
> >
> > These patches
> >
> > https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg69247.html
> >
> > are not uploaded to the linux source. I suppose I have to ping here.
> >
> > Best regards,
> > Claudio Suarez.
> >
> >
> >
> >
> > On Mon, Oct 18, 2021 at 09:37:13AM -0400, Harry Wentland wrote:
> > > On 2021-10-17 07:34, Claudio Suarez wrote:
> > > >
> > > > From the TODO list Documentation/gpu/todo.rst
> > > > -----------------------
> > > > Once EDID is parsed, the monitor HDMI support information is available through
> > > > drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
> > > > retrieve the same information, which is less efficient.
> > > >
> > > > Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
> > > > drm_display_info.is_hdmi if applicable.
> > > > -----------------------
> > > > The task is divided in three small patches. The last patch depends on the
> > > > first one.
> > > >
> > >
> > > Thanks.
> > >
> > > This series is
> > > Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> > >
> > > Harry
> > >
> > > >
> > > >
> > > > Claudio Suarez (3):
> > > >   drm/amdgpu: update drm_display_info correctly when the edid is read
> > > >   drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the
> > > >     code
> > > >   drm/amdgpu: replace drm_detect_hdmi_monitor() with
> > > >     drm_display_info.is_hdmi
> > > >
> > > >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 17 +++++----
> > > >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
> > > >  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 +-
> > > >  .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +--
> > > >  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +-
> > > >  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 37 +++++--------------
> > > >  drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
> > > >  drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
> > > >  8 files changed, 29 insertions(+), 44 deletions(-)
> > > >
> > >
> >
> >



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

* Re: [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi
  2021-12-07 13:45       ` Claudio Suarez
@ 2021-12-07 17:47         ` Alex Deucher
  0 siblings, 0 replies; 11+ messages in thread
From: Alex Deucher @ 2021-12-07 17:47 UTC (permalink / raw)
  To: Claudio Suarez; +Cc: Harry Wentland, amd-gfx list

yeah, sorry about that.  I was mixing these up with another patch set.
I've applied them.  Sorry for the delay.

Alex

On Tue, Dec 7, 2021 at 8:45 AM Claudio Suarez <cssk@net-c.es> wrote:
>
> On Mon, Dec 06, 2021 at 05:15:11PM -0500, Alex Deucher wrote:
> > Do you have push rights to drm-misc?  IIRC, these patches depend on
> > the is_hdmi changes that recently went into drm-misc, so these patches
> > should probably go upstream via drm-misc rather than amdgpu.
>
> Sorry, I have missed to answer the second part.
> This patch depends on nothing. The only dependency is
> a92d083d08b0 (drm/edid: Add flag to drm_display_info to identify HDMI sinks, 2020-02-26)
> and it is in the kernel source since February 2020.
>
> These patches are not uploaded to misc:
> https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> I don't think these patches will go upstream via drm-misc.
> The only post was to this list.
>
> I thought this is the list for pathches to amd drivers.
> Hope I am not wrong.
>
> Best regards,
> Claudio Suarez
>
>
> >
> > Alex
> >
> > On Mon, Dec 6, 2021 at 5:21 AM Claudio Suarez <cssk@net-c.es> wrote:
> > >
> > >
> > > Hello,
> > >
> > > These patches
> > >
> > > https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg69247.html
> > >
> > > are not uploaded to the linux source. I suppose I have to ping here.
> > >
> > > Best regards,
> > > Claudio Suarez.
> > >
> > >
> > >
> > >
> > > On Mon, Oct 18, 2021 at 09:37:13AM -0400, Harry Wentland wrote:
> > > > On 2021-10-17 07:34, Claudio Suarez wrote:
> > > > >
> > > > > From the TODO list Documentation/gpu/todo.rst
> > > > > -----------------------
> > > > > Once EDID is parsed, the monitor HDMI support information is available through
> > > > > drm_display_info.is_hdmi. Many drivers still call drm_detect_hdmi_monitor() to
> > > > > retrieve the same information, which is less efficient.
> > > > >
> > > > > Audit each individual driver calling drm_detect_hdmi_monitor() and switch to
> > > > > drm_display_info.is_hdmi if applicable.
> > > > > -----------------------
> > > > > The task is divided in three small patches. The last patch depends on the
> > > > > first one.
> > > > >
> > > >
> > > > Thanks.
> > > >
> > > > This series is
> > > > Reviewed-by: Harry Wentland <harry.wentland@amd.com>
> > > >
> > > > Harry
> > > >
> > > > >
> > > > >
> > > > > Claudio Suarez (3):
> > > > >   drm/amdgpu: update drm_display_info correctly when the edid is read
> > > > >   drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the
> > > > >     code
> > > > >   drm/amdgpu: replace drm_detect_hdmi_monitor() with
> > > > >     drm_display_info.is_hdmi
> > > > >
> > > > >  .../gpu/drm/amd/amdgpu/amdgpu_connectors.c    | 17 +++++----
> > > > >  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c   |  2 +-
> > > > >  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c  |  4 +-
> > > > >  .../gpu/drm/amd/amdgpu/atombios_encoders.c    |  6 +--
> > > > >  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c |  3 +-
> > > > >  .../amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 37 +++++--------------
> > > > >  drivers/gpu/drm/amd/display/dc/core/dc.c      |  2 +-
> > > > >  drivers/gpu/drm/amd/display/dc/dm_helpers.h   |  2 +-
> > > > >  8 files changed, 29 insertions(+), 44 deletions(-)
> > > > >
> > > >
> > >
> > >
>
>

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

end of thread, other threads:[~2021-12-07 17:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-17 11:34 [PATCH 0/3] drm/amdgpu replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
2021-10-17 11:34 ` [PATCH 1/3] drm/amdgpu: update drm_display_info correctly when the edid is read Claudio Suarez
2021-10-17 11:34 ` [PATCH 2/3] drm/amdgpu: use drm_edid_get_monitor_name() instead of duplicating the code Claudio Suarez
2021-10-17 11:35 ` [PATCH 3/3] drm/amdgpu: replace drm_detect_hdmi_monitor() with drm_display_info.is_hdmi Claudio Suarez
2021-10-18 13:37 ` [PATCH 0/3] drm/amdgpu " Harry Wentland
2021-10-18 15:16   ` Claudio Suarez
2021-12-04 11:09   ` Claudio Suarez
2021-12-06 22:15     ` Alex Deucher
2021-12-06 23:13       ` Claudio Suarez
2021-12-07 13:45       ` Claudio Suarez
2021-12-07 17:47         ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox