Skip to contentSkip to conversation

YCBCR 4:2:0 handling in i915 layer

PATCH Superseded Shashank Sharma 3 participants 14 messages Jul 17, 2017 – Jul 20, 2017

Subsystems (2)

v4 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v4 cover YCBCR 4:2:0 handling in i915 layer

This patch series is a subset of series "YCBCR 4:2:0 handling in DRM layer" Published and reviewed here: https://patchwork.freedesktop.org/series/26973/

The original series had 14 patches, out of which first 8 (which were in DRM layer) are reviewed merged. These 6 patches are the I915 layer handling of YCBCR 4:2:0 output. The patch series got review comments from Ville Syrjala <[email protected]> in previous patch set, addressed those here.

Shashank Sharma (6):
drm/i915: add config function for YCBCR420 outputs drm/i915: prepare scaler for YCBCR420 modeset drm/i915: prepare pipe for YCBCR420 output drm/i915: prepare csc unit for YCBCR420 output drm/i915: set colorspace for YCBCR420 outputs drm/i915/glk: set HDMI 2.0 identifier

 drivers/gpu/drm/i915/i915_reg.h      |  3 ++
 drivers/gpu/drm/i915/intel_color.c   | 46 ++++++++++++++++++++++++-
 drivers/gpu/drm/i915/intel_display.c | 67 ++++++++++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/intel_drv.h     |  3 ++
 drivers/gpu/drm/i915/intel_hdmi.c    | 61 ++++++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/intel_panel.c   |  3 +-
 6 files changed, 175 insertions(+), 8 deletions(-)
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v4 1/6 drm/i915: add config function for YCBCR420 outputs

This patch checks encoder level support for YCBCR420 outputs. The logic goes as simple as this:
If the input mode is YCBCR420-only mode: prepare HDMI for YCBCR420 output, else continue with RGB output mode.

It checks if the mode is YCBCR420 and source can support this output then it marks the ycbcr_420 output indicator into crtc state, for further staging in driver.

V2: Split the patch into two, kept helper functions in DRM layer.
V3: Changed the compute_config function based on new DRM API.
V4: Rebase
V5: Rebase
V6: Check and handle YCBCR420-only modes, discard the property
based approach (Ville)
V7: Addressed review comments from Ville
- add else case in 12BPC check.
- extract ycbcr420 state inside hdmi_12bpc_possible function.
V8: Addressed review comments from Ville
- Remove extra blank lines.
- Remove "HDMI" from the description of ycbcr420 state variable.
- Remove local variable, use crtc_state->ycbcr420 instead. Added r-b from Ville.

Cc Ville Syrjala <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |  1 +
 drivers/gpu/drm/i915/intel_drv.h     |  3 +++
 drivers/gpu/drm/i915/intel_hdmi.c    | 40 +++++++++++++++++++++++++++++++++---
 3 files changed, 41 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -0
index 2144adc..a5140e4 100644
@@ -11945,6 +11945,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 	PIPE_CONF_CHECK_I(hdmi_scrambling);
 	PIPE_CONF_CHECK_I(hdmi_high_tmds_clock_ratio);
 	PIPE_CONF_CHECK_I(has_infoframe);
+	PIPE_CONF_CHECK_I(ycbcr420);
 
 	PIPE_CONF_CHECK_I(has_audio);
 
drivers/gpu/drm/i915/intel_drv.h +3 -0
index d17a324..372aebf 100644
@@ -780,6 +780,9 @@ struct intel_crtc_state {
 
 	/* HDMI High TMDS char rate ratio */
 	bool hdmi_high_tmds_clock_ratio;
+
+	/* output format is YCBCR 4:2:0 */
+	bool ycbcr420;
 };
 
 struct intel_crtc {
drivers/gpu/drm/i915/intel_hdmi.c +37 -3
index 2f831cf..64bb8cc 100644
@@ -1330,8 +1330,15 @@ static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state)
 		if (connector_state->crtc != crtc_state->base.crtc)
 			continue;
 
-		if ((info->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_36) == 0)
-			return false;
+		if (crtc_state->ycbcr420) {
+			const struct drm_hdmi_info *hdmi = &info->hdmi;
+
+			if (!(hdmi->y420_dc_modes & DRM_EDID_YCBCR420_DC_36))
+				return false;
+		} else {
+			if (!(info->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_36))
+				return false;
+		}
 	}
 
 	/* Display Wa #1139 */
@@ -1342,6 +1349,24 @@ static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state)
 	return true;
 }
 
+static bool
+intel_hdmi_ycbcr420_config(struct drm_connector *connector,
+			       struct intel_crtc_state *config,
+			       int *clock_12bpc, int *clock_8bpc)
+{
+	if (!connector->ycbcr_420_allowed) {
+		DRM_ERROR("Platform doesn't support YCBCR420 output\n");
+		return false;
+	}
+
+	/* YCBCR420 TMDS rate requirement is half the pixel clock */
+	config->port_clock /= 2;
+	*clock_12bpc /= 2;
+	*clock_8bpc /= 2;
+	config->ycbcr420 = true;
+	return true;
+}
+
 bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 			       struct intel_crtc_state *pipe_config,
 			       struct drm_connector_state *conn_state)
@@ -1349,7 +1374,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 	struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
 	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
 	struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
-	struct drm_scdc *scdc = &conn_state->connector->display_info.hdmi.scdc;
+	struct drm_connector *connector = conn_state->connector;
+	struct drm_scdc *scdc = &connector->display_info.hdmi.scdc;
 	struct intel_digital_connector_state *intel_conn_state =
 		to_intel_digital_connector_state(conn_state);
 	int clock_8bpc = pipe_config->base.adjusted_mode.crtc_clock;
@@ -1379,6 +1405,14 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 		clock_12bpc *= 2;
 	}
 
+	if (drm_mode_is_420_only(&connector->display_info, adjusted_mode)) {
+		if (!intel_hdmi_ycbcr420_config(connector, pipe_config,
+						&clock_12bpc, &clock_8bpc)) {
+			DRM_ERROR("Can't support YCBCR420 output\n");
+			return false;
+		}
+	}
+
 	if (HAS_PCH_SPLIT(dev_priv) && !HAS_DDI(dev_priv))
 		pipe_config->has_pch_encoder = true;
 
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v4 2/6 drm/i915: prepare scaler for YCBCR420 modeset

In reply to Shashank Sharma

To get a YCBCR420 output from intel platforms, we need one scaler to scale down YCBCR444 samples to YCBCR420 samples.

This patch:
- Does scaler allocation for HDMI ycbcr420 outputs.
- Programs PIPE_MISC register for ycbcr420 output.
- Adds a new scaler user "HDMI output" to plug-into existing scaler framework. This output type is identified using bit 30 of the scaler users bitmap.

V2: rebase
V3: rebase
V4: rebase
V5: addressed review comments from Ander:
- No need to check both scaler_user && hdmi_output. Check for scaler_user is enough.
V6: rebase
V7: Do not create a new scaler user, use existing pipe scaler user.
V8: rebase
V9: Addressed review comments from Ville:
- Remove leftover comment for HDMI scaler user.
- Remove unnecessary blank line.
- Make scaler alocation failure a DEBUG log instead of ERROR. Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan De Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |  3 +++
 drivers/gpu/drm/i915/intel_hdmi.c    | 12 ++++++++++++
 drivers/gpu/drm/i915/intel_panel.c   |  3 ++-
 3 files changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +3 -0
index a5140e4..d78f1c2 100644
@@ -4624,6 +4624,9 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
 	 */
 	need_scaling = src_w != dst_w || src_h != dst_h;
 
