|
@@ -44,6 +44,7 @@ struct tda998x_priv {
|
|
u8 current_page;
|
|
u8 current_page;
|
|
int dpms;
|
|
int dpms;
|
|
bool supports_infoframes;
|
|
bool supports_infoframes;
|
|
|
|
+ bool sink_has_audio;
|
|
u8 vip_cntrl_0;
|
|
u8 vip_cntrl_0;
|
|
u8 vip_cntrl_1;
|
|
u8 vip_cntrl_1;
|
|
u8 vip_cntrl_2;
|
|
u8 vip_cntrl_2;
|
|
@@ -1090,13 +1091,33 @@ tda998x_encoder_mode_set(struct drm_encoder *encoder,
|
|
|
|
|
|
tda998x_write_avi(priv, adjusted_mode);
|
|
tda998x_write_avi(priv, adjusted_mode);
|
|
|
|
|
|
- if (priv->audio_params.format != AFMT_UNUSED)
|
|
|
|
|
|
+ if (priv->audio_params.format != AFMT_UNUSED &&
|
|
|
|
+ priv->sink_has_audio)
|
|
tda998x_configure_audio(priv, &priv->audio_params);
|
|
tda998x_configure_audio(priv, &priv->audio_params);
|
|
}
|
|
}
|
|
|
|
|
|
mutex_unlock(&priv->audio_mutex);
|
|
mutex_unlock(&priv->audio_mutex);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int tda998x_connector_fill_modes(struct drm_connector *connector,
|
|
|
|
+ uint32_t maxX, uint32_t maxY)
|
|
|
|
+{
|
|
|
|
+ struct tda998x_priv *priv = conn_to_tda998x_priv(connector);
|
|
|
|
+ int ret;
|
|
|
|
+
|
|
|
|
+ ret = drm_helper_probe_single_connector_modes(connector, maxX, maxY);
|
|
|
|
+
|
|
|
|
+ if (connector->edid_blob_ptr) {
|
|
|
|
+ struct edid *edid = (void *)connector->edid_blob_ptr->data;
|
|
|
|
+
|
|
|
|
+ priv->sink_has_audio = drm_detect_monitor_audio(edid);
|
|
|
|
+ } else {
|
|
|
|
+ priv->sink_has_audio = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
static enum drm_connector_status
|
|
static enum drm_connector_status
|
|
tda998x_connector_detect(struct drm_connector *connector, bool force)
|
|
tda998x_connector_detect(struct drm_connector *connector, bool force)
|
|
{
|
|
{
|
|
@@ -1274,7 +1295,7 @@ static int tda998x_audio_hw_params(struct device *dev, void *data,
|
|
}
|
|
}
|
|
|
|
|
|
mutex_lock(&priv->audio_mutex);
|
|
mutex_lock(&priv->audio_mutex);
|
|
- if (priv->supports_infoframes)
|
|
|
|
|
|
+ if (priv->supports_infoframes && priv->sink_has_audio)
|
|
ret = tda998x_configure_audio(priv, &audio);
|
|
ret = tda998x_configure_audio(priv, &audio);
|
|
else
|
|
else
|
|
ret = 0;
|
|
ret = 0;
|
|
@@ -1608,7 +1629,7 @@ static int tda998x_connector_dpms(struct drm_connector *connector, int mode)
|
|
static const struct drm_connector_funcs tda998x_connector_funcs = {
|
|
static const struct drm_connector_funcs tda998x_connector_funcs = {
|
|
.dpms = tda998x_connector_dpms,
|
|
.dpms = tda998x_connector_dpms,
|
|
.reset = drm_atomic_helper_connector_reset,
|
|
.reset = drm_atomic_helper_connector_reset,
|
|
- .fill_modes = drm_helper_probe_single_connector_modes,
|
|
|
|
|
|
+ .fill_modes = tda998x_connector_fill_modes,
|
|
.detect = tda998x_connector_detect,
|
|
.detect = tda998x_connector_detect,
|
|
.destroy = tda998x_connector_destroy,
|
|
.destroy = tda998x_connector_destroy,
|
|
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
|
|
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
|