Skip to content

drm/vc4: Fix VIC usage with Broadcast RGB #3611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions drivers/gpu/drm/vc4/vc4_firmware_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,19 +936,14 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc)
break;
}

mb.timings.video_id_code = frame.avi.video_code;

if (!vc4_encoder->hdmi_monitor) {
mb.timings.flags |= TIMINGS_FLAGS_DVI;
mb.timings.video_id_code = frame.avi.video_code;
} else {
struct vc4_fkms_connector_state *conn_state =
to_vc4_fkms_connector_state(vc4_crtc->connector->state);

/* Do not provide a VIC as the HDMI spec requires that we do not
* signal the opposite of the defined range in the AVI
* infoframe.
*/
mb.timings.video_id_code = 0;

if (conn_state->broadcast_rgb == VC4_BROADCAST_RGB_AUTO) {
/* See CEA-861-E - 5.1 Default Encoding Parameters */
if (drm_default_rgb_quant_range(mode) ==
Expand All @@ -958,6 +953,16 @@ static void vc4_crtc_mode_set_nofb(struct drm_crtc *crtc)
if (conn_state->broadcast_rgb ==
VC4_BROADCAST_RGB_LIMITED)
mb.timings.flags |= TIMINGS_FLAGS_RGB_LIMITED;

/* If not using the default range, then do not provide
* a VIC as the HDMI spec requires that we do not
* signal the opposite of the defined range in the AVI
* infoframe.
*/
if (!!(mb.timings.flags & TIMINGS_FLAGS_RGB_LIMITED) !=
(drm_default_rgb_quant_range(mode) ==
HDMI_QUANTIZATION_RANGE_LIMITED))
mb.timings.video_id_code = 0;
}
}

Expand Down