+	if (crtc_state->ycbcr420 && scaler_user == SKL_CRTC_INDEX)
+		need_scaling = true;
+
 	/*
 	 * Scaling/fitting not supported in IF-ID mode in GEN9+
 	 * TODO: Interlace fetch mode doesn't support YUV420 planar formats.
drivers/gpu/drm/i915/intel_hdmi.c +12 -0
index 64bb8cc..6addef5 100644
@@ -1354,6 +1354,8 @@ intel_hdmi_ycbcr420_config(struct drm_connector *connector,
 			       struct intel_crtc_state *config,
 			       int *clock_12bpc, int *clock_8bpc)
 {
+	struct intel_crtc *intel_crtc = to_intel_crtc(config->base.crtc);
+
 	if (!connector->ycbcr_420_allowed) {
 		DRM_ERROR("Platform doesn't support YCBCR420 output\n");
 		return false;
@@ -1364,6 +1366,16 @@ intel_hdmi_ycbcr420_config(struct drm_connector *connector,
 	*clock_12bpc /= 2;
 	*clock_8bpc /= 2;
 	config->ycbcr420 = true;
+
+	/* YCBCR 420 output conversion needs a scaler */
+	if (skl_update_scaler_crtc(config)) {
+		DRM_DEBUG_KMS("Scaler allocation for output failed\n");
+		return false;
+	}
+
+	intel_pch_panel_fitting(intel_crtc, config,
+				DRM_MODE_SCALE_FULLSCREEN);
+
 	return true;
 }
 
drivers/gpu/drm/i915/intel_panel.c +2 -1
index 96c2cbd..fd2e081 100644
@@ -110,7 +110,8 @@ intel_pch_panel_fitting(struct intel_crtc *intel_crtc,
 
 	/* Native modes don't need fitting */
 	if (adjusted_mode->crtc_hdisplay == pipe_config->pipe_src_w &&
-	    adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h)
+	    adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h &&
+	    !pipe_config->ycbcr420)
 		goto done;
 
 	switch (fitting_mode) {
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

Re: [PATCH v4 2/6] drm/i915: prepare scaler for YCBCR420 modeset

Quoted 9 lines · Shashank Sharma

To get a YCBCR420 output from intel platforms, we need one scaler to scale down YCBCR444 samples to YCBCR420 samples.

This patch:
- Does scaler allocation for HDMI ycbcr420 outputs.
- Programs PIPE_MISC register for ycbcr420 output.
- Adds a new scaler user "HDMI output" to plug-into existing scaler framework. This output type is identified using bit 30 of the scaler users bitmap.

With the code change this became also stale.

Quoted 88 lines

V2: rebase
V3: rebase
V4: rebase
V5: addressed review comments from Ander:
- No need to check both scaler_user && hdmi_output. Check for scaler_user is enough.
V6: rebase
V7: Do not create a new scaler user, use existing pipe scaler user.
V8: rebase
V9: Addressed review comments from Ville:
- Remove leftover comment for HDMI scaler user.
- Remove unnecessary blank line.
- Make scaler alocation failure a DEBUG log instead of ERROR. Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan De Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |  3 +++
 drivers/gpu/drm/i915/intel_hdmi.c    | 12 ++++++++++++
 drivers/gpu/drm/i915/intel_panel.c   |  3 ++-
 3 files changed, 17 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +3 -0
index a5140e4..d78f1c2 100644
@@ -4624,6 +4624,9 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
 	 */
 	need_scaling = src_w != dst_w || src_h != dst_h;
 
+	if (crtc_state->ycbcr420 && scaler_user == SKL_CRTC_INDEX)
+		need_scaling = true;
+
 	/*
 	 * Scaling/fitting not supported in IF-ID mode in GEN9+
 	 * TODO: Interlace fetch mode doesn't support YUV420 planar formats.
drivers/gpu/drm/i915/intel_hdmi.c +12 -0
index 64bb8cc..6addef5 100644
@@ -1354,6 +1354,8 @@ intel_hdmi_ycbcr420_config(struct drm_connector *connector,
 			       struct intel_crtc_state *config,
 			       int *clock_12bpc, int *clock_8bpc)
 {
+	struct intel_crtc *intel_crtc = to_intel_crtc(config->base.crtc);
+
 	if (!connector->ycbcr_420_allowed) {
 		DRM_ERROR("Platform doesn't support YCBCR420 output\n");
 		return false;
@@ -1364,6 +1366,16 @@ intel_hdmi_ycbcr420_config(struct drm_connector *connector,
 	*clock_12bpc /= 2;
 	*clock_8bpc /= 2;
 	config->ycbcr420 = true;
+
+	/* YCBCR 420 output conversion needs a scaler */
+	if (skl_update_scaler_crtc(config)) {
+		DRM_DEBUG_KMS("Scaler allocation for output failed\n");
+		return false;
+	}
+
+	intel_pch_panel_fitting(intel_crtc, config,
+				DRM_MODE_SCALE_FULLSCREEN);
+
 	return true;
 }
 
drivers/gpu/drm/i915/intel_panel.c +2 -1
index 96c2cbd..fd2e081 100644
@@ -110,7 +110,8 @@ intel_pch_panel_fitting(struct intel_crtc *intel_crtc,
 
 	/* Native modes don't need fitting */
 	if (adjusted_mode->crtc_hdisplay == pipe_config->pipe_src_w &&
-	    adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h)
+	    adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h &&
+	    !pipe_config->ycbcr420)
 		goto done;
 
 	switch (fitting_mode) {
Signature · 1 line
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

PATCH v4 3/6 drm/i915: prepare pipe for YCBCR420 output

In reply to Shashank Sharma

To get HDMI YCBCR420 output, the PIPEMISC register should be programmed to:
- Generate YCBCR output (bit 11)
- In case of YCBCR420 outputs, it should be programmed in full blend mode to use the scaler in 5x3 ratio (bits 26 and 27)

This patch:
- Adds definition of these bits.
- Programs PIPEMISC for YCBCR420 outputs.
- Adds readouts to compare HW and SW states.

V2: rebase
V3: rebase
V4: rebase
V5: added r-b from Ander
V6: Handle only YCBCR420 outputs (ville)
V7: rebase
V8: Addressed review comments from Ville
- Add readouts for state->ycbcr420 and 420 pixel_clock.
- Handle warning due to mismatch in clock for ycbcr420 clock.
- Rename PIPEMISC macros to match the Bspec.
- Add a debug print stating if YCBCR 4:2:0 output enabled. Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |  3 ++
 drivers/gpu/drm/i915/intel_display.c | 55 ++++++++++++++++++++++++++++++++++--
 2 files changed, 55 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index c712d01..6dfcdd3 100644
@@ -5227,6 +5227,9 @@ enum {
 
 #define _PIPE_MISC_A			0x70030
 #define _PIPE_MISC_B			0x71030
+#define   PIPEMISC_YUV420_ENABLE	(1<<27)
+#define   PIPEMISC_YUV420_MODE_BLEND	(1<<26)
+#define   PIPEMISC_OUTPUT_YUV		(1<<11)
 #define   PIPEMISC_DITHER_BPC_MASK	(7<<5)
 #define   PIPEMISC_DITHER_8_BPC		(0<<5)
 #define   PIPEMISC_DITHER_10_BPC	(1<<5)
drivers/gpu/drm/i915/intel_display.c +52 -3

115 lines not on this page · raw message

Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Re: [PATCH v4 3/6] drm/i915: prepare pipe for YCBCR420 output

Quoted 41 lines · Shashank Sharma

To get HDMI YCBCR420 output, the PIPEMISC register should be programmed to:
- Generate YCBCR output (bit 11)
- In case of YCBCR420 outputs, it should be programmed in full blend mode to use the scaler in 5x3 ratio (bits 26 and 27)

This patch:
- Adds definition of these bits.
- Programs PIPEMISC for YCBCR420 outputs.
- Adds readouts to compare HW and SW states.

V2: rebase
V3: rebase
V4: rebase
V5: added r-b from Ander
V6: Handle only YCBCR420 outputs (ville)
V7: rebase
V8: Addressed review comments from Ville
- Add readouts for state->ycbcr420 and 420 pixel_clock.
- Handle warning due to mismatch in clock for ycbcr420 clock.
- Rename PIPEMISC macros to match the Bspec.
- Add a debug print stating if YCBCR 4:2:0 output enabled. Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |  3 ++
 drivers/gpu/drm/i915/intel_display.c | 55 ++++++++++++++++++++++++++++++++++--
 2 files changed, 55 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index c712d01..6dfcdd3 100644

drivers/gpu/drm/i915/i915_reg.h enum { · line 5232

Quoted 6 lines
drivers/gpu/drm/i915/i915_reg.h +3 -0
@@ -5227,6 +5227,9 @@ enum {
 
 #define _PIPE_MISC_A			0x70030
 #define _PIPE_MISC_B			0x71030
+#define   PIPEMISC_YUV420_ENABLE	(1<<27)
+#define   PIPEMISC_YUV420_MODE_BLEND	(1<<26)
+#define   PIPEMISC_OUTPUT_YUV		(1<<11)

Missing the rename here requested by Ville.

drivers/gpu/drm/i915/intel_display.c static uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config) · line 6219

Quoted 12 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
 #define   PIPEMISC_DITHER_BPC_MASK	(7<<5)
 #define   PIPEMISC_DITHER_8_BPC		(0<<5)
 #define   PIPEMISC_DITHER_10_BPC	(1<<5)
drivers/gpu/drm/i915/intel_display.c +0 -1
index d78f1c2..788502a 100644
@@ -6216,7 +6216,6 @@ static uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config)
 	 * We only use IF-ID interlacing. If we ever use
 	 * PF-ID we'll need to adjust the pixel_rate here.
 	 */
-

Extra w/s change.

Quoted 113 lines
drivers/gpu/drm/i915/intel_display.c +51 -2
 	if (pipe_config->pch_pfit.enabled) {
 		uint64_t pipe_w, pipe_h, pfit_w, pfit_h;
 		uint32_t pfit_size = pipe_config->pch_pfit.size;
@@ -8076,6 +8075,7 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
 {
 	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_crtc_state *config = intel_crtc->config;
 
 	if (IS_BROADWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 9) {
 		u32 val = 0;
@@ -8101,6 +8101,12 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
 		if (intel_crtc->config->dither)
 			val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
 
+		if (config->ycbcr420) {
+			val |= PIPEMISC_OUTPUT_YUV |
+				PIPEMISC_YUV420_ENABLE |
+				PIPEMISC_YUV420_MODE_BLEND;
+		}
+
 		I915_WRITE(PIPEMISC(intel_crtc->pipe), val);
 	}
 }
@@ -9170,6 +9176,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
 	}
 
+	if (IS_GEMINILAKE(dev_priv))
+		pipe_config->ycbcr420 = I915_READ(PIPEMISC(crtc->pipe)) &
+					PIPEMISC_YUV420_ENABLE;
+
 	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
 		power_domain_mask |= BIT_ULL(power_domain);
@@ -11377,6 +11387,9 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
 				      pipe_config->fdi_lanes,
 				      &pipe_config->fdi_m_n);
 
+	if (pipe_config->ycbcr420)
+		DRM_DEBUG_KMS("YCbCr 4:2:0 output enabled\n");
+
 	if (intel_crtc_has_dp_encoder(pipe_config)) {
 		intel_dump_m_n_config(pipe_config, "dp m_n",
 				pipe_config->lane_count, &pipe_config->dp_m_n);
@@ -11704,6 +11717,22 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state)
 	}
 }
 
