Files
linux/drivers/gpu/drm/i915/display/skl_prefill.h
Ville Syrjälä ba470a99f2 drm/i915/prefill: Introduce skl_prefill.c
Add a new helper thingy to deal with the pipe prefill latency.

We get three potentially useful thigns out of this:
- skl_prefill_vblank_too_short() used for checking the
  actual vblank/guardband length
- skl_prefill_min_guardband() to calculate a suitable guardband
  size based on some worst case scaling/etc. estimates
- skl_prefill_min_cdclk() used to calculate a minimum cdclk
  frequency required for very small vblank lengths (in case the
  otherwise computed minimum cdclk doesn't result in fast enough
  prefill).

The internal arithmetic is done terms of scanlines using .16
binary fixed point representation.

v2: Add the missing <<16 for framestart_delay
    Drop the cdclk_state stuff in favor of crtc_state->min_cdclk
    Rename to skl_prefill since this is skl+ only
    Use intel_crtc_vblank_length() instead of hand rolling it
    memset(0) in prefill_init()

Reviewed-by: Uma Shankar <uma.shankar@intel.com> #v1
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20251014191808.12326-9-ville.syrjala@linux.intel.com
2025-10-16 18:22:05 +03:00

47 lines
1.1 KiB
C

/* SPDX-License-Identifier: MIT */
/*
* Copyright © 2025 Intel Corporation
*/
#ifndef __SKL_PREFILL_H__
#define __SKL_PREFILL_H__
#include <linux/types.h>
struct intel_crtc_state;
struct skl_prefill_ctx {
/* .16 scanlines */
struct {
unsigned int fixed;
unsigned int wm0;
unsigned int scaler_1st;
unsigned int scaler_2nd;
unsigned int dsc;
unsigned int full;
} prefill;
/* .16 adjustment factors */
struct {
unsigned int cdclk;
unsigned int scaler_1st;
unsigned int scaler_2nd;
} adj;
};
void skl_prefill_init_worst(struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state);
void skl_prefill_init(struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state);
bool skl_prefill_vblank_too_short(const struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state,
unsigned int latency_us);
int skl_prefill_min_guardband(const struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state,
unsigned int latency_us);
int skl_prefill_min_cdclk(const struct skl_prefill_ctx *ctx,
const struct intel_crtc_state *crtc_state);
#endif /* __SKL_PREFILL_H__ */