Merge tag 'drm-intel-next-fixes-2025-03-25' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next

drm/i915 fixes for v6.15 merge window:
- Bounds check for scalers in DSC prefill latency computation
- Fix build by adding a missing include

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Jani Nikula <jani.nikula@intel.com>
Link: https://lore.kernel.org/r/878qota36x.fsf@intel.com
This commit is contained in:
Dave Airlie 2025-04-03 15:52:14 +10:00
commit 41ae768afb
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,8 @@
#ifndef __INTEL_FBDEV_H__
#define __INTEL_FBDEV_H__
#include <linux/types.h>
struct drm_fb_helper;
struct drm_fb_helper_surface_size;
struct drm_i915_private;

View File

@ -2314,6 +2314,7 @@ cdclk_prefill_adjustment(const struct intel_crtc_state *crtc_state)
static int
dsc_prefill_latency(const struct intel_crtc_state *crtc_state)
{
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
const struct intel_crtc_scaler_state *scaler_state =
&crtc_state->scaler_state;
int linetime = DIV_ROUND_UP(1000 * crtc_state->hw.adjusted_mode.htotal,
@ -2323,7 +2324,9 @@ dsc_prefill_latency(const struct intel_crtc_state *crtc_state)
crtc_state->output_format == INTEL_OUTPUT_FORMAT_YCBCR420 ? 2 : 1;
u32 dsc_prefill_latency = 0;
if (!crtc_state->dsc.compression_enable || !num_scaler_users)
if (!crtc_state->dsc.compression_enable ||
!num_scaler_users ||
num_scaler_users > crtc->num_scalers)
return dsc_prefill_latency;
dsc_prefill_latency = DIV_ROUND_UP(15 * linetime * chroma_downscaling_factor, 10);