+static bool intel_420_clock_check(int clock1, int clock2)
+{
+	int diff;
+
+	if (clock1 == clock2 * 2)
+		return true;
+
+	clock2 *= 2;
+	diff = abs(clock1 - clock2);
+
+	if (((((diff + clock1 + clock2) * 100)) / (clock1 + clock2)) < 105)
+		return true;
+
+	return false;
+}
+
 static bool intel_fuzzy_clock_check(int clock1, int clock2)
 {
 	int diff;
@@ -11832,6 +11861,18 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 		ret = false; \
 	}
 
+#define PIPE_CONF_CHECK_CLOCK_420(name) \
+	do { \
+		if (!intel_420_clock_check(current_config->name, \
+					   pipe_config->name)) { \
+			pipe_config_err(adjust, __stringify(name), \
+				  "(expected %i, found %i)\n", \
+				  current_config->name, \
+				  pipe_config->name); \
+			ret = false; \
+		} \
+	} while (0)
+
 #define PIPE_CONF_CHECK_M_N(name) \
 	if (!intel_compare_link_m_n(&current_config->name, \
 				    &pipe_config->name,\
@@ -11983,7 +12024,10 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 		}
 
 		PIPE_CONF_CHECK_I(scaler_state.scaler_id);
-		PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
+		if (current_config->ycbcr420)
+			PIPE_CONF_CHECK_CLOCK_420(pixel_rate);
+		else
+			PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
 	}
 
 	/* BDW+ don't expose a synchronous way to read the state */
@@ -12009,7 +12053,11 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 	if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5)
 		PIPE_CONF_CHECK_I(pipe_bpp);
 
-	PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
+	/* YCBCR 420 pixel clock is half of the actual mode */
+	if (current_config->ycbcr420)
+		PIPE_CONF_CHECK_CLOCK_420(base.adjusted_mode.crtc_clock);
+	else
+		PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
 	PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock);
 
 #undef PIPE_CONF_CHECK_X

drivers/gpu/drm/i915/intel_display.c intel_pipe_config_compare(struct drm_i915_private *dev_priv, · line 12069

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -12018,6 +12066,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 #undef PIPE_CONF_CHECK_FLAGS
 #undef PIPE_CONF_CHECK_CLOCK_FUZZY
 #undef PIPE_CONF_QUIRK
+#undef PIPE_CONF_CHECK_CLOCK_420

We don't need to adjust things during compare. The dotclock is 2x the port clock in case of YUV420, so all what's needed is

if (pipe_config->ycbcr420)

	dotclock = pipe_config->port_clock * 2;

in ddi_get_clock() as Ville said.

Also, right now if I boot with these patches all 4k YUV420 modes will be pruned on my monitor. This is caused by the monitor reporting a 300MHz max tmds clock (which is the port clock limit) and the driver comparing this against the dotclock which is double of this. So I needed

if (drm_mode_is_420_only(&connector->display_info, mode))

	clock /= 2;

in intel_hdmi_mode_valid() to preserve these modes. Not sure why this didn't come up earlier.

With that I see the YUV420 modes, but the initial modeset for the fb console will result in the gray screen and some jitter. A following modeset with the same mode will fix things; this is I think what Ville also saw. Still trying to find the reason for this.

--Imre

Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	return ret;
 }
Signature · 1 line
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

Re: [PATCH v4 3/6] drm/i915: prepare pipe for YCBCR420 output

Regards

Shashank

Quoted 43 lines · Imre Deak
Quoted 42 lines · Shashank Sharma

To get HDMI YCBCR420 output, the PIPEMISC register should be programmed to:
- Generate YCBCR output (bit 11)
- In case of YCBCR420 outputs, it should be programmed in full blend mode to use the scaler in 5x3 ratio (bits 26 and 27)

This patch:
- Adds definition of these bits.
- Programs PIPEMISC for YCBCR420 outputs.
- Adds readouts to compare HW and SW states.

V2: rebase
V3: rebase
V4: rebase
V5: added r-b from Ander
V6: Handle only YCBCR420 outputs (ville)
V7: rebase
V8: Addressed review comments from Ville
- Add readouts for state->ycbcr420 and 420 pixel_clock.
- Handle warning due to mismatch in clock for ycbcr420 clock.
- Rename PIPEMISC macros to match the Bspec.
- Add a debug print stating if YCBCR 4:2:0 output enabled. Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Cc Daniel Vetter <[email protected]>
---
  drivers/gpu/drm/i915/i915_reg.h      |  3 ++
  drivers/gpu/drm/i915/intel_display.c | 55 ++++++++++++++++++++++++++++++++++--
  2 files changed, 55 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -0
