Make hdmi_write_hdmi_infoframe() and hdmi_clear_infoframe() callbacks return -EOPNOTSUPP for unsupported InfoFrames and make sure that atomic_check() callback doesn't allow unsupported InfoFrames to be enabled.
Signed-off-by: Dmitry Baryshkov <[email protected]> --- drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c index 39332c57f2c54296f39e27612544f4fbf923863f..9a77e880b7f58403691338ee8c22d24af570acbf 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c @@ -935,7 +935,7 @@ static int dw_hdmi_qp_bridge_clear_infoframe(struct drm_bridge *bridge, PKTSCHED_PKT_EN); break; default: - dev_dbg(hdmi->dev, "Unsupported infoframe type %x\n", type); + return -EOPNOTSUPP; } return 0; @@ -960,12 +960,26 @@ static int dw_hdmi_qp_bridge_write_infoframe(struct drm_bridge *bridge, return dw_hdmi_qp_config_audio_infoframe(hdmi, buffer, len); default: - dev_dbg(hdmi->dev, "Unsupported infoframe type %x\n", type); - return 0; + return -EOPNOTSUPP; } } +static int dw_hdmi_qp_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + /* not supported by the driver */ + conn_state->hdmi.infoframes.spd.set = false; + + /* FIXME: not supported by the driver */ + conn_state->hdmi.infoframes.hdmi.set = false; + + return 0; +} + static const struct drm_bridge_funcs dw_hdmi_qp_bridge_funcs = { + .atomic_check = dw_hdmi_qp_bridge_atomic_check, .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_reset = drm_atomic_helper_bridge_reset, -- 2.47.3
