Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Use EDID from VBIOS embedded panel info

When an embedded panel has no DDC, read the EDID from
the VBIOS embedded panel info and use that.

Fixes: 7c7f5b15be65 ("drm/amd/display: Refactor edid read.")
Link: https://gitlab.freedesktop.org/drm/amd/-/work_items/5192
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 399b9abc353c62f6e37d38325edbdb6c2c00411c)

authored by

Timur Kristóf and committed by
Alex Deucher
019155e2 9ea16f64

+44
+44
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
··· 1032 1032 return drm_edid_read_custom(connector, dm_helpers_probe_acpi_edid, connector); 1033 1033 } 1034 1034 1035 + static const struct drm_edid * 1036 + dm_helpers_read_vbios_hardcoded_edid(struct dc_link *link, struct amdgpu_dm_connector *aconnector) 1037 + { 1038 + struct dc_bios *bios = link->ctx->dc_bios; 1039 + struct embedded_panel_info info; 1040 + const struct drm_edid *edid; 1041 + enum bp_result r; 1042 + 1043 + if (!dc_is_embedded_signal(link->connector_signal) || 1044 + !bios->funcs->get_embedded_panel_info) 1045 + return NULL; 1046 + 1047 + memset(&info, 0, sizeof(info)); 1048 + r = bios->funcs->get_embedded_panel_info(bios, &info); 1049 + 1050 + if (r != BP_RESULT_OK) { 1051 + dm_error("Error when reading embedded panel info: %u\n", r); 1052 + return NULL; 1053 + } 1054 + 1055 + if (!info.fake_edid || !info.fake_edid_size) { 1056 + dm_error("Embedded panel info doesn't contain an EDID\n"); 1057 + return NULL; 1058 + } 1059 + 1060 + edid = drm_edid_alloc(info.fake_edid, info.fake_edid_size); 1061 + 1062 + if (!drm_edid_valid(edid)) { 1063 + dm_error("EDID from embedded panel info is invalid\n"); 1064 + drm_edid_free(edid); 1065 + return NULL; 1066 + } 1067 + 1068 + aconnector->base.display_info.width_mm = info.panel_width_mm; 1069 + aconnector->base.display_info.height_mm = info.panel_height_mm; 1070 + 1071 + return edid; 1072 + } 1073 + 1035 1074 void populate_hdmi_info_from_connector(struct drm_hdmi_info *hdmi, struct dc_edid_caps *edid_caps) 1036 1075 { 1037 1076 edid_caps->scdc_present = hdmi->scdc.supported; ··· 1091 1052 1092 1053 if (link->aux_mode) 1093 1054 ddc = &aconnector->dm_dp_aux.aux.ddc; 1055 + else if (link->ddc_hw_inst == GPIO_DDC_LINE_UNKNOWN && 1056 + dc_is_embedded_signal(link->connector_signal)) 1057 + ddc = NULL; 1094 1058 else 1095 1059 ddc = &aconnector->i2c->base; 1096 1060 ··· 1107 1065 drm_edid = dm_helpers_read_acpi_edid(aconnector); 1108 1066 if (drm_edid) 1109 1067 drm_info(connector->dev, "Using ACPI provided EDID for %s\n", connector->name); 1068 + else if (!ddc) 1069 + drm_edid = dm_helpers_read_vbios_hardcoded_edid(link, aconnector); 1110 1070 else 1111 1071 drm_edid = drm_edid_read_ddc(connector, ddc); 1112 1072 drm_edid_connector_update(connector, drm_edid);