index c712d01..6dfcdd3 100644
@@ -5227,6 +5227,9 @@ enum {
 
Quoted 6 lines

drivers/gpu/drm/i915/i915_reg.h enum { · line 5232

Quoted 5 lines
drivers/gpu/drm/i915/i915_reg.h +3 -0
  #define _PIPE_MISC_A			0x70030
  #define _PIPE_MISC_B			0x71030
+#define   PIPEMISC_YUV420_ENABLE	(1<<27)
+#define   PIPEMISC_YUV420_MODE_BLEND	(1<<26)
+#define   PIPEMISC_OUTPUT_YUV		(1<<11)

Missing the rename here requested by Ville.

Ah, I thought it was more strict on changing YCBCR->YUV, will get this done.

Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
  #define   PIPEMISC_DITHER_BPC_MASK	(7<<5)
  #define   PIPEMISC_DITHER_8_BPC		(0<<5)
  #define   PIPEMISC_DITHER_10_BPC	(1<<5)
drivers/gpu/drm/i915/intel_display.c +0 -0
index d78f1c2..788502a 100644
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config) · line 6219

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +0 -1
@@ -6216,7 +6216,6 @@ static uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config)
  	 * We only use IF-ID interlacing. If we ever use
  	 * PF-ID we'll need to adjust the pixel_rate here.
  	 */
-

Extra w/s change.

Got it.

Quoted 121 lines
Quoted 114 lines
drivers/gpu/drm/i915/intel_display.c +51 -2
  	if (pipe_config->pch_pfit.enabled) {
  		uint64_t pipe_w, pipe_h, pfit_w, pfit_h;
  		uint32_t pfit_size = pipe_config->pch_pfit.size;
@@ -8076,6 +8075,7 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
  {
  	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_crtc_state *config = intel_crtc->config;
 
  	if (IS_BROADWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 9) {
  		u32 val = 0;
@@ -8101,6 +8101,12 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
  		if (intel_crtc->config->dither)
  			val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
 
+		if (config->ycbcr420) {
+			val |= PIPEMISC_OUTPUT_YUV |
+				PIPEMISC_YUV420_ENABLE |
+				PIPEMISC_YUV420_MODE_BLEND;
+		}
+
  		I915_WRITE(PIPEMISC(intel_crtc->pipe), val);
  	}
  }
@@ -9170,6 +9176,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
  	}
 
+	if (IS_GEMINILAKE(dev_priv))
+		pipe_config->ycbcr420 = I915_READ(PIPEMISC(crtc->pipe)) &
+					PIPEMISC_YUV420_ENABLE;
+
  	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
  	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
  		power_domain_mask |= BIT_ULL(power_domain);
@@ -11377,6 +11387,9 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
  				      pipe_config->fdi_lanes,
  				      &pipe_config->fdi_m_n);
 
+	if (pipe_config->ycbcr420)
+		DRM_DEBUG_KMS("YCbCr 4:2:0 output enabled\n");
+
  	if (intel_crtc_has_dp_encoder(pipe_config)) {
  		intel_dump_m_n_config(pipe_config, "dp m_n",
  				pipe_config->lane_count, &pipe_config->dp_m_n);
@@ -11704,6 +11717,22 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state)
  	}
  }
 
+static bool intel_420_clock_check(int clock1, int clock2)
+{
+	int diff;
+
+	if (clock1 == clock2 * 2)
+		return true;
+
+	clock2 *= 2;
+	diff = abs(clock1 - clock2);
+
+	if (((((diff + clock1 + clock2) * 100)) / (clock1 + clock2)) < 105)
+		return true;
+
+	return false;
+}
+
  static bool intel_fuzzy_clock_check(int clock1, int clock2)
  {
  	int diff;
@@ -11832,6 +11861,18 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  		ret = false; \
  	}
 
+#define PIPE_CONF_CHECK_CLOCK_420(name) \
+	do { \
+		if (!intel_420_clock_check(current_config->name, \
+					   pipe_config->name)) { \
+			pipe_config_err(adjust, __stringify(name), \
+				  "(expected %i, found %i)\n", \
+				  current_config->name, \
+				  pipe_config->name); \
+			ret = false; \
+		} \
+	} while (0)
+
  #define PIPE_CONF_CHECK_M_N(name) \
  	if (!intel_compare_link_m_n(&current_config->name, \
  				    &pipe_config->name,\
@@ -11983,7 +12024,10 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  		}
 
  		PIPE_CONF_CHECK_I(scaler_state.scaler_id);
-		PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
+		if (current_config->ycbcr420)
+			PIPE_CONF_CHECK_CLOCK_420(pixel_rate);
+		else
+			PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
  	}
 
  	/* BDW+ don't expose a synchronous way to read the state */
@@ -12009,7 +12053,11 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  	if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5)
  		PIPE_CONF_CHECK_I(pipe_bpp);
 
-	PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
+	/* YCBCR 420 pixel clock is half of the actual mode */
+	if (current_config->ycbcr420)
+		PIPE_CONF_CHECK_CLOCK_420(base.adjusted_mode.crtc_clock);
+	else
+		PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
  	PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock);
 
  #undef PIPE_CONF_CHECK_X

drivers/gpu/drm/i915/intel_display.c intel_pipe_config_compare(struct drm_i915_private *dev_priv, · line 12069

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -12018,6 +12066,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  #undef PIPE_CONF_CHECK_FLAGS
  #undef PIPE_CONF_CHECK_CLOCK_FUZZY
  #undef PIPE_CONF_QUIRK
+#undef PIPE_CONF_CHECK_CLOCK_420

We don't need to adjust things during compare. The dotclock is 2x the port clock in case of YUV420, so all what's needed is

Quoted 4 lines

if (pipe_config->ycbcr420)

	dotclock = pipe_config->port_clock * 2;

in ddi_get_clock() as Ville said.

Got it,

Quoted 10 lines

Also, right now if I boot with these patches all 4k YUV420 modes will be pruned on my monitor. This is caused by the monitor reporting a 300MHz max tmds clock (which is the port clock limit) and the driver comparing this against the dotclock which is double of this. So I needed

if (drm_mode_is_420_only(&connector->display_info, mode))

	clock /= 2;

in intel_hdmi_mode_valid() to preserve these modes. Not sure why this didn't come up earlier.

Because, when a monitor declares max clock on 300Mhz, it doesn't contain a mode in its EDID which needs clock > 300Mhz, but YCBCR_420 introduces a corner case here, its possible if all the modes with clock > 300Mhz are YCBCR420_only modes. Looks like you got hold of one such monitor, which is HDMI 2.0 but has all its 4k@60 modes as YCBCR420_only, and hence they fit into 300Mhz limit. In any case, its not illegal, and should have been taken care of in code, so thanks for pointing this out. Can you please share the monitor details ? I will see if I have one here in Bangalore.

Quoted 5 lines

With that I see the YUV420 modes, but the initial modeset for the fb console will result in the gray screen and some jitter. A following modeset with the same mode will fix things; this is I think what Ville also saw. Still trying to find the reason for this.

Can you also please check if this is specific to one particular monitor ? I still can't reproduce this issue with my GLK + ACER/SAMSUNG monitors.
- Shashank

Quoted 9 lines

--Imre

Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
  	return ret;
  }
Signature · 1 line
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

Re: [PATCH v4 3/6] drm/i915: prepare pipe for YCBCR420 output

Quoted 193 lines · Shashank

Regards

Shashank

Quoted 37 lines · Imre Deak
Quoted 36 lines · Shashank Sharma

To get HDMI YCBCR420 output, the PIPEMISC register should be programmed to:
- Generate YCBCR output (bit 11)
- In case of YCBCR420 outputs, it should be programmed in full blend mode to use the scaler in 5x3 ratio (bits 26 and 27)

This patch:
- Adds definition of these bits.
- Programs PIPEMISC for YCBCR420 outputs.
- Adds readouts to compare HW and SW states.

V2: rebase
V3: rebase
V4: rebase
V5: added r-b from Ander
V6: Handle only YCBCR420 outputs (ville)
V7: rebase
V8: Addressed review comments from Ville
- Add readouts for state->ycbcr420 and 420 pixel_clock.
- Handle warning due to mismatch in clock for ycbcr420 clock.
- Rename PIPEMISC macros to match the Bspec.
- Add a debug print stating if YCBCR 4:2:0 output enabled. Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Cc Daniel Vetter <[email protected]>
---
  drivers/gpu/drm/i915/i915_reg.h      |  3 ++
  drivers/gpu/drm/i915/intel_display.c | 55 ++++++++++++++++++++++++++++++++++--
  2 files changed, 55 insertions(+), 3 deletions(-)
Quoted 11 lines

