[Intel-gfx] [PATCH 14/15] drm/i915: set colorspace for YCBCR420 outputs
Shashank Sharma
shashank.sharma at intel.com
Fri Jul 7 03:19:20 UTC 2017
When output colorspace is YCBCR420, we have to load the
corresponding colorspace in AVI infoframe. This patch fills
the colorspace of AVI infoframe as per the output mode.
V2: Rebase
V3: Rebase
V4: Rebase
V5: Added r-b from Ander
V6: Checking RGB/YCBCR420 output only (Ville)
Cc: Ville Syrjala <ville.syrjala at linux.intel.com>
Cc: Ander Conselvan de Oliveira <conselvan2 at gmail.com>
Reviewed-by: Ander Conselvan de Oliveira <conselvan2 at gmail.com>
Signed-off-by: Shashank Sharma <shashank.sharma at intel.com>
---
drivers/gpu/drm/i915/intel_hdmi.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 9e8d784..2524ac4 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -461,6 +461,7 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
&crtc_state->base.adjusted_mode;
struct drm_connector *connector = &intel_hdmi->attached_connector->base;
bool is_hdmi2_sink = connector->display_info.hdmi.scdc.supported;
+ enum hdmi_colorspace colorspace = HDMI_COLORSPACE_RGB;
union hdmi_infoframe frame;
int ret;
@@ -472,6 +473,17 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
return;
}
+ if (crtc_state->ycbcr420)
+ colorspace = HDMI_COLORSPACE_YUV420;
+
+ ret = drm_hdmi_avi_infoframe_set_colorspace(&frame.avi,
+ adjusted_mode,
+ colorspace);
+ if (ret < 0) {
+ DRM_ERROR("couldn't fill AVI colorspace\n");
+ return;
+ }
+
drm_hdmi_avi_infoframe_quant_range(&frame.avi, adjusted_mode,
crtc_state->limited_color_range ?
HDMI_QUANTIZATION_RANGE_LIMITED :
--
2.7.4
More information about the Intel-gfx
mailing list