drm/omap: hdmi: Allocate EDID in the .read_edid() operation

Bring the omapdss-specific .read_edid() operation in sync with the
drm_bridge .get_edid() operation to ease code reuse.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-29-laurent.pinchart@ideasonboard.com
This commit is contained in:
Laurent Pinchart
2020-02-26 13:24:48 +02:00
committed by Tomi Valkeinen
parent db0fefd1b9
commit 0fe37173ce
4 changed files with 47 additions and 27 deletions

View File

@@ -153,25 +153,19 @@ static void omap_connector_destroy(struct drm_connector *connector)
kfree(omap_connector);
}
#define MAX_EDID 512
static int omap_connector_get_modes_edid(struct drm_connector *connector,
struct omap_dss_device *dssdev)
{
enum drm_connector_status status;
void *edid;
struct edid *edid;
int n;
status = omap_connector_detect(connector, false);
if (status != connector_status_connected)
goto no_edid;
edid = kzalloc(MAX_EDID, GFP_KERNEL);
if (!edid)
goto no_edid;
if (dssdev->ops->read_edid(dssdev, edid, MAX_EDID) <= 0 ||
!drm_edid_is_valid(edid)) {
edid = dssdev->ops->read_edid(dssdev);
if (!edid || !drm_edid_is_valid(edid)) {
kfree(edid);
goto no_edid;
}