drivers/gpu/drm/i915/i915_reg.h enum { · line 5231

Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +3 -0
index c712d01..6dfcdd3 100644
@@ -5227,6 +5227,9 @@ enum {
  #define _PIPE_MISC_A			0x70030
  #define _PIPE_MISC_B			0x71030
+#define   PIPEMISC_YUV420_ENABLE	(1<<27)
+#define   PIPEMISC_YUV420_MODE_BLEND	(1<<26)
+#define   PIPEMISC_OUTPUT_YUV		(1<<11)

Missing the rename here requested by Ville.

Ah, I thought it was more strict on changing YCBCR->YUV, will get this done.

Quoted 5 lines
Quoted 5 lines
drivers/gpu/drm/i915/i915_reg.h +0 -0
  #define   PIPEMISC_DITHER_BPC_MASK	(7<<5)
  #define   PIPEMISC_DITHER_8_BPC		(0<<5)
  #define   PIPEMISC_DITHER_10_BPC	(1<<5)
drivers/gpu/drm/i915/intel_display.c +0 -0
index d78f1c2..788502a 100644
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config) · line 6219

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +0 -1
@@ -6216,7 +6216,6 @@ static uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config)
  	 * We only use IF-ID interlacing. If we ever use
  	 * PF-ID we'll need to adjust the pixel_rate here.
  	 */
-

Extra w/s change.

Got it.

Quoted 111 lines
Quoted 104 lines
drivers/gpu/drm/i915/intel_display.c +51 -2
  	if (pipe_config->pch_pfit.enabled) {
  		uint64_t pipe_w, pipe_h, pfit_w, pfit_h;
  		uint32_t pfit_size = pipe_config->pch_pfit.size;
@@ -8076,6 +8075,7 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
  {
  	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
  	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_crtc_state *config = intel_crtc->config;
  	if (IS_BROADWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 9) {
  		u32 val = 0;
@@ -8101,6 +8101,12 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
  		if (intel_crtc->config->dither)
  			val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
+		if (config->ycbcr420) {
+			val |= PIPEMISC_OUTPUT_YUV |
+				PIPEMISC_YUV420_ENABLE |
+				PIPEMISC_YUV420_MODE_BLEND;
+		}
+
  		I915_WRITE(PIPEMISC(intel_crtc->pipe), val);
  	}
  }
@@ -9170,6 +9176,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
  	}
+	if (IS_GEMINILAKE(dev_priv))
+		pipe_config->ycbcr420 = I915_READ(PIPEMISC(crtc->pipe)) &
+					PIPEMISC_YUV420_ENABLE;
+
  	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
  	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
  		power_domain_mask |= BIT_ULL(power_domain);
@@ -11377,6 +11387,9 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
  				      pipe_config->fdi_lanes,
  				      &pipe_config->fdi_m_n);
+	if (pipe_config->ycbcr420)
+		DRM_DEBUG_KMS("YCbCr 4:2:0 output enabled\n");
+
  	if (intel_crtc_has_dp_encoder(pipe_config)) {
  		intel_dump_m_n_config(pipe_config, "dp m_n",
  				pipe_config->lane_count, &pipe_config->dp_m_n);
@@ -11704,6 +11717,22 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state)
  	}
  }
+static bool intel_420_clock_check(int clock1, int clock2)
+{
+	int diff;
+
+	if (clock1 == clock2 * 2)
+		return true;
+
+	clock2 *= 2;
+	diff = abs(clock1 - clock2);
+
+	if (((((diff + clock1 + clock2) * 100)) / (clock1 + clock2)) < 105)
+		return true;
+
+	return false;
+}
+
  static bool intel_fuzzy_clock_check(int clock1, int clock2)
  {
  	int diff;
@@ -11832,6 +11861,18 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  		ret = false; \
  	}
+#define PIPE_CONF_CHECK_CLOCK_420(name) \
+	do { \
+		if (!intel_420_clock_check(current_config->name, \
+					   pipe_config->name)) { \
+			pipe_config_err(adjust, __stringify(name), \
+				  "(expected %i, found %i)\n", \
+				  current_config->name, \
+				  pipe_config->name); \
+			ret = false; \
+		} \
+	} while (0)
+
  #define PIPE_CONF_CHECK_M_N(name) \
  	if (!intel_compare_link_m_n(&current_config->name, \
  				    &pipe_config->name,\
@@ -11983,7 +12024,10 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  		}
  		PIPE_CONF_CHECK_I(scaler_state.scaler_id);
-		PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
+		if (current_config->ycbcr420)
+			PIPE_CONF_CHECK_CLOCK_420(pixel_rate);
+		else
+			PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
  	}
  	/* BDW+ don't expose a synchronous way to read the state */
@@ -12009,7 +12053,11 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  	if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5)
  		PIPE_CONF_CHECK_I(pipe_bpp);
-	PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
+	/* YCBCR 420 pixel clock is half of the actual mode */
+	if (current_config->ycbcr420)
+		PIPE_CONF_CHECK_CLOCK_420(base.adjusted_mode.crtc_clock);
+	else
+		PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
  	PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock);
  #undef PIPE_CONF_CHECK_X

drivers/gpu/drm/i915/intel_display.c intel_pipe_config_compare(struct drm_i915_private *dev_priv, · line 12069

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -0
@@ -12018,6 +12066,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
  #undef PIPE_CONF_CHECK_FLAGS
  #undef PIPE_CONF_CHECK_CLOCK_FUZZY
  #undef PIPE_CONF_QUIRK
+#undef PIPE_CONF_CHECK_CLOCK_420

We don't need to adjust things during compare. The dotclock is 2x the port clock in case of YUV420, so all what's needed is

Quoted 4 lines

if (pipe_config->ycbcr420)

	dotclock = pipe_config->port_clock * 2;

in ddi_get_clock() as Ville said.

Got it,

Quoted 8 lines

Also, right now if I boot with these patches all 4k YUV420 modes will be pruned on my monitor. This is caused by the monitor reporting a 300MHz max tmds clock (which is the port clock limit) and the driver comparing this against the dotclock which is double of this. So I needed

if (drm_mode_is_420_only(&connector->display_info, mode))

	clock /= 2;
Quoted 6 lines
Quoted 2 lines

in intel_hdmi_mode_valid() to preserve these modes. Not sure why this didn't come up earlier.

Because, when a monitor declares max clock on 300Mhz, it doesn't contain a mode in its EDID which needs clock > 300Mhz, but YCBCR_420 introduces a corner case here, its possible if all the modes with clock > 300Mhz are YCBCR420_only modes.

Well, Ville was using the same montior. In any case looks like we just need the above adjustment in intel_hdmi_mode_valid() then.

Quoted 6 lines

Looks like you got hold of one such monitor, which is HDMI 2.0 but has all its 4k@60 modes as YCBCR420_only, and hence they fit into 300Mhz limit. In any case, its not illegal, and should have been taken care of in code, so thanks for pointing this out.
Can you please share the monitor details ? I will see if I have one here in Bangalore.

It's a Samsung monitor with 4096x2160@60Hz and 3840x2400@60Hz modes. The dotclock for these is ~600MHz while the portclock is half of this. They are also YUV420 only modes, so yes, that is where the 300MHz limit comes from.

Quoted 7 lines
Quoted 5 lines

With that I see the YUV420 modes, but the initial modeset for the fb console will result in the gray screen and some jitter. A following modeset with the same mode will fix things; this is I think what Ville also saw. Still trying to find the reason for this.

Can you also please check if this is specific to one particular monitor ? I still can't reproduce this issue with my GLK + ACER/SAMSUNG monitors.

Not sure if I have any other monitor with YUV420 formats, I will do some more debugging tomorrow.

--Imre

Quoted 10 lines

- Shashank

Quoted 8 lines

--Imre

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
  	return ret;
  }
Signature · 1 line
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

Re: [PATCH v4 3/6] drm/i915: prepare pipe for YCBCR420 output

In reply to Shashank Sharma
Quoted 84 lines · Shashank Sharma

