Commit f0a57798 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Introduce intel_panel_drrs_type()

Add a helper to determine which type of DRRS the panel supports.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220311172428.14685-10-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 43af6743
...@@ -48,11 +48,8 @@ ...@@ -48,11 +48,8 @@
*/ */
static bool can_enable_drrs(struct intel_connector *connector, static bool can_enable_drrs(struct intel_connector *connector,
const struct intel_crtc_state *pipe_config, const struct intel_crtc_state *pipe_config)
const struct drm_display_mode *downclock_mode)
{ {
const struct drm_i915_private *i915 = to_i915(connector->base.dev);
if (pipe_config->vrr.enable) if (pipe_config->vrr.enable)
return false; return false;
...@@ -65,8 +62,7 @@ static bool can_enable_drrs(struct intel_connector *connector, ...@@ -65,8 +62,7 @@ static bool can_enable_drrs(struct intel_connector *connector,
if (pipe_config->has_psr) if (pipe_config->has_psr)
return false; return false;
return downclock_mode && return intel_panel_drrs_type(connector) == DRRS_TYPE_SEAMLESS;
i915->vbt.drrs_type == DRRS_TYPE_SEAMLESS;
} }
void void
...@@ -80,7 +76,7 @@ intel_drrs_compute_config(struct intel_dp *intel_dp, ...@@ -80,7 +76,7 @@ intel_drrs_compute_config(struct intel_dp *intel_dp,
intel_panel_downclock_mode(connector, &pipe_config->hw.adjusted_mode); intel_panel_downclock_mode(connector, &pipe_config->hw.adjusted_mode);
int pixel_clock; int pixel_clock;
if (!can_enable_drrs(connector, pipe_config, downclock_mode)) { if (!can_enable_drrs(connector, pipe_config)) {
if (intel_cpu_transcoder_has_m2_n2(i915, pipe_config->cpu_transcoder)) if (intel_cpu_transcoder_has_m2_n2(i915, pipe_config->cpu_transcoder))
intel_zero_m_n(&pipe_config->dp_m2_n2); intel_zero_m_n(&pipe_config->dp_m2_n2);
return; return;
......
...@@ -83,6 +83,16 @@ int intel_panel_get_modes(struct intel_connector *connector) ...@@ -83,6 +83,16 @@ int intel_panel_get_modes(struct intel_connector *connector)
return num_modes; return num_modes;
} }
enum drrs_type intel_panel_drrs_type(struct intel_connector *connector)
{
struct drm_i915_private *i915 = to_i915(connector->base.dev);
if (!connector->panel.downclock_mode)
return DRRS_TYPE_NONE;
return i915->vbt.drrs_type;
}
int intel_panel_compute_config(struct intel_connector *connector, int intel_panel_compute_config(struct intel_connector *connector,
struct drm_display_mode *adjusted_mode) struct drm_display_mode *adjusted_mode)
{ {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <linux/types.h> #include <linux/types.h>
enum drm_connector_status; enum drm_connector_status;
enum drrs_type;
struct drm_connector; struct drm_connector;
struct drm_connector_state; struct drm_connector_state;
struct drm_display_mode; struct drm_display_mode;
...@@ -33,6 +34,7 @@ const struct drm_display_mode * ...@@ -33,6 +34,7 @@ const struct drm_display_mode *
intel_panel_downclock_mode(struct intel_connector *connector, intel_panel_downclock_mode(struct intel_connector *connector,
const struct drm_display_mode *adjusted_mode); const struct drm_display_mode *adjusted_mode);
int intel_panel_get_modes(struct intel_connector *connector); int intel_panel_get_modes(struct intel_connector *connector);
enum drrs_type intel_panel_drrs_type(struct intel_connector *connector);
enum drm_mode_status enum drm_mode_status
intel_panel_mode_valid(struct intel_connector *connector, intel_panel_mode_valid(struct intel_connector *connector,
const struct drm_display_mode *mode); const struct drm_display_mode *mode);
......
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