Skip to content

Commit 81262b1

Browse files
melissawenalexdeucher
authored andcommitted
drm/amd/display: restore edid reading from a given i2c adapter
When switching to drm_edid, we slightly changed how to get edid by removing the possibility of getting them from dc_link when in aux transaction mode. As MST doesn't initialize the connector with `drm_connector_init_with_ddc()`, restore the original behavior to avoid functional changes. v2: - Fix build warning of unchecked dereference (kernel test bot) CC: Alex Hung <alex.hung@amd.com> CC: Mario Limonciello <mario.limonciello@amd.com> CC: Roman Li <Roman.Li@amd.com> CC: Aurabindo Pillai <Aurabindo.Pillai@amd.com> Fixes: 48edb2a ("drm/amd/display: switch amdgpu_dm_connector to use struct drm_edid") Reviewed-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Melissa Wen <mwen@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 9d8af72 commit 81262b1

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7295,8 +7295,14 @@ static void amdgpu_dm_connector_funcs_force(struct drm_connector *connector)
72957295
struct dc_link *dc_link = aconnector->dc_link;
72967296
struct dc_sink *dc_em_sink = aconnector->dc_em_sink;
72977297
const struct drm_edid *drm_edid;
7298+
struct i2c_adapter *ddc;
72987299

7299-
drm_edid = drm_edid_read(connector);
7300+
if (dc_link && dc_link->aux_mode)
7301+
ddc = &aconnector->dm_dp_aux.aux.ddc;
7302+
else
7303+
ddc = &aconnector->i2c->base;
7304+
7305+
drm_edid = drm_edid_read_ddc(connector, ddc);
73007306
drm_edid_connector_update(connector, drm_edid);
73017307
if (!drm_edid) {
73027308
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);
@@ -7341,14 +7347,21 @@ static int get_modes(struct drm_connector *connector)
73417347
static void create_eml_sink(struct amdgpu_dm_connector *aconnector)
73427348
{
73437349
struct drm_connector *connector = &aconnector->base;
7350+
struct dc_link *dc_link = aconnector->dc_link;
73447351
struct dc_sink_init_data init_params = {
73457352
.link = aconnector->dc_link,
73467353
.sink_signal = SIGNAL_TYPE_VIRTUAL
73477354
};
73487355
const struct drm_edid *drm_edid;
73497356
const struct edid *edid;
7357+
struct i2c_adapter *ddc;
7358+
7359+
if (dc_link && dc_link->aux_mode)
7360+
ddc = &aconnector->dm_dp_aux.aux.ddc;
7361+
else
7362+
ddc = &aconnector->i2c->base;
73507363

7351-
drm_edid = drm_edid_read(connector);
7364+
drm_edid = drm_edid_read_ddc(connector, ddc);
73527365
drm_edid_connector_update(connector, drm_edid);
73537366
if (!drm_edid) {
73547367
DRM_ERROR("No EDID found on connector: %s.\n", connector->name);

0 commit comments

Comments
 (0)