diff mbox series

[3/6] drm/i915: Move platform checks into intel_hdmi_bpc_possible()

Message ID 20210511160532.21446-4-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Check HDMI sink deep color capabilities during .mode_valid() | expand

Commit Message

Ville Syrjälä May 11, 2021, 4:05 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Let's put the platform checks into intel_hdmi_bpc_possible() so that
it'll confirm both the source and sink capabilities.

Cc: Werner Sembach <wse@tuxedocomputers.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdmi.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

Comments

Souza, Jose May 14, 2021, 5:33 p.m. UTC | #1
On Tue, 2021-05-11 at 19:05 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Let's put the platform checks into intel_hdmi_bpc_possible() so that
> it'll confirm both the source and sink capabilities.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> 
> Cc: Werner Sembach <wse@tuxedocomputers.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdmi.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
> index e696766f2b4b..56ac53eab90c 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
> @@ -1865,11 +1865,15 @@ static int intel_hdmi_port_clock(int clock, int bpc)
>  static bool intel_hdmi_bpc_possible(struct drm_connector *connector,
>  				    int bpc, bool has_hdmi_sink, bool ycbcr420_output)
>  {
> +	struct drm_i915_private *i915 = to_i915(connector->dev);
>  	const struct drm_display_info *info = &connector->display_info;
>  	const struct drm_hdmi_info *hdmi = &info->hdmi;
>  
>  	switch (bpc) {
>  	case 12:
> +		if (HAS_GMCH(i915))
> +			return false;
> +
>  		if (!has_hdmi_sink)
>  			return false;
>  
> @@ -1878,6 +1882,9 @@ static bool intel_hdmi_bpc_possible(struct drm_connector *connector,
>  		else
>  			return info->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_36;
>  	case 10:
> +		if (DISPLAY_VER(i915) < 11)
> +			return false;
> +
>  		if (!has_hdmi_sink)
>  			return false;
>  
> @@ -1997,12 +2004,6 @@ static bool hdmi_deep_color_possible(const struct intel_crtc_state *crtc_state,
>  	const struct drm_display_mode *adjusted_mode =
>  		&crtc_state->hw.adjusted_mode;
>  
> -	if (HAS_GMCH(dev_priv))
> -		return false;
> -
> -	if (bpc == 10 && DISPLAY_VER(dev_priv) < 11)
> -		return false;
> -
>  	/*
>  	 * HDMI deep color affects the clocks, so it's only possible
>  	 * when not cloning with other encoder types.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c
index e696766f2b4b..56ac53eab90c 100644
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
@@ -1865,11 +1865,15 @@  static int intel_hdmi_port_clock(int clock, int bpc)
 static bool intel_hdmi_bpc_possible(struct drm_connector *connector,
 				    int bpc, bool has_hdmi_sink, bool ycbcr420_output)
 {
+	struct drm_i915_private *i915 = to_i915(connector->dev);
 	const struct drm_display_info *info = &connector->display_info;
 	const struct drm_hdmi_info *hdmi = &info->hdmi;
 
 	switch (bpc) {
 	case 12:
+		if (HAS_GMCH(i915))
+			return false;
+
 		if (!has_hdmi_sink)
 			return false;
 
@@ -1878,6 +1882,9 @@  static bool intel_hdmi_bpc_possible(struct drm_connector *connector,
 		else
 			return info->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_36;
 	case 10:
+		if (DISPLAY_VER(i915) < 11)
+			return false;
+
 		if (!has_hdmi_sink)
 			return false;
 
@@ -1997,12 +2004,6 @@  static bool hdmi_deep_color_possible(const struct intel_crtc_state *crtc_state,
 	const struct drm_display_mode *adjusted_mode =
 		&crtc_state->hw.adjusted_mode;
 
-	if (HAS_GMCH(dev_priv))
-		return false;
-
-	if (bpc == 10 && DISPLAY_VER(dev_priv) < 11)
-		return false;
-
 	/*
 	 * HDMI deep color affects the clocks, so it's only possible
 	 * when not cloning with other encoder types.