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: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/386e3a64efbdd61c3eaed3f49ea9c3ebd4fcd41d.1715691257.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
This commit is contained in:
Jani Nikula 2024-05-14 15:55:11 +03:00
parent 3c5426740e
commit ff2a391349

View File

@ -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;
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 = drm_edid_read_ddc(connector, &hibmc_connector->adapter);
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;
}