Commit ff2a3913 authored by Jani Nikula's avatar Jani Nikula

drm/hisilicon/hibmc: convert to struct drm_edid

Prefer the struct drm_edid based functions for reading the EDID and
updating the connector.
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/386e3a64efbdd61c3eaed3f49ea9c3ebd4fcd41d.1715691257.git.jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 3c542674
......@@ -24,14 +24,16 @@
static int hibmc_connector_get_modes(struct drm_connector *connector)
{
int count;
void *edid;
struct hibmc_connector *hibmc_connector = to_hibmc_connector(connector);
const struct drm_edid *drm_edid;
int count;
drm_edid = drm_edid_read_ddc(connector, &hibmc_connector->adapter);
edid = drm_get_edid(connector, &hibmc_connector->adapter);
if (edid) {
drm_connector_update_edid_property(connector, edid);
count = drm_add_edid_modes(connector, edid);
drm_edid_connector_update(connector, drm_edid);
if (drm_edid) {
count = drm_edid_connector_add_modes(connector);
if (count)
goto out;
}
......@@ -42,7 +44,8 @@ static int hibmc_connector_get_modes(struct drm_connector *connector)
drm_set_preferred_mode(connector, 1024, 768);
out:
kfree(edid);
drm_edid_free(drm_edid);
return count;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment