#include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_fourcc.h>
#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_atomic_plane.h"
#include "intel_de.h"
#include "intel_display_irq.h"
#include "intel_display_types.h"
#include "intel_dpt.h"
#include "intel_fb.h"
#include "intel_fbc.h"
#include "intel_frontbuffer.h"
#include "intel_psr.h"
#include "intel_psr_regs.h"
#include "skl_scaler.h"
#include "skl_universal_plane.h"
#include "skl_universal_plane_regs.h"
#include "skl_watermark.h"
#include "pxp/intel_pxp.h"
static const u32 skl_plane_formats[] = …;
static const u32 skl_planar_formats[] = …;
static const u32 glk_planar_formats[] = …;
static const u32 icl_sdr_y_plane_formats[] = …;
static const u32 icl_sdr_uv_plane_formats[] = …;
static const u32 icl_hdr_plane_formats[] = …;
int skl_format_to_fourcc(int format, bool rgb_order, bool alpha)
{ … }
static u8 icl_nv12_y_plane_mask(struct drm_i915_private *i915)
{ … }
bool icl_is_nv12_y_plane(struct drm_i915_private *dev_priv,
enum plane_id plane_id)
{ … }
u8 icl_hdr_plane_mask(void)
{ … }
bool icl_is_hdr_plane(struct drm_i915_private *dev_priv, enum plane_id plane_id)
{ … }
static int icl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static void
glk_plane_ratio(const struct intel_plane_state *plane_state,
unsigned int *num, unsigned int *den)
{ … }
static int glk_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static void
skl_plane_ratio(const struct intel_plane_state *plane_state,
unsigned int *num, unsigned int *den)
{ … }
static int skl_plane_min_cdclk(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static int skl_plane_max_width(const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int glk_plane_max_width(const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int icl_plane_min_width(const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int icl_hdr_plane_max_width(const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int icl_sdr_plane_max_width(const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int skl_plane_max_height(const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int icl_plane_max_height(const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static unsigned int
plane_max_stride(struct intel_plane *plane,
u32 pixel_format, u64 modifier,
unsigned int rotation,
unsigned int max_pixels,
unsigned int max_bytes)
{ … }
static unsigned int
adl_plane_max_stride(struct intel_plane *plane,
u32 pixel_format, u64 modifier,
unsigned int rotation)
{ … }
static unsigned int
skl_plane_max_stride(struct intel_plane *plane,
u32 pixel_format, u64 modifier,
unsigned int rotation)
{ … }
static u32 tgl_plane_min_alignment(struct intel_plane *plane,
const struct drm_framebuffer *fb,
int color_plane)
{ … }
static u32 skl_plane_min_alignment(struct intel_plane *plane,
const struct drm_framebuffer *fb,
int color_plane)
{ … }
#define PREOFF_YUV_TO_RGB_HI …
#define PREOFF_YUV_TO_RGB_ME …
#define PREOFF_YUV_TO_RGB_LO …
#define ROFF(x) …
#define GOFF(x) …
#define BOFF(x) …
static void
icl_program_input_csc(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static unsigned int skl_plane_stride_mult(const struct drm_framebuffer *fb,
int color_plane, unsigned int rotation)
{ … }
static u32 skl_plane_stride(const struct intel_plane_state *plane_state,
int color_plane)
{ … }
static u32 skl_plane_ddb_reg_val(const struct skl_ddb_entry *entry)
{ … }
static u32 skl_plane_wm_reg_val(const struct skl_wm_level *level)
{ … }
static void skl_write_plane_wm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state)
{ … }
static void
skl_plane_disable_arm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state)
{ … }
static void icl_plane_disable_sel_fetch_arm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state)
{ … }
static void
icl_plane_disable_arm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state)
{ … }
static bool
skl_plane_get_hw_state(struct intel_plane *plane,
enum pipe *pipe)
{ … }
static u32 skl_plane_ctl_format(u32 pixel_format)
{ … }
static u32 skl_plane_ctl_alpha(const struct intel_plane_state *plane_state)
{ … }
static u32 glk_plane_color_ctl_alpha(const struct intel_plane_state *plane_state)
{ … }
static u32 skl_plane_ctl_tiling(u64 fb_modifier)
{ … }
static u32 skl_plane_ctl_rotate(unsigned int rotate)
{ … }
static u32 icl_plane_ctl_flip(unsigned int reflect)
{ … }
static u32 adlp_plane_ctl_arb_slots(const struct intel_plane_state *plane_state)
{ … }
static u32 skl_plane_ctl_crtc(const struct intel_crtc_state *crtc_state)
{ … }
static u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static u32 glk_plane_color_ctl_crtc(const struct intel_crtc_state *crtc_state)
{ … }
static u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static u32 skl_surf_address(const struct intel_plane_state *plane_state,
int color_plane)
{ … }
static u32 skl_plane_surf(const struct intel_plane_state *plane_state,
int color_plane)
{ … }
static u32 skl_plane_aux_dist(const struct intel_plane_state *plane_state,
int color_plane)
{ … }
static u32 skl_plane_keyval(const struct intel_plane_state *plane_state)
{ … }
static u32 skl_plane_keymax(const struct intel_plane_state *plane_state)
{ … }
static u32 skl_plane_keymsk(const struct intel_plane_state *plane_state)
{ … }
static void icl_plane_csc_load_black(struct intel_plane *plane)
{ … }
static int icl_plane_color_plane(const struct intel_plane_state *plane_state)
{ … }
static void
skl_plane_update_noarm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static void
skl_plane_update_arm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static void icl_plane_update_sel_fetch_noarm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state,
int color_plane)
{ … }
static void
icl_plane_update_noarm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static void icl_plane_update_sel_fetch_arm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static void
icl_plane_update_arm(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static void
skl_plane_async_flip(struct intel_plane *plane,
const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state,
bool async_flip)
{ … }
static bool intel_format_is_p01x(u32 format)
{ … }
static int skl_plane_check_fb(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static int skl_plane_check_dst_coordinates(const struct intel_crtc_state *crtc_state,
const struct intel_plane_state *plane_state)
{ … }
static int skl_plane_check_nv12_rotation(const struct intel_plane_state *plane_state)
{ … }
static int skl_plane_max_scale(struct drm_i915_private *dev_priv,
const struct drm_framebuffer *fb)
{ … }
static int intel_plane_min_width(struct intel_plane *plane,
const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int intel_plane_max_width(struct intel_plane *plane,
const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static int intel_plane_max_height(struct intel_plane *plane,
const struct drm_framebuffer *fb,
int color_plane,
unsigned int rotation)
{ … }
static bool
skl_check_main_ccs_coordinates(struct intel_plane_state *plane_state,
int main_x, int main_y, u32 main_offset,
int ccs_plane)
{ … }
int skl_calc_main_surface_offset(const struct intel_plane_state *plane_state,
int *x, int *y, u32 *offset)
{ … }
static int skl_check_main_surface(struct intel_plane_state *plane_state)
{ … }
static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
{ … }
static int skl_check_ccs_aux_surface(struct intel_plane_state *plane_state)
{ … }
static int skl_check_plane_surface(struct intel_plane_state *plane_state)
{ … }
static bool skl_fb_scalable(const struct drm_framebuffer *fb)
{ … }
static void check_protection(struct intel_plane_state *plane_state)
{ … }
static int skl_plane_check(struct intel_crtc_state *crtc_state,
struct intel_plane_state *plane_state)
{ … }
static enum intel_fbc_id skl_fbc_id_for_pipe(enum pipe pipe)
{ … }
static bool skl_plane_has_fbc(struct drm_i915_private *i915,
enum intel_fbc_id fbc_id, enum plane_id plane_id)
{ … }
static struct intel_fbc *skl_plane_fbc(struct drm_i915_private *dev_priv,
enum pipe pipe, enum plane_id plane_id)
{ … }
static bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
enum pipe pipe, enum plane_id plane_id)
{ … }
static const u32 *skl_get_plane_formats(struct drm_i915_private *dev_priv,
enum pipe pipe, enum plane_id plane_id,
int *num_formats)
{ … }
static const u32 *glk_get_plane_formats(struct drm_i915_private *dev_priv,
enum pipe pipe, enum plane_id plane_id,
int *num_formats)
{ … }
static const u32 *icl_get_plane_formats(struct drm_i915_private *dev_priv,
enum pipe pipe, enum plane_id plane_id,
int *num_formats)
{ … }
static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
u32 format, u64 modifier)
{ … }
static bool gen12_plane_format_mod_supported(struct drm_plane *_plane,
u32 format, u64 modifier)
{ … }
static const struct drm_plane_funcs skl_plane_funcs = …;
static const struct drm_plane_funcs gen12_plane_funcs = …;
static void
skl_plane_enable_flip_done(struct intel_plane *plane)
{ … }
static void
skl_plane_disable_flip_done(struct intel_plane *plane)
{ … }
static bool skl_plane_has_rc_ccs(struct drm_i915_private *i915,
enum pipe pipe, enum plane_id plane_id)
{ … }
static bool gen12_plane_has_mc_ccs(struct drm_i915_private *i915,
enum plane_id plane_id)
{ … }
static u8 skl_get_plane_caps(struct drm_i915_private *i915,
enum pipe pipe, enum plane_id plane_id)
{ … }
struct intel_plane *
skl_universal_plane_create(struct drm_i915_private *dev_priv,
enum pipe pipe, enum plane_id plane_id)
{ … }
void
skl_get_initial_plane_config(struct intel_crtc *crtc,
struct intel_initial_plane_config *plane_config)
{ … }
bool skl_fixup_initial_plane_config(struct intel_crtc *crtc,
const struct intel_initial_plane_config *plane_config)
{ … }