Skip to content

Commit 0e859fa

Browse files
Alex Hungalexdeucher
Alex Hung
authored andcommitted
drm/amd/display: Remove unwanted drm edid references
[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]>
1 parent 5d72e24 commit 0e859fa

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6461,15 +6461,23 @@ amdgpu_dm_connector_late_register(struct drm_connector *connector)
64616461
static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
64626462
{
64636463
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
6464+
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
64646465
struct dc_link *dc_link = aconnector->dc_link;
64656466
struct dc_sink *dc_em_sink = aconnector->dc_em_sink;
64666467
struct edid *edid;
64676468

6468-
if (!connector->edid_override)
6469+
/*
6470+
* Note: drm_get_edid gets edid in the following order:
6471+
* 1) override EDID if set via edid_override debugfs,
6472+
* 2) firmware EDID if set via edid_firmware module parameter
6473+
* 3) regular DDC read.
6474+
*/
6475+
edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
6476+
if (!edid) {
6477+
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
64696478
return;
6479+
}
64706480

6471-
drm_edid_override_connector_update(&aconnector->base);
6472-
edid = aconnector->base.edid_blob_ptr->data;
64736481
aconnector->edid = edid;
64746482

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

65056513
static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
65066514
{
6515+
struct drm_connector *connector = &aconnector->base;
6516+
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(&aconnector->base);
65076517
struct dc_sink_init_data init_params = {
65086518
.link = aconnector->dc_link,
65096519
.sink_signal = SIGNAL_TYPE_VIRTUAL
65106520
};
65116521
struct edid *edid;
65126522

6513-
if (!aconnector->base.edid_blob_ptr) {
6514-
/* if connector->edid_override valid, pass
6515-
* it to edid_override to edid_blob_ptr
6516-
*/
6517-
6518-
drm_edid_override_connector_update(&aconnector->base);
6519-
6520-
if (!aconnector->base.edid_blob_ptr) {
6521-
DRM_ERROR("No EDID firmware found on connector: %s ,forcing to OFF!\n",
6522-
aconnector->base.name);
6523-
6524-
aconnector->base.force = DRM_FORCE_OFF;
6525-
return;
6526-
}
6523+
/*
6524+
* Note: drm_get_edid gets edid in the following order:
6525+
* 1) override EDID if set via edid_override debugfs,
6526+
* 2) firmware EDID if set via edid_firmware module parameter
6527+
* 3) regular DDC read.
6528+
*/
6529+
edid = drm_get_edid(connector, &amdgpu_connector->ddc_bus->aux.ddc);
6530+
if (!edid) {
6531+
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
6532+
return;
65276533
}
65286534

6529-
edid = (struct edid *) aconnector->base.edid_blob_ptr->data;
6530-
65316535
aconnector->edid = edid;
65326536

65336537
aconnector->dc_em_sink = dc_link_add_remote_sink(

0 commit comments

Comments
 (0)