Commit 13a9e2be authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/omap/hdmi4: switch to ->edid_read callback

parent 18701c50
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -436,11 +436,11 @@ static void hdmi4_bridge_hpd_notify(struct drm_bridge *bridge,
		hdmi4_cec_set_phys_addr(&hdmi->core, CEC_PHYS_ADDR_INVALID);
}

static struct edid *hdmi4_bridge_get_edid(struct drm_bridge *bridge,
static const struct drm_edid *hdmi4_bridge_edid_read(struct drm_bridge *bridge,
						     struct drm_connector *connector)
{
	struct omap_hdmi *hdmi = drm_bridge_to_hdmi(bridge);
	struct edid *edid = NULL;
	const struct drm_edid *drm_edid = NULL;
	unsigned int cec_addr;
	bool need_enable;
	int r;
@@ -461,13 +461,21 @@ static struct edid *hdmi4_bridge_get_edid(struct drm_bridge *bridge,
	if (r)
		goto done;

	edid = drm_do_get_edid(connector, hdmi4_core_ddc_read, &hdmi->core);
	drm_edid = drm_edid_read_custom(connector, hdmi4_core_ddc_read, &hdmi->core);

done:
	hdmi_runtime_put(hdmi);
	mutex_unlock(&hdmi->lock);

	if (edid && edid->extensions) {
	if (drm_edid) {
		/*
		 * FIXME: The CEC physical address should be set using
		 * hdmi4_cec_set_phys_addr(&hdmi->core,
		 * connector->display_info.source_physical_address) from a path
		 * that has read the EDID and called
		 * drm_edid_connector_update().
		 */
		const struct edid *edid = drm_edid_raw(drm_edid);
		unsigned int len = (edid->extensions + 1) * EDID_LENGTH;

		cec_addr = cec_get_edid_phys_addr((u8 *)edid, len, NULL);
@@ -480,7 +488,7 @@ static struct edid *hdmi4_bridge_get_edid(struct drm_bridge *bridge,
	if (need_enable)
		hdmi4_core_disable(&hdmi->core);

	return edid;
	return drm_edid;
}

static const struct drm_bridge_funcs hdmi4_bridge_funcs = {
@@ -492,7 +500,7 @@ static const struct drm_bridge_funcs hdmi4_bridge_funcs = {
	.atomic_enable = hdmi4_bridge_enable,
	.atomic_disable = hdmi4_bridge_disable,
	.hpd_notify = hdmi4_bridge_hpd_notify,
	.get_edid = hdmi4_bridge_get_edid,
	.edid_read = hdmi4_bridge_edid_read,
};

static void hdmi4_bridge_init(struct omap_hdmi *hdmi)