Skip to content

Commit

Permalink
drm/amd/display: Remove unwanted drm edid references
Browse files Browse the repository at this point in the history
[WHY]
edid_override and drm_edid_override_connector_update, according to drm
documentation, should not be referred outside drm_edid.

[HOW]
Remove and replace them accordingly. This can tested by IGT's
kms_hdmi_inject test.

Reviewed-by: Harry Wentland <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
Alex Hung authored and alexdeucher committed Sep 26, 2023
1 parent 5d72e24 commit 0e859fa
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -6461,15 +6461,23 @@ amdgpu_dm_connector_late_register(struct drm_connector *connector)
static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
{
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
struct amdgpu_connector *amdgpu_connector = to_amdgpu_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)
/*
* Note: drm_get_edid gets edid in the following order:
* 1) override EDID if set via edid_override debugfs,
* 2) firmware EDID if set via edid_firmware module parameter
* 3) regular DDC read.
*/
edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
if (!edid) {
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
return;
}

drm_edid_override_connector_update(&aconnector->base);
edid = aconnector->base.edid_blob_ptr->data;
aconnector->edid = edid;

/* Update emulated (virtual) sink's EDID */
Expand Down Expand Up @@ -6504,30 +6512,26 @@ static int get_modes(struct drm_connector *connector)

static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
{
struct drm_connector *connector = &aconnector->base;
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(&aconnector->base);
struct dc_sink_init_data init_params = {
.link = aconnector->dc_link,
.sink_signal = SIGNAL_TYPE_VIRTUAL
};
struct edid *edid;

if (!aconnector->base.edid_blob_ptr) {
/* if connector->edid_override valid, pass
* it to edid_override to edid_blob_ptr
*/

drm_edid_override_connector_update(&aconnector->base);

if (!aconnector->base.edid_blob_ptr) {
DRM_ERROR("No EDID firmware found on connector: %s ,forcing to OFF!\n",
aconnector->base.name);

aconnector->base.force = DRM_FORCE_OFF;
return;
}
/*
* Note: drm_get_edid gets edid in the following order:
* 1) override EDID if set via edid_override debugfs,
* 2) firmware EDID if set via edid_firmware module parameter
* 3) regular DDC read.
*/
edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
if (!edid) {
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
return;
}

edid = (struct edid *) aconnector->base.edid_blob_ptr->data;

aconnector->edid = edid;

aconnector->dc_em_sink = dc_link_add_remote_sink(
Expand Down

0 comments on commit 0e859fa

Please sign in to comment.