Commit 0c13bd9b authored by Jani Nikula's avatar Jani Nikula

drm/mediatek/dp: switch to ->edid_read callback

Prefer using the struct drm_edid based callback and functions.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarNeil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/3d783478e25e71f12f66c2caedb1f9205d4d8a44.1706038510.git.jani.nikula@intel.com
parent ac2854dd
...@@ -2042,12 +2042,12 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge) ...@@ -2042,12 +2042,12 @@ static enum drm_connector_status mtk_dp_bdg_detect(struct drm_bridge *bridge)
return ret; return ret;
} }
static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge, static const struct drm_edid *mtk_dp_edid_read(struct drm_bridge *bridge,
struct drm_connector *connector) struct drm_connector *connector)
{ {
struct mtk_dp *mtk_dp = mtk_dp_from_bridge(bridge); struct mtk_dp *mtk_dp = mtk_dp_from_bridge(bridge);
bool enabled = mtk_dp->enabled; bool enabled = mtk_dp->enabled;
struct edid *new_edid = NULL; const struct drm_edid *drm_edid;
struct mtk_dp_audio_cfg *audio_caps = &mtk_dp->info.audio_cur_cfg; struct mtk_dp_audio_cfg *audio_caps = &mtk_dp->info.audio_cur_cfg;
if (!enabled) { if (!enabled) {
...@@ -2055,7 +2055,7 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge, ...@@ -2055,7 +2055,7 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
mtk_dp_aux_panel_poweron(mtk_dp, true); mtk_dp_aux_panel_poweron(mtk_dp, true);
} }
new_edid = drm_get_edid(connector, &mtk_dp->aux.ddc); drm_edid = drm_edid_read_ddc(connector, &mtk_dp->aux.ddc);
/* /*
* Parse capability here to let atomic_get_input_bus_fmts and * Parse capability here to let atomic_get_input_bus_fmts and
...@@ -2063,17 +2063,26 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge, ...@@ -2063,17 +2063,26 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
*/ */
if (mtk_dp_parse_capabilities(mtk_dp)) { if (mtk_dp_parse_capabilities(mtk_dp)) {
drm_err(mtk_dp->drm_dev, "Can't parse capabilities\n"); drm_err(mtk_dp->drm_dev, "Can't parse capabilities\n");
kfree(new_edid); drm_edid_free(drm_edid);
new_edid = NULL; drm_edid = NULL;
} }
if (new_edid) { if (drm_edid) {
/*
* FIXME: get rid of drm_edid_raw()
*/
const struct edid *edid = drm_edid_raw(drm_edid);
struct cea_sad *sads; struct cea_sad *sads;
audio_caps->sad_count = drm_edid_to_sad(new_edid, &sads); audio_caps->sad_count = drm_edid_to_sad(edid, &sads);
kfree(sads); kfree(sads);
audio_caps->detect_monitor = drm_detect_monitor_audio(new_edid); /*
* FIXME: This should use connector->display_info.has_audio from
* a path that has read the EDID and called
* drm_edid_connector_update().
*/
audio_caps->detect_monitor = drm_detect_monitor_audio(edid);
} }
if (!enabled) { if (!enabled) {
...@@ -2081,7 +2090,7 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge, ...@@ -2081,7 +2090,7 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
drm_atomic_bridge_chain_post_disable(bridge, connector->state->state); drm_atomic_bridge_chain_post_disable(bridge, connector->state->state);
} }
return new_edid; return drm_edid;
} }
static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux,
...@@ -2433,7 +2442,7 @@ static const struct drm_bridge_funcs mtk_dp_bridge_funcs = { ...@@ -2433,7 +2442,7 @@ static const struct drm_bridge_funcs mtk_dp_bridge_funcs = {
.atomic_enable = mtk_dp_bridge_atomic_enable, .atomic_enable = mtk_dp_bridge_atomic_enable,
.atomic_disable = mtk_dp_bridge_atomic_disable, .atomic_disable = mtk_dp_bridge_atomic_disable,
.mode_valid = mtk_dp_bridge_mode_valid, .mode_valid = mtk_dp_bridge_mode_valid,
.get_edid = mtk_dp_get_edid, .edid_read = mtk_dp_edid_read,
.detect = mtk_dp_bdg_detect, .detect = mtk_dp_bdg_detect,
}; };
......
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