Commit 09ae0f45 authored by Bhanuprakash Modem's avatar Bhanuprakash Modem Committed by Rodrigo Vivi

drm/i915/drrs: Refactor CPU transcoder DRRS check

Rename cpu_transcoder_has_drrs() to intel_cpu_transcoder_has_drrs() and
move it to intel_drrs.[ch].

V2:
 - Move helpers to intel_drrs.[ch] (Jani)
 - Fix commit message (Jani)

Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Signed-off-by: default avatarBhanuprakash Modem <bhanuprakash.modem@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240228055502.2857819-1-bhanuprakash.modem@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
(cherry picked from commit 2d04f815)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 186bce68
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include "intel_dp_tunnel.h" #include "intel_dp_tunnel.h"
#include "intel_dpio_phy.h" #include "intel_dpio_phy.h"
#include "intel_dpll.h" #include "intel_dpll.h"
#include "intel_drrs.h"
#include "intel_fifo_underrun.h" #include "intel_fifo_underrun.h"
#include "intel_hdcp.h" #include "intel_hdcp.h"
#include "intel_hdmi.h" #include "intel_hdmi.h"
...@@ -2683,15 +2684,6 @@ intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp, ...@@ -2683,15 +2684,6 @@ intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA); intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
} }
static bool cpu_transcoder_has_drrs(struct drm_i915_private *i915,
enum transcoder cpu_transcoder)
{
if (HAS_DOUBLE_BUFFERED_M_N(i915))
return true;
return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
}
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_display_mode *downclock_mode)
...@@ -2714,7 +2706,7 @@ static bool can_enable_drrs(struct intel_connector *connector, ...@@ -2714,7 +2706,7 @@ static bool can_enable_drrs(struct intel_connector *connector,
if (pipe_config->has_pch_encoder) if (pipe_config->has_pch_encoder)
return false; return false;
if (!cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder)) if (!intel_cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder))
return false; return false;
return downclock_mode && return downclock_mode &&
......
...@@ -63,6 +63,15 @@ const char *intel_drrs_type_str(enum drrs_type drrs_type) ...@@ -63,6 +63,15 @@ const char *intel_drrs_type_str(enum drrs_type drrs_type)
return str[drrs_type]; return str[drrs_type];
} }
bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
enum transcoder cpu_transcoder)
{
if (HAS_DOUBLE_BUFFERED_M_N(i915))
return true;
return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
}
static void static void
intel_drrs_set_refresh_rate_pipeconf(struct intel_crtc *crtc, intel_drrs_set_refresh_rate_pipeconf(struct intel_crtc *crtc,
enum drrs_refresh_rate refresh_rate) enum drrs_refresh_rate refresh_rate)
......
...@@ -9,12 +9,15 @@ ...@@ -9,12 +9,15 @@
#include <linux/types.h> #include <linux/types.h>
enum drrs_type; enum drrs_type;
enum transcoder;
struct drm_i915_private; struct drm_i915_private;
struct intel_atomic_state; struct intel_atomic_state;
struct intel_crtc; struct intel_crtc;
struct intel_crtc_state; struct intel_crtc_state;
struct intel_connector; struct intel_connector;
bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
enum transcoder cpu_transcoder);
const char *intel_drrs_type_str(enum drrs_type drrs_type); const char *intel_drrs_type_str(enum drrs_type drrs_type);
bool intel_drrs_is_active(struct intel_crtc *crtc); bool intel_drrs_is_active(struct intel_crtc *crtc);
void intel_drrs_activate(const struct intel_crtc_state *crtc_state); void intel_drrs_activate(const struct intel_crtc_state *crtc_state);
......
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