To get HDMI YCBCR420 output, the PIPEMISC register should be programmed to:
- Generate YCBCR output (bit 11)
- In case of YCBCR420 outputs, it should be programmed in full blend mode to use the scaler in 5x3 ratio (bits 26 and 27)

This patch:
- Adds definition of these bits.
- Programs PIPEMISC for YCBCR420 outputs.
- Adds readouts to compare HW and SW states.

V2: rebase
V3: rebase
V4: rebase
V5: added r-b from Ander
V6: Handle only YCBCR420 outputs (ville)
V7: rebase
V8: Addressed review comments from Ville
- Add readouts for state->ycbcr420 and 420 pixel_clock.
- Handle warning due to mismatch in clock for ycbcr420 clock.
- Rename PIPEMISC macros to match the Bspec.
- Add a debug print stating if YCBCR 4:2:0 output enabled. Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/i915/i915_reg.h      |  3 ++
 drivers/gpu/drm/i915/intel_display.c | 55 ++++++++++++++++++++++++++++++++++--
 2 files changed, 55 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +3 -0
index c712d01..6dfcdd3 100644
@@ -5227,6 +5227,9 @@ enum {
 
 #define _PIPE_MISC_A			0x70030
 #define _PIPE_MISC_B			0x71030
+#define   PIPEMISC_YUV420_ENABLE	(1<<27)
+#define   PIPEMISC_YUV420_MODE_BLEND	(1<<26)
+#define   PIPEMISC_OUTPUT_YUV		(1<<11)
 #define   PIPEMISC_DITHER_BPC_MASK	(7<<5)
 #define   PIPEMISC_DITHER_8_BPC		(0<<5)
 #define   PIPEMISC_DITHER_10_BPC	(1<<5)
drivers/gpu/drm/i915/intel_display.c +7 -1
index d78f1c2..788502a 100644
@@ -6216,7 +6216,6 @@ static uint32_t ilk_pipe_pixel_rate(const struct intel_crtc_state *pipe_config)
 	 * We only use IF-ID interlacing. If we ever use
 	 * PF-ID we'll need to adjust the pixel_rate here.
 	 */
-
 	if (pipe_config->pch_pfit.enabled) {
 		uint64_t pipe_w, pipe_h, pfit_w, pfit_h;
 		uint32_t pfit_size = pipe_config->pch_pfit.size;
@@ -8076,6 +8075,7 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
 {
 	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+	struct intel_crtc_state *config = intel_crtc->config;
 
 	if (IS_BROADWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 9) {
 		u32 val = 0;
@@ -8101,6 +8101,12 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
 		if (intel_crtc->config->dither)
 			val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
 
+		if (config->ycbcr420) {
+			val |= PIPEMISC_OUTPUT_YUV |
+				PIPEMISC_YUV420_ENABLE |
+				PIPEMISC_YUV420_MODE_BLEND;
+		}
+
 		I915_WRITE(PIPEMISC(intel_crtc->pipe), val);
 	}
 }

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 9182

Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -9170,6 +9176,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
 	}
 
+	if (IS_GEMINILAKE(dev_priv))
+		pipe_config->ycbcr420 = I915_READ(PIPEMISC(crtc->pipe)) &
+					PIPEMISC_YUV420_ENABLE;
+

Besides my previous comments on this patch: I don't see any problem of handling the other platforms too as Ville suggested, even if only YUV420 is supported atm and even if only on GLK. It gives fastboot a chance to work on those platforms too and additional debug info if they happen to boot with a YUV420 mode. Also would be good to print at least a note for modes that we don't support or are invalid:

if (IS_BDW || GEN >= 9) {
	tmp = READ(PIPEMISC);
	if (IS_GLK || GEN >= 10) {
		crtc_state->ycbcr420 = tmp & YUV420_ENABLE;
		if (crtc_state->ycbcr420 != !!(tmp & OUTPUT_COLORSPACE_YUV) ||
		    crtc_state->ycbcr420 != !!(tmp & YUV420_MODE_FULL_BLEND))
			DRM_DEBUG_KMS("Unsupported/invalid YCbCr 420 mode (%08x)\n", tmp);
	} else if (tmp & OUTPUT_COLORSPACE_YUV) {
		DRM_DEBUG_KMS("Unsupported YCbCr mode\n");
	}
}
Quoted 91 lines
drivers/gpu/drm/i915/intel_display.c +41 -2
 	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
 		power_domain_mask |= BIT_ULL(power_domain);
@@ -11377,6 +11387,9 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
 				      pipe_config->fdi_lanes,
 				      &pipe_config->fdi_m_n);
 
+	if (pipe_config->ycbcr420)
+		DRM_DEBUG_KMS("YCbCr 4:2:0 output enabled\n");
+
 	if (intel_crtc_has_dp_encoder(pipe_config)) {
 		intel_dump_m_n_config(pipe_config, "dp m_n",
 				pipe_config->lane_count, &pipe_config->dp_m_n);
@@ -11704,6 +11717,22 @@ intel_modeset_update_crtc_state(struct drm_atomic_state *state)
 	}
 }
 
+static bool intel_420_clock_check(int clock1, int clock2)
+{
+	int diff;
+
+	if (clock1 == clock2 * 2)
+		return true;
+
+	clock2 *= 2;
+	diff = abs(clock1 - clock2);
+
+	if (((((diff + clock1 + clock2) * 100)) / (clock1 + clock2)) < 105)
+		return true;
+
+	return false;
+}
+
 static bool intel_fuzzy_clock_check(int clock1, int clock2)
 {
 	int diff;
@@ -11832,6 +11861,18 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 		ret = false; \
 	}
 
+#define PIPE_CONF_CHECK_CLOCK_420(name) \
+	do { \
+		if (!intel_420_clock_check(current_config->name, \
+					   pipe_config->name)) { \
+			pipe_config_err(adjust, __stringify(name), \
+				  "(expected %i, found %i)\n", \
+				  current_config->name, \
+				  pipe_config->name); \
+			ret = false; \
+		} \
+	} while (0)
+
 #define PIPE_CONF_CHECK_M_N(name) \
 	if (!intel_compare_link_m_n(&current_config->name, \
 				    &pipe_config->name,\
@@ -11983,7 +12024,10 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 		}
 
 		PIPE_CONF_CHECK_I(scaler_state.scaler_id);
-		PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
+		if (current_config->ycbcr420)
+			PIPE_CONF_CHECK_CLOCK_420(pixel_rate);
+		else
+			PIPE_CONF_CHECK_CLOCK_FUZZY(pixel_rate);
 	}
 
 	/* BDW+ don't expose a synchronous way to read the state */
@@ -12009,7 +12053,11 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 	if (IS_G4X(dev_priv) || INTEL_GEN(dev_priv) >= 5)
 		PIPE_CONF_CHECK_I(pipe_bpp);
 
-	PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
+	/* YCBCR 420 pixel clock is half of the actual mode */
+	if (current_config->ycbcr420)
+		PIPE_CONF_CHECK_CLOCK_420(base.adjusted_mode.crtc_clock);
+	else
+		PIPE_CONF_CHECK_CLOCK_FUZZY(base.adjusted_mode.crtc_clock);
 	PIPE_CONF_CHECK_CLOCK_FUZZY(port_clock);
 
 #undef PIPE_CONF_CHECK_X
@@ -12018,6 +12066,7 @@ intel_pipe_config_compare(struct drm_i915_private *dev_priv,
 #undef PIPE_CONF_CHECK_FLAGS
 #undef PIPE_CONF_CHECK_CLOCK_FUZZY
 #undef PIPE_CONF_QUIRK
+#undef PIPE_CONF_CHECK_CLOCK_420
 
 	return ret;
 }
Signature · 1 line
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw

PATCH v4 4/6 drm/i915: prepare csc unit for YCBCR420 output

In reply to Shashank Sharma

To support ycbcr output, we need a pipe CSC block to do RGB->YCBCR conversion.

Current Intel platforms have only one pipe CSC unit, so we can either do color correction using it, or we can perform RGB->YCBCR conversion.

This function adds a csc handler, which uses recommended bspec values to perform RGB->YCBCR conversion (target color space BT709)

