Skip to content

Commit f7945d9

Browse files
committed
drm/sti/sti_hdmi: convert to struct drm_edid
Prefer the struct drm_edid based functions for reading the EDID and updating the connector. The functional change is that the CEC physical address gets invalidated when the EDID could not be read. v2: Use drm_edid_read() instead of drm_edid_read_ddc() (Sima) Reviewed-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/25879a0183e30792bf0d63bdf56a03f11018e4a3.1724348429.git.jani.nikula@intel.com Signed-off-by: Jani Nikula <[email protected]>
1 parent bfbdf72 commit f7945d9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

drivers/gpu/drm/sti/sti_hdmi.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -974,28 +974,32 @@ static const struct drm_bridge_funcs sti_hdmi_bridge_funcs = {
974974

975975
static int sti_hdmi_connector_get_modes(struct drm_connector *connector)
976976
{
977+
const struct drm_display_info *info = &connector->display_info;
977978
struct sti_hdmi_connector *hdmi_connector
978979
= to_sti_hdmi_connector(connector);
979980
struct sti_hdmi *hdmi = hdmi_connector->hdmi;
980-
struct edid *edid;
981+
const struct drm_edid *drm_edid;
981982
int count;
982983

983984
DRM_DEBUG_DRIVER("\n");
984985

985-
edid = drm_get_edid(connector, hdmi->ddc_adapt);
986-
if (!edid)
987-
goto fail;
986+
drm_edid = drm_edid_read(connector);
987+
988+
drm_edid_connector_update(connector, drm_edid);
988989

989-
cec_notifier_set_phys_addr_from_edid(hdmi->notifier, edid);
990+
cec_notifier_set_phys_addr(hdmi->notifier,
991+
connector->display_info.source_physical_address);
992+
993+
if (!drm_edid)
994+
goto fail;
990995

991-
count = drm_add_edid_modes(connector, edid);
992-
drm_connector_update_edid_property(connector, edid);
996+
count = drm_edid_connector_add_modes(connector);
993997

994998
DRM_DEBUG_KMS("%s : %dx%d cm\n",
995-
(connector->display_info.is_hdmi ? "hdmi monitor" : "dvi monitor"),
996-
edid->width_cm, edid->height_cm);
999+
info->is_hdmi ? "hdmi monitor" : "dvi monitor",
1000+
info->width_mm / 10, info->height_mm / 10);
9971001

998-
kfree(edid);
1002+
drm_edid_free(drm_edid);
9991003
return count;
10001004

10011005
fail:

0 commit comments

Comments
 (0)