diff mbox series

[4/4] Revert "drm/amd/display: implement force function in amdgpu_dm_connector_funcs"

Message ID e65f30aa1bd581308f916fd005999ebe66618fad.1692705543.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/amd/display: stop using drm_edid_override_connector_update() | expand

Commit Message

Jani Nikula Aug. 22, 2023, 12:01 p.m. UTC
This reverts commit 0ba4a784a14592abed41873e339eab78ceb6e230.

drm_edid_override_connector_update() is *not* supposed to be used by
drivers directly.

From the documentation:

  Only to be used from drm_helper_probe_single_connector_modes() as a
  fallback for when DDC probe failed during drm_get_edid() and caused
  the override/firmware EDID to be skipped.

It's impossible to unify firmare and override EDID handling and property
updates if drivers mess with this directly.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Chao-kai Wang <Stylon.Wang@amd.com>
Cc: Daniel Wheeler <daniel.wheeler@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Hersen Wu <hersenxs.wu@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Wenchieh Chien <wenchieh.chien@amd.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 28 +------------------
 1 file changed, 1 insertion(+), 27 deletions(-)

Comments

Jani Nikula Aug. 22, 2023, 12:06 p.m. UTC | #1
On Tue, 22 Aug 2023, Jani Nikula <jani.nikula@intel.com> wrote:
> This reverts commit 0ba4a784a14592abed41873e339eab78ceb6e230.
>
> drm_edid_override_connector_update() is *not* supposed to be used by
> drivers directly.
>
> From the documentation:
>
>   Only to be used from drm_helper_probe_single_connector_modes() as a
>   fallback for when DDC probe failed during drm_get_edid() and caused
>   the override/firmware EDID to be skipped.
>
> It's impossible to unify firmare and override EDID handling and property
> updates if drivers mess with this directly.
>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Cc: Alex Hung <alex.hung@amd.com>
> Cc: Chao-kai Wang <Stylon.Wang@amd.com>
> Cc: Daniel Wheeler <daniel.wheeler@amd.com>
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Hersen Wu <hersenxs.wu@amd.com>
> Cc: Leo Li <sunpeng.li@amd.com>
> Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
> Cc: Wenchieh Chien <wenchieh.chien@amd.com>
> Cc: David Airlie <airlied@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 28 +------------------
>  1 file changed, 1 insertion(+), 27 deletions(-)
>
> 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 adfe2fcb915c..25151085508f 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -6317,31 +6317,6 @@ amdgpu_dm_connector_late_register(struct drm_connector *connector)
>  	return 0;
>  }
>  
> -void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
> -{
> -	struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
> -	struct dc_link *dc_link = aconnector->dc_link;
> -	struct dc_sink *dc_em_sink = aconnector->dc_em_sink;
> -	struct edid *edid;
> -
> -	if (!connector->edid_override)
> -		return;

This one too, also documented:

	/**
	 * @edid_override: Override EDID set via debugfs.
	 *
	 * Do not modify or access outside of the drm_edid_override_* family of
	 * functions.
	 */

> -
> -	drm_edid_override_connector_update(&aconnector->base);
> -	edid = aconnector->base.edid_blob_ptr->data;
> -	aconnector->edid = edid;
> -
> -	/* Update emulated (virtual) sink's EDID */
> -	if (dc_em_sink && dc_link) {
> -		memset(&dc_em_sink->edid_caps, 0, sizeof(struct dc_edid_caps));
> -		memmove(dc_em_sink->dc_edid.raw_edid, edid, (edid->extensions + 1) * EDID_LENGTH);
> -		dm_helpers_parse_edid_caps(
> -			dc_link,
> -			&dc_em_sink->dc_edid,
> -			&dc_em_sink->edid_caps);
> -	}
> -}
> -
>  static const struct drm_connector_funcs amdgpu_dm_connector_funcs = {
>  	.reset = amdgpu_dm_connector_funcs_reset,
>  	.detect = amdgpu_dm_connector_detect,
> @@ -6352,8 +6327,7 @@ static const struct drm_connector_funcs amdgpu_dm_connector_funcs = {
>  	.atomic_set_property = amdgpu_dm_connector_atomic_set_property,
>  	.atomic_get_property = amdgpu_dm_connector_atomic_get_property,
>  	.late_register = amdgpu_dm_connector_late_register,
> -	.early_unregister = amdgpu_dm_connector_unregister,
> -	.force = amdgpu_dm_connector_funcs_force
> +	.early_unregister = amdgpu_dm_connector_unregister
>  };
>  
>  static int get_modes(struct drm_connector *connector)
diff mbox series

Patch

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 adfe2fcb915c..25151085508f 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -6317,31 +6317,6 @@  amdgpu_dm_connector_late_register(struct drm_connector *connector)
 	return 0;
 }
 
-void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
-{
-	struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
-	struct dc_link *dc_link = aconnector->dc_link;
-	struct dc_sink *dc_em_sink = aconnector->dc_em_sink;
-	struct edid *edid;
-
-	if (!connector->edid_override)
-		return;
-
-	drm_edid_override_connector_update(&aconnector->base);
-	edid = aconnector->base.edid_blob_ptr->data;
-	aconnector->edid = edid;
-
-	/* Update emulated (virtual) sink's EDID */
-	if (dc_em_sink && dc_link) {
-		memset(&dc_em_sink->edid_caps, 0, sizeof(struct dc_edid_caps));
-		memmove(dc_em_sink->dc_edid.raw_edid, edid, (edid->extensions + 1) * EDID_LENGTH);
-		dm_helpers_parse_edid_caps(
-			dc_link,
-			&dc_em_sink->dc_edid,
-			&dc_em_sink->edid_caps);
-	}
-}
-
 static const struct drm_connector_funcs amdgpu_dm_connector_funcs = {
 	.reset = amdgpu_dm_connector_funcs_reset,
 	.detect = amdgpu_dm_connector_detect,
@@ -6352,8 +6327,7 @@  static const struct drm_connector_funcs amdgpu_dm_connector_funcs = {
 	.atomic_set_property = amdgpu_dm_connector_atomic_set_property,
 	.atomic_get_property = amdgpu_dm_connector_atomic_get_property,
 	.late_register = amdgpu_dm_connector_late_register,
-	.early_unregister = amdgpu_dm_connector_unregister,
-	.force = amdgpu_dm_connector_funcs_force
+	.early_unregister = amdgpu_dm_connector_unregister
 };
 
 static int get_modes(struct drm_connector *connector)