diff options
| author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2024-12-19 16:08:23 +0300 |
|---|---|---|
| committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2025-01-09 20:31:38 +0300 |
| commit | c5877587a2a93de3ebf0cb981f02ed3d2fee3ee3 (patch) | |
| tree | 63d7b5262bb4e923c49c476e53e137bf0b523a42 /drivers/gpu/drm/i915/display/skl_scaler.c | |
| parent | 9313b0bee09b6fdff4fb087090e57e44fcfd4ab3 (diff) | |
| download | linux-c5877587a2a93de3ebf0cb981f02ed3d2fee3ee3.tar.xz | |
drm/i915/scaler: Extract skl_scaler_max_dst_size()
The SKL_MAX_DST_* defines just make things hard to read.
Get rid of them and introduce an easy to read function
in their place.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241219130827.22830-5-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/display/skl_scaler.c')
| -rw-r--r-- | drivers/gpu/drm/i915/display/skl_scaler.c | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/display/skl_scaler.c b/drivers/gpu/drm/i915/display/skl_scaler.c index cabbf4860cb3..0bc82a047510 100644 --- a/drivers/gpu/drm/i915/display/skl_scaler.c +++ b/drivers/gpu/drm/i915/display/skl_scaler.c @@ -76,15 +76,6 @@ static u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited) return ((phase >> 2) & PS_PHASE_MASK) | trip; } -#define SKL_MAX_DST_W 4096 -#define SKL_MAX_DST_H 4096 -#define ICL_MAX_DST_W 5120 -#define ICL_MAX_DST_H 4096 -#define TGL_MAX_DST_W 8192 -#define TGL_MAX_DST_H 8192 -#define MTL_MAX_DST_W 8192 -#define MTL_MAX_DST_H 8192 - static void skl_scaler_min_src_size(const struct drm_format_info *format, u64 modifier, int *min_w, int *min_h) { @@ -123,6 +114,26 @@ static void skl_scaler_min_dst_size(int *min_w, int *min_h) *min_h = 8; } +static void skl_scaler_max_dst_size(struct intel_crtc *crtc, + int *max_w, int *max_h) +{ + struct intel_display *display = to_intel_display(crtc); + + if (DISPLAY_VER(display) >= 14) { + *max_w = 8192; + *max_h = 8192; + } else if (DISPLAY_VER(display) >= 12) { + *max_w = 8192; + *max_h = 8192; + } else if (DISPLAY_VER(display) == 11) { + *max_w = 5120; + *max_h = 4096; + } else { + *max_w = 4096; + *max_h = 4096; + } +} + static int skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, unsigned int scaler_user, int *scaler_id, @@ -191,20 +202,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, skl_scaler_max_src_size(crtc, &max_src_w, &max_src_h); skl_scaler_min_dst_size(&min_dst_w, &min_dst_h); - - if (DISPLAY_VER(display) < 11) { - max_dst_w = SKL_MAX_DST_W; - max_dst_h = SKL_MAX_DST_H; - } else if (DISPLAY_VER(display) < 12) { - max_dst_w = ICL_MAX_DST_W; - max_dst_h = ICL_MAX_DST_H; - } else if (DISPLAY_VER(display) < 14) { - max_dst_w = TGL_MAX_DST_W; - max_dst_h = TGL_MAX_DST_H; - } else { - max_dst_w = MTL_MAX_DST_W; - max_dst_h = MTL_MAX_DST_H; - } + skl_scaler_max_dst_size(crtc, &max_dst_w, &max_dst_h); /* range checks */ if (src_w < min_src_w || src_h < min_src_h || |
