diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2021-05-11 19:05:30 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2021-05-26 17:56:19 +0300 |
commit | d21d7a9d1020ec36bf8622b47ac43c8e64cb33f6 (patch) | |
tree | a3bccd21260a76cae1ab4df8490bec0eeade287e | |
parent | 41828125acd649a2a54393b6534cbb5c1bd7bfa6 (diff) | |
download | linux-d21d7a9d1020ec36bf8622b47ac43c8e64cb33f6.tar.bz2 |
drm/i915: Check sink deep color capabilitis during HDMI .mode_valid()
Currently HDMI .mode_valid() only checks whether the source can do
deep color. Let's check whether the sink can do it as well.
Cc: Werner Sembach <wse@tuxedocomputers.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210511160532.21446-5-ville.syrjala@linux.intel.com
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/display/intel_hdmi.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index 0ba0e48f23e2..aa8198b3abe2 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -1904,10 +1904,10 @@ static bool intel_hdmi_bpc_possible(struct drm_connector *connector, } static enum drm_mode_status -intel_hdmi_mode_clock_valid(struct intel_hdmi *hdmi, int clock, bool has_hdmi_sink) +intel_hdmi_mode_clock_valid(struct drm_connector *connector, int clock, + bool has_hdmi_sink, bool ycbcr420_output) { - struct drm_device *dev = intel_hdmi_to_dev(hdmi); - struct drm_i915_private *dev_priv = to_i915(dev); + struct intel_hdmi *hdmi = intel_attached_hdmi(to_intel_connector(connector)); enum drm_mode_status status; /* check if we can do 8bpc */ @@ -1916,12 +1916,14 @@ intel_hdmi_mode_clock_valid(struct intel_hdmi *hdmi, int clock, bool has_hdmi_si if (has_hdmi_sink) { /* if we can't do 8bpc we may still be able to do 12bpc */ - if (status != MODE_OK && !HAS_GMCH(dev_priv)) + if (status != MODE_OK && + intel_hdmi_bpc_possible(connector, 12, has_hdmi_sink, ycbcr420_output)) status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 12), true, has_hdmi_sink); /* if we can't do 8,12bpc we may still be able to do 10bpc */ - if (status != MODE_OK && DISPLAY_VER(dev_priv) >= 11) + if (status != MODE_OK && + intel_hdmi_bpc_possible(connector, 10, has_hdmi_sink, ycbcr420_output)) status = hdmi_port_clock_valid(hdmi, intel_hdmi_port_clock(clock, 10), true, has_hdmi_sink); } @@ -1961,7 +1963,7 @@ intel_hdmi_mode_valid(struct drm_connector *connector, if (ycbcr_420_only) clock /= 2; - status = intel_hdmi_mode_clock_valid(hdmi, clock, has_hdmi_sink); + status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, ycbcr_420_only); if (status != MODE_OK) { if (ycbcr_420_only || !connector->ycbcr_420_allowed || @@ -1969,7 +1971,7 @@ intel_hdmi_mode_valid(struct drm_connector *connector, return status; clock /= 2; - status = intel_hdmi_mode_clock_valid(hdmi, clock, has_hdmi_sink); + status = intel_hdmi_mode_clock_valid(connector, clock, has_hdmi_sink, true); if (status != MODE_OK) return status; } |