#include <drm/drm_fourcc.h>
#include "gem/i915_gem_internal.h"
#include "gem/i915_gem_object_frontbuffer.h"
#include "gem/i915_gem_pm.h"
#include "gt/intel_gpu_commands.h"
#include "gt/intel_ring.h"
#include "i915_drv.h"
#include "i915_reg.h"
#include "intel_color_regs.h"
#include "intel_de.h"
#include "intel_display_types.h"
#include "intel_frontbuffer.h"
#include "intel_overlay.h"
#include "intel_pci_config.h"
#define IMAGE_MAX_WIDTH …
#define IMAGE_MAX_HEIGHT …
#define IMAGE_MAX_WIDTH_LEGACY …
#define IMAGE_MAX_HEIGHT_LEGACY …
#define OCMD_TILED_SURFACE …
#define OCMD_MIRROR_MASK …
#define OCMD_MIRROR_MODE …
#define OCMD_MIRROR_HORIZONTAL …
#define OCMD_MIRROR_VERTICAL …
#define OCMD_MIRROR_BOTH …
#define OCMD_BYTEORDER_MASK …
#define OCMD_UV_SWAP …
#define OCMD_Y_SWAP …
#define OCMD_Y_AND_UV_SWAP …
#define OCMD_SOURCE_FORMAT_MASK …
#define OCMD_RGB_888 …
#define OCMD_RGB_555 …
#define OCMD_RGB_565 …
#define OCMD_YUV_422_PACKED …
#define OCMD_YUV_411_PACKED …
#define OCMD_YUV_420_PLANAR …
#define OCMD_YUV_422_PLANAR …
#define OCMD_YUV_410_PLANAR …
#define OCMD_TVSYNCFLIP_PARITY …
#define OCMD_TVSYNCFLIP_ENABLE …
#define OCMD_BUF_TYPE_MASK …
#define OCMD_BUF_TYPE_FRAME …
#define OCMD_BUF_TYPE_FIELD …
#define OCMD_TEST_MODE …
#define OCMD_BUFFER_SELECT …
#define OCMD_BUFFER0 …
#define OCMD_BUFFER1 …
#define OCMD_FIELD_SELECT …
#define OCMD_FIELD0 …
#define OCMD_FIELD1 …
#define OCMD_ENABLE …
#define OCONF_PIPE_MASK …
#define OCONF_PIPE_A …
#define OCONF_PIPE_B …
#define OCONF_GAMMA2_ENABLE …
#define OCONF_CSC_MODE_BT601 …
#define OCONF_CSC_MODE_BT709 …
#define OCONF_CSC_BYPASS …
#define OCONF_CC_OUT_8BIT …
#define OCONF_TEST_MODE …
#define OCONF_THREE_LINE_BUFFER …
#define OCONF_TWO_LINE_BUFFER …
#define DST_KEY_ENABLE …
#define CLK_RGB24_MASK …
#define CLK_RGB16_MASK …
#define CLK_RGB15_MASK …
#define RGB30_TO_COLORKEY(c) …
#define RGB16_TO_COLORKEY(c) …
#define RGB15_TO_COLORKEY(c) …
#define RGB8I_TO_COLORKEY(c) …
#define OFC_UPDATE …
#define N_HORIZ_Y_TAPS …
#define N_VERT_Y_TAPS …
#define N_HORIZ_UV_TAPS …
#define N_VERT_UV_TAPS …
#define N_PHASES …
#define MAX_TAPS …
struct overlay_registers { … };
struct intel_overlay { … };
static void i830_overlay_clock_gating(struct drm_i915_private *dev_priv,
bool enable)
{ … }
static struct i915_request *
alloc_request(struct intel_overlay *overlay, void (*fn)(struct intel_overlay *))
{ … }
static int intel_overlay_on(struct intel_overlay *overlay)
{ … }
static void intel_overlay_flip_prepare(struct intel_overlay *overlay,
struct i915_vma *vma)
{ … }
static int intel_overlay_continue(struct intel_overlay *overlay,
struct i915_vma *vma,
bool load_polyphase_filter)
{ … }
static void intel_overlay_release_old_vma(struct intel_overlay *overlay)
{ … }
static void
intel_overlay_release_old_vid_tail(struct intel_overlay *overlay)
{ … }
static void intel_overlay_off_tail(struct intel_overlay *overlay)
{ … }
static void intel_overlay_last_flip_retire(struct i915_active *active)
{ … }
static int intel_overlay_off(struct intel_overlay *overlay)
{ … }
static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay)
{ … }
static int intel_overlay_release_old_vid(struct intel_overlay *overlay)
{ … }
void intel_overlay_reset(struct drm_i915_private *dev_priv)
{ … }
static int packed_depth_bytes(u32 format)
{ … }
static int packed_width_bytes(u32 format, short width)
{ … }
static int uv_hsubsampling(u32 format)
{ … }
static int uv_vsubsampling(u32 format)
{ … }
static u32 calc_swidthsw(struct drm_i915_private *dev_priv, u32 offset, u32 width)
{ … }
static const u16 y_static_hcoeffs[N_PHASES][N_HORIZ_Y_TAPS] = …;
static const u16 uv_static_hcoeffs[N_PHASES][N_HORIZ_UV_TAPS] = …;
static void update_polyphase_filter(struct overlay_registers __iomem *regs)
{ … }
static bool update_scaling_factors(struct intel_overlay *overlay,
struct overlay_registers __iomem *regs,
struct drm_intel_overlay_put_image *params)
{ … }
static void update_colorkey(struct intel_overlay *overlay,
struct overlay_registers __iomem *regs)
{ … }
static u32 overlay_cmd_reg(struct drm_intel_overlay_put_image *params)
{ … }
static struct i915_vma *intel_overlay_pin_fb(struct drm_i915_gem_object *new_bo)
{ … }
static int intel_overlay_do_put_image(struct intel_overlay *overlay,
struct drm_i915_gem_object *new_bo,
struct drm_intel_overlay_put_image *params)
{ … }
int intel_overlay_switch_off(struct intel_overlay *overlay)
{ … }
static int check_overlay_possible_on_crtc(struct intel_overlay *overlay,
struct intel_crtc *crtc)
{ … }
static void update_pfit_vscale_ratio(struct intel_overlay *overlay)
{ … }
static int check_overlay_dst(struct intel_overlay *overlay,
struct drm_intel_overlay_put_image *rec)
{ … }
static int check_overlay_scaling(struct drm_intel_overlay_put_image *rec)
{ … }
static int check_overlay_src(struct drm_i915_private *dev_priv,
struct drm_intel_overlay_put_image *rec,
struct drm_i915_gem_object *new_bo)
{ … }
int intel_overlay_put_image_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{ … }
static void update_reg_attrs(struct intel_overlay *overlay,
struct overlay_registers __iomem *regs)
{ … }
static bool check_gamma_bounds(u32 gamma1, u32 gamma2)
{ … }
static bool check_gamma5_errata(u32 gamma5)
{ … }
static int check_gamma(struct drm_intel_overlay_attrs *attrs)
{ … }
int intel_overlay_attrs_ioctl(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{ … }
static int get_registers(struct intel_overlay *overlay, bool use_phys)
{ … }
void intel_overlay_setup(struct drm_i915_private *dev_priv)
{ … }
void intel_overlay_cleanup(struct drm_i915_private *dev_priv)
{ … }
#if IS_ENABLED(CONFIG_DRM_I915_CAPTURE_ERROR)
struct intel_overlay_error_state { … };
struct intel_overlay_error_state *
intel_overlay_capture_error_state(struct drm_i915_private *dev_priv)
{ … }
void
intel_overlay_print_error_state(struct drm_printer *p,
struct intel_overlay_error_state *error)
{ … }
#endif