V2: Rebase
V3: Rebase
V4: Rebase
V5: Addressed review comments from Ander
- Remove extra line added in the patch
- Add the spec details in the commit message
- Combine two if(cond) while calling intel_crtc_compute_config
V6: Handle YCBCR420 outputs only (Ville)
V7: Addressed review comments from Ville:
- Add description about target colorspace
- Remove the comments from CSC function
- DRM_DEBUG->DEBUG_KMS for atomic failure due to CSC unit busy
- Remove unnecessary debug message about YCBCR420 possibe
V8: Addressed review comments from Ville:
- Remove extra comment, not required.
- Do not add extra variable for CTM, reuse pipe_config Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_color.c   | 46 +++++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/intel_display.c | 11 +++++++++
 2 files changed, 56 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_color.c +45 -1
index f85d575..8698691 100644
@@ -41,6 +41,22 @@
 
 #define LEGACY_LUT_LENGTH		(sizeof(struct drm_color_lut) * 256)
 
+/* Post offset values for RGB->YCBCR conversion */
+#define POSTOFF_RGB_TO_YUV_HI 0x800
+#define POSTOFF_RGB_TO_YUV_ME 0x100
+#define POSTOFF_RGB_TO_YUV_LO 0x800
+
+/*
+ * These values are direct register values specified in the Bspec,
+ * for RGB->YUV conversion matrix (colorspace BT709)
+ */
+#define CSC_RGB_TO_YUV_RU_GU 0x2ba809d8
+#define CSC_RGB_TO_YUV_BU 0x37e80000
+#define CSC_RGB_TO_YUV_RY_GY 0x1e089cc0
+#define CSC_RGB_TO_YUV_BY 0xb5280000
+#define CSC_RGB_TO_YUV_RV_GV 0xbce89ad8
+#define CSC_RGB_TO_YUV_BV 0x1e080000
+
 /*
  * Extract the CSC coefficient from a CTM coefficient (in U32.32 fixed point
  * format). This macro takes the coefficient we want transformed and the
@@ -91,6 +107,31 @@ static void ctm_mult_by_limited(uint64_t *result, int64_t *input)
 	}
 }
 
+void i9xx_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc)
+{
+	int pipe = intel_crtc->pipe;
+	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
+
+
+	I915_WRITE(PIPE_CSC_PREOFF_HI(pipe), 0);
+	I915_WRITE(PIPE_CSC_PREOFF_ME(pipe), 0);
+	I915_WRITE(PIPE_CSC_PREOFF_LO(pipe), 0);
+
+	I915_WRITE(PIPE_CSC_COEFF_RU_GU(pipe), CSC_RGB_TO_YUV_RU_GU);
+	I915_WRITE(PIPE_CSC_COEFF_BU(pipe), CSC_RGB_TO_YUV_BU);
+
+	I915_WRITE(PIPE_CSC_COEFF_RY_GY(pipe), CSC_RGB_TO_YUV_RY_GY);
+	I915_WRITE(PIPE_CSC_COEFF_BY(pipe), CSC_RGB_TO_YUV_BY);
+
+	I915_WRITE(PIPE_CSC_COEFF_RV_GV(pipe), CSC_RGB_TO_YUV_RV_GV);
+	I915_WRITE(PIPE_CSC_COEFF_BV(pipe), CSC_RGB_TO_YUV_BV);
+
+	I915_WRITE(PIPE_CSC_POSTOFF_HI(pipe), POSTOFF_RGB_TO_YUV_HI);
+	I915_WRITE(PIPE_CSC_POSTOFF_ME(pipe), POSTOFF_RGB_TO_YUV_ME);
+	I915_WRITE(PIPE_CSC_POSTOFF_LO(pipe), POSTOFF_RGB_TO_YUV_LO);
+	I915_WRITE(PIPE_CSC_MODE(pipe), 0);
+}
+
 /* Set up the pipe CSC unit. */
 static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
 {
@@ -101,7 +142,10 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
 	uint16_t coeffs[9] = { 0, };
 	struct intel_crtc_state *intel_crtc_state = to_intel_crtc_state(crtc_state);
 
-	if (crtc_state->ctm) {
+	if (intel_crtc_state->ycbcr420) {
+		i9xx_load_ycbcr_conversion_matrix(intel_crtc);
+		return;
+	} else if (crtc_state->ctm) {
 		struct drm_color_ctm *ctm =
 			(struct drm_color_ctm *)crtc_state->ctm->data;
 		uint64_t input[9] = { 0, };
drivers/gpu/drm/i915/intel_display.c +11 -0
index 788502a..fb60811 100644
@@ -6282,6 +6282,17 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
 		return -EINVAL;
 	}
 
+	if (pipe_config->ycbcr420 && pipe_config->base.ctm) {
+
+		/*
+		 * There is only one pipe CSC unit per pipe, and we need that
+		 * for output conversion from RGB->YCBCR. So if CTM is already
+		 * applied we can't support YCBCR420 output.
+		 */
+		DRM_DEBUG_KMS("YCBCR420 and CTM together are not possible\n");
+		return -EINVAL;
+	}
+
 	/*
 	 * Pipe horizontal size must be even in:
 	 * - DVO ganged mode
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

Re: [PATCH v4 4/6] drm/i915: prepare csc unit for YCBCR420 output

Quoted 67 lines · Shashank Sharma

To support ycbcr output, we need a pipe CSC block to do RGB->YCBCR conversion.

Current Intel platforms have only one pipe CSC unit, so we can either do color correction using it, or we can perform RGB->YCBCR conversion.

This function adds a csc handler, which uses recommended bspec values to perform RGB->YCBCR conversion (target color space BT709)

V2: Rebase
V3: Rebase
V4: Rebase
V5: Addressed review comments from Ander
- Remove extra line added in the patch
- Add the spec details in the commit message
- Combine two if(cond) while calling intel_crtc_compute_config
V6: Handle YCBCR420 outputs only (Ville)
V7: Addressed review comments from Ville:
- Add description about target colorspace
- Remove the comments from CSC function
- DRM_DEBUG->DEBUG_KMS for atomic failure due to CSC unit busy
- Remove unnecessary debug message about YCBCR420 possibe
V8: Addressed review comments from Ville:
- Remove extra comment, not required.
- Do not add extra variable for CTM, reuse pipe_config Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_color.c   | 46 +++++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/i915/intel_display.c | 11 +++++++++
 2 files changed, 56 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_color.c +16 -0
index f85d575..8698691 100644
@@ -41,6 +41,22 @@
 
 #define LEGACY_LUT_LENGTH		(sizeof(struct drm_color_lut) * 256)
 
+/* Post offset values for RGB->YCBCR conversion */
+#define POSTOFF_RGB_TO_YUV_HI 0x800
+#define POSTOFF_RGB_TO_YUV_ME 0x100
+#define POSTOFF_RGB_TO_YUV_LO 0x800
+
+/*
+ * These values are direct register values specified in the Bspec,
+ * for RGB->YUV conversion matrix (colorspace BT709)
+ */
+#define CSC_RGB_TO_YUV_RU_GU 0x2ba809d8
+#define CSC_RGB_TO_YUV_BU 0x37e80000
+#define CSC_RGB_TO_YUV_RY_GY 0x1e089cc0
+#define CSC_RGB_TO_YUV_BY 0xb5280000
+#define CSC_RGB_TO_YUV_RV_GV 0xbce89ad8
+#define CSC_RGB_TO_YUV_BV 0x1e080000
+
 /*
  * Extract the CSC coefficient from a CTM coefficient (in U32.32 fixed point
  * format). This macro takes the coefficient we want transformed and the

drivers/gpu/drm/i915/intel_color.c static void ctm_mult_by_limited(uint64_t *result, int64_t *input) · line 115

Quoted 9 lines
drivers/gpu/drm/i915/intel_color.c +6 -0
@@ -91,6 +107,31 @@ static void ctm_mult_by_limited(uint64_t *result, int64_t *input)
 	}
 }
 
+void i9xx_load_ycbcr_conversion_matrix(struct intel_crtc *intel_crtc)
+{
+	int pipe = intel_crtc->pipe;
+	struct drm_i915_private *dev_priv = to_i915(intel_crtc->base.dev);
+
+

Extra w/s.

Quoted 39 lines
drivers/gpu/drm/i915/intel_color.c +23 -1
+	I915_WRITE(PIPE_CSC_PREOFF_HI(pipe), 0);
+	I915_WRITE(PIPE_CSC_PREOFF_ME(pipe), 0);
+	I915_WRITE(PIPE_CSC_PREOFF_LO(pipe), 0);
+
+	I915_WRITE(PIPE_CSC_COEFF_RU_GU(pipe), CSC_RGB_TO_YUV_RU_GU);
+	I915_WRITE(PIPE_CSC_COEFF_BU(pipe), CSC_RGB_TO_YUV_BU);
+
+	I915_WRITE(PIPE_CSC_COEFF_RY_GY(pipe), CSC_RGB_TO_YUV_RY_GY);
+	I915_WRITE(PIPE_CSC_COEFF_BY(pipe), CSC_RGB_TO_YUV_BY);
+
+	I915_WRITE(PIPE_CSC_COEFF_RV_GV(pipe), CSC_RGB_TO_YUV_RV_GV);
+	I915_WRITE(PIPE_CSC_COEFF_BV(pipe), CSC_RGB_TO_YUV_BV);
+
+	I915_WRITE(PIPE_CSC_POSTOFF_HI(pipe), POSTOFF_RGB_TO_YUV_HI);
+	I915_WRITE(PIPE_CSC_POSTOFF_ME(pipe), POSTOFF_RGB_TO_YUV_ME);
+	I915_WRITE(PIPE_CSC_POSTOFF_LO(pipe), POSTOFF_RGB_TO_YUV_LO);
+	I915_WRITE(PIPE_CSC_MODE(pipe), 0);
+}
+
 /* Set up the pipe CSC unit. */
 static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
 {
@@ -101,7 +142,10 @@ static void i9xx_load_csc_matrix(struct drm_crtc_state *crtc_state)
 	uint16_t coeffs[9] = { 0, };
 	struct intel_crtc_state *intel_crtc_state = to_intel_crtc_state(crtc_state);
 
-	if (crtc_state->ctm) {
+	if (intel_crtc_state->ycbcr420) {
+		i9xx_load_ycbcr_conversion_matrix(intel_crtc);
+		return;
+	} else if (crtc_state->ctm) {
 		struct drm_color_ctm *ctm =
 			(struct drm_color_ctm *)crtc_state->ctm->data;
 		uint64_t input[9] = { 0, };
drivers/gpu/drm/i915/intel_display.c +0 -0
index 788502a..fb60811 100644

drivers/gpu/drm/i915/intel_display.c static int intel_crtc_compute_config(struct intel_crtc *crtc, · line 6286

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
@@ -6282,6 +6282,17 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,
 		return -EINVAL;
 	}
 
+	if (pipe_config->ycbcr420 && pipe_config->base.ctm) {
+

Extra w/s.

Quoted 15 lines
drivers/gpu/drm/i915/intel_display.c +9 -0
+		/*
+		 * There is only one pipe CSC unit per pipe, and we need that
+		 * for output conversion from RGB->YCBCR. So if CTM is already
+		 * applied we can't support YCBCR420 output.
+		 */
+		DRM_DEBUG_KMS("YCBCR420 and CTM together are not possible\n");
+		return -EINVAL;
+	}
+
 	/*
 	 * Pipe horizontal size must be even in:
 	 * - DVO ganged mode
Signature · 1 line
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw

PATCH v4 5/6 drm/i915: set colorspace for YCBCR420 outputs

In reply to Shashank Sharma

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)
V7: Add colorspace info in driver(not drm layer) (Ville)
V8: Rebase
V9: Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/intel_hdmi.c +6 -0
index 6addef5..bedc6eb 100644
@@ -472,12 +472,18 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
 		return;
 	}
 
+	if (crtc_state->ycbcr420)
+		frame.avi.colorspace = HDMI_COLORSPACE_YUV420;
+	else
+		frame.avi.colorspace = HDMI_COLORSPACE_RGB;
+
 	drm_hdmi_avi_infoframe_quant_range(&frame.avi, adjusted_mode,
 					   crtc_state->limited_color_range ?
 					   HDMI_QUANTIZATION_RANGE_LIMITED :
 					   HDMI_QUANTIZATION_RANGE_FULL,
 					   intel_hdmi->rgb_quant_range_selectable);
 
+	/* TODO: handle pixel repetition for YCBCR420 outputs */
 	intel_write_infoframe(encoder, crtc_state, &frame);
 }
 
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

PATCH v4 6/6 drm/i915/glk: set HDMI 2.0 identifier

In reply to Shashank Sharma

This patch sets the is_hdmi2_src identifier in drm connector for GLK platform. GLK contains a native HDMI 2.0 controller. This identifier will help the EDID handling functions to save lot of work which is specific to HDMI 2.0 sources.

V3: Added this patch
V4: Rebase
V4: Rebase
V5: Added r-b from Ander
V6: Rebase
V7: Rebase
V8: Rebase
V9: Added r-b from Ville

Cc Ville Syrjala <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_hdmi.c +3 -0
index bedc6eb..7e103b7 100644
@@ -1914,6 +1914,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
 	connector->doublescan_allowed = 0;
 	connector->stereo_allowed = 1;
 
+	if (IS_GEMINILAKE(dev_priv))
+		connector->ycbcr_420_allowed = true;
+
 	intel_hdmi->ddc_bus = intel_hdmi_ddc_pin(dev_priv, port);
 
 	switch (port) {
Signature · 6 lines
2.7.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

✓ Fi.CI.BAT: success for YCBCR 4:2:0 handling in i915 layer

In reply to Shashank Sharma
== Series Details ==

== Series Details ==

Series: YCBCR 4:2:0 handling in i915 layer
URL : https://patchwork.freedesktop.org/series/27412/
State : success

== Summary ==

Series 27412v1 YCBCR 4:2:0 handling in i915 layer
https://patchwork.freedesktop.org/api/1.0/series/27412/revisions/1/mbox/

Test gem_exec_suspend:

        Subgroup basic-s4-devices:
                dmesg-warn -> PASS       (fi-kbl-7560u) k.org#196399
Test kms_cursor_legacy:
        Subgroup basic-busy-flip-before-cursor-atomic:
                fail       -> PASS       (fi-snb-2600) fdo#100215
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-pnv-d510) fdo#101597
        Subgroup suspend-read-crc-pipe-b:
                pass       -> DMESG-WARN (fi-byt-j1900) fdo#101705

k.org#196399 https://bugzilla.kernel.org/show_bug.cgi?id=196399
fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101597 https://bugs.freedesktop.org/show_bug.cgi?id=101597
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:443s
fi-bdw-gvtdvm    total:279  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:431s
fi-blb-e6850     total:279  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:351s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:521s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:507s
fi-byt-j1900     total:279  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:489s
fi-byt-n2820     total:279  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:482s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:593s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:434s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:417s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:426s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:500s
fi-ivb-3770      total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:472s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:462s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:574s
fi-kbl-r         total:279  pass:260  dwarn:1   dfail:0   fail:0   skip:18  time:584s
fi-pnv-d510      total:279  pass:222  dwarn:2   dfail:0   fail:0   skip:55  time:559s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:457s
fi-skl-6700hq    total:279  pass:262  dwarn:0   dfail:0   fail:0   skip:17  time:583s
fi-skl-6700k     total:279  pass:257  dwarn:4   dfail:0   fail:0   skip:18  time:468s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:484s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:437s
fi-skl-x1585l    total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:479s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:541s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:407s

d93246177cf41d1731dae587923544b7a28659a6 drm-tip: 2017y-07m-17d-11h-27m-05s UTC integration manifest 12c2f27 drm/i915/glk: set HDMI 2.0 identifier
f75c4bf drm/i915: set colorspace for YCBCR420 outputs
5306c52 drm/i915: prepare csc unit for YCBCR420 output
a0f0ce3 drm/i915: prepare pipe for YCBCR420 output
d00f31e drm/i915: prepare scaler for YCBCR420 modeset
2df8924 drm/i915: add config function for YCBCR420 outputs

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_5211/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx