Commit 35859d44 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Extract intel_dp_has_dsc()

Extract a helper to check whether the source+sink combo
supports DSC. That basic check is needed both during mode
validation and compute config. We'll also need to add extra
checks to both places, so having a single place for it is nicer.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517145356.26103-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 7997a9e4
...@@ -1171,6 +1171,19 @@ bool intel_dp_need_joiner(struct intel_dp *intel_dp, ...@@ -1171,6 +1171,19 @@ bool intel_dp_need_joiner(struct intel_dp *intel_dp,
connector->force_bigjoiner_enable; connector->force_bigjoiner_enable;
} }
static bool intel_dp_has_dsc(const struct intel_connector *connector)
{
struct drm_i915_private *i915 = to_i915(connector->base.dev);
if (!HAS_DSC(i915))
return false;
if (!drm_dp_sink_supports_dsc(connector->dp.dsc_dpcd))
return false;
return true;
}
static enum drm_mode_status static enum drm_mode_status
intel_dp_mode_valid(struct drm_connector *_connector, intel_dp_mode_valid(struct drm_connector *_connector,
struct drm_display_mode *mode) struct drm_display_mode *mode)
...@@ -1225,8 +1238,7 @@ intel_dp_mode_valid(struct drm_connector *_connector, ...@@ -1225,8 +1238,7 @@ intel_dp_mode_valid(struct drm_connector *_connector,
mode_rate = intel_dp_link_required(target_clock, mode_rate = intel_dp_link_required(target_clock,
intel_dp_mode_min_output_bpp(connector, mode)); intel_dp_mode_min_output_bpp(connector, mode));
if (HAS_DSC(dev_priv) && if (intel_dp_has_dsc(connector)) {
drm_dp_sink_supports_dsc(connector->dp.dsc_dpcd)) {
enum intel_output_format sink_format, output_format; enum intel_output_format sink_format, output_format;
int pipe_bpp; int pipe_bpp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment