Skip to content

Commit 77c2a37

Browse files
committed
vc4: Enable hdmi vendor infoframe
Signed-off-by: Dom Cobley <[email protected]>
1 parent 57604cb commit 77c2a37

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,30 @@ static void vc4_hdmi_set_spd_infoframe(struct drm_encoder *encoder)
689689
vc4_hdmi_write_infoframe(encoder, &frame);
690690
}
691691

692+
static void vc4_hdmi_set_hdmi_infoframe(struct drm_encoder *encoder)
693+
{
694+
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
695+
struct drm_connector *connector = &vc4_hdmi->connector;
696+
struct drm_crtc *crtc = encoder->crtc;
697+
const struct drm_display_mode *mode = &crtc->state->adjusted_mode;
698+
union hdmi_infoframe frame;
699+
int ret;
700+
701+
ret = drm_hdmi_vendor_infoframe_from_display_mode(&frame.vendor.hdmi,
702+
connector,
703+
mode);
704+
if (ret < 0) {
705+
DRM_ERROR("couldn't fill HDMI infoframe (%d)\n", ret);
706+
return;
707+
}
708+
ret = hdmi_vendor_infoframe_check(&frame.vendor.hdmi);
709+
if (ret < 0) {
710+
DRM_ERROR("Invalid HDMI infoframe (%d)\n", ret);
711+
return;
712+
}
713+
vc4_hdmi_write_infoframe(encoder, &frame);
714+
}
715+
692716
static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
693717
{
694718
struct vc4_hdmi *vc4_hdmi = encoder_to_vc4_hdmi(encoder);
@@ -714,6 +738,8 @@ static void vc4_hdmi_set_infoframes(struct drm_encoder *encoder)
714738

715739
vc4_hdmi_set_avi_infoframe(encoder);
716740
vc4_hdmi_set_spd_infoframe(encoder);
741+
vc4_hdmi_set_hdmi_infoframe(encoder);
742+
717743
/*
718744
* If audio was streaming, then we need to reenabled the audio
719745
* infoframe here during encoder_enable.

0 commit comments

Comments
 (0)