Skip to content

Commit 09ae0f4

Browse files
bmodemrodrigovivi
authored andcommitted
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 <[email protected]> Cc: Ankit Nautiyal <[email protected]> Cc: Mitul Golani <[email protected]> Signed-off-by: Bhanuprakash Modem <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Jani Nikula <[email protected]> (cherry picked from commit 2d04f81) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 186bce6 commit 09ae0f4

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include "intel_dp_tunnel.h"
6868
#include "intel_dpio_phy.h"
6969
#include "intel_dpll.h"
70+
#include "intel_drrs.h"
7071
#include "intel_fifo_underrun.h"
7172
#include "intel_hdcp.h"
7273
#include "intel_hdmi.h"
@@ -2683,15 +2684,6 @@ intel_dp_compute_hdr_metadata_infoframe_sdp(struct intel_dp *intel_dp,
26832684
intel_hdmi_infoframe_enable(HDMI_PACKET_TYPE_GAMUT_METADATA);
26842685
}
26852686

2686-
static bool cpu_transcoder_has_drrs(struct drm_i915_private *i915,
2687-
enum transcoder cpu_transcoder)
2688-
{
2689-
if (HAS_DOUBLE_BUFFERED_M_N(i915))
2690-
return true;
2691-
2692-
return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
2693-
}
2694-
26952687
static bool can_enable_drrs(struct intel_connector *connector,
26962688
const struct intel_crtc_state *pipe_config,
26972689
const struct drm_display_mode *downclock_mode)
@@ -2714,7 +2706,7 @@ static bool can_enable_drrs(struct intel_connector *connector,
27142706
if (pipe_config->has_pch_encoder)
27152707
return false;
27162708

2717-
if (!cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder))
2709+
if (!intel_cpu_transcoder_has_drrs(i915, pipe_config->cpu_transcoder))
27182710
return false;
27192711

27202712
return downclock_mode &&

drivers/gpu/drm/i915/display/intel_drrs.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,15 @@ const char *intel_drrs_type_str(enum drrs_type drrs_type)
6363
return str[drrs_type];
6464
}
6565

66+
bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
67+
enum transcoder cpu_transcoder)
68+
{
69+
if (HAS_DOUBLE_BUFFERED_M_N(i915))
70+
return true;
71+
72+
return intel_cpu_transcoder_has_m2_n2(i915, cpu_transcoder);
73+
}
74+
6675
static void
6776
intel_drrs_set_refresh_rate_pipeconf(struct intel_crtc *crtc,
6877
enum drrs_refresh_rate refresh_rate)

drivers/gpu/drm/i915/display/intel_drrs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,15 @@
99
#include <linux/types.h>
1010

1111
enum drrs_type;
12+
enum transcoder;
1213
struct drm_i915_private;
1314
struct intel_atomic_state;
1415
struct intel_crtc;
1516
struct intel_crtc_state;
1617
struct intel_connector;
1718

19+
bool intel_cpu_transcoder_has_drrs(struct drm_i915_private *i915,
20+
enum transcoder cpu_transcoder);
1821
const char *intel_drrs_type_str(enum drrs_type drrs_type);
1922
bool intel_drrs_is_active(struct intel_crtc *crtc);
2023
void intel_drrs_activate(const struct intel_crtc_state *crtc_state);

0 commit comments

Comments
 (0)