#include <linux/iommu.h>
#include <linux/platform_device.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_blend.h>
#include <drm/drm_drv.h>
#include <drm/drm_fb_dma_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_print.h>
#include "malidp_hw.h"
#include "malidp_drv.h"
#define MALIDP_LAYER_FORMAT …
#define LAYER_FORMAT_MASK …
#define MALIDP_LAYER_CONTROL …
#define LAYER_ENABLE …
#define LAYER_FLOWCFG_MASK …
#define LAYER_FLOWCFG(x) …
#define LAYER_FLOWCFG_SCALE_SE …
#define LAYER_ROT_OFFSET …
#define LAYER_H_FLIP …
#define LAYER_V_FLIP …
#define LAYER_ROT_MASK …
#define LAYER_COMP_MASK …
#define LAYER_COMP_PIXEL …
#define LAYER_COMP_PLANE …
#define LAYER_PMUL_ENABLE …
#define LAYER_ALPHA_OFFSET …
#define LAYER_ALPHA_MASK …
#define LAYER_ALPHA(x) …
#define MALIDP_LAYER_COMPOSE …
#define MALIDP_LAYER_SIZE …
#define LAYER_H_VAL(x) …
#define LAYER_V_VAL(x) …
#define MALIDP_LAYER_COMP_SIZE …
#define MALIDP_LAYER_OFFSET …
#define MALIDP550_LS_ENABLE …
#define MALIDP550_LS_R1_IN_SIZE …
#define MODIFIERS_COUNT_MAX …
#define MALIDP_ALPHA_LUT …
#define MALIDP_MMU_PREFETCH_PARTIAL_PGSIZES …
#define MALIDP_MMU_PREFETCH_FULL_PGSIZES …
#define MALIDP_MMU_PREFETCH_READAHEAD …
static void malidp_plane_reset(struct drm_plane *plane)
{ … }
static struct
drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
{ … }
static void malidp_destroy_plane_state(struct drm_plane *plane,
struct drm_plane_state *state)
{ … }
static const char * const prefetch_mode_names[] = …;
static void malidp_plane_atomic_print_state(struct drm_printer *p,
const struct drm_plane_state *state)
{ … }
bool malidp_format_mod_supported(struct drm_device *drm,
u32 format, u64 modifier)
{ … }
static bool malidp_format_mod_supported_per_plane(struct drm_plane *plane,
u32 format, u64 modifier)
{ … }
static const struct drm_plane_funcs malidp_de_plane_funcs = …;
static int malidp_se_check_scaling(struct malidp_plane *mp,
struct drm_plane_state *state)
{ … }
static u32 malidp_get_pgsize_bitmap(struct malidp_plane *mp)
{ … }
static bool malidp_check_pages_threshold(struct malidp_plane_state *ms,
u32 pgsize)
{ … }
static bool malidp_partial_prefetch_supported(u32 format, u64 modifier,
unsigned int rotation)
{ … }
static enum mmu_prefetch_mode malidp_mmu_prefetch_select_mode
(struct malidp_plane_state *ms, u32 *pgsize_bitmap)
{ … }
static u32 malidp_calc_mmu_control_value(enum mmu_prefetch_mode mode,
u8 readahead, u8 n_planes, u32 pgsize)
{ … }
static void malidp_de_prefetch_settings(struct malidp_plane *mp,
struct malidp_plane_state *ms)
{ … }
static int malidp_de_plane_check(struct drm_plane *plane,
struct drm_atomic_state *state)
{ … }
static void malidp_de_set_plane_pitches(struct malidp_plane *mp,
int num_planes, unsigned int pitches[3])
{ … }
static const s16
malidp_yuv2rgb_coeffs[][DRM_COLOR_RANGE_MAX][MALIDP_COLORADJ_NUM_COEFFS] = …;
static void malidp_de_set_color_encoding(struct malidp_plane *plane,
enum drm_color_encoding enc,
enum drm_color_range range)
{ … }
static void malidp_de_set_mmu_control(struct malidp_plane *mp,
struct malidp_plane_state *ms)
{ … }
static void malidp_set_plane_base_addr(struct drm_framebuffer *fb,
struct malidp_plane *mp,
int plane_index)
{ … }
static void malidp_de_set_plane_afbc(struct drm_plane *plane)
{ … }
static void malidp_de_plane_update(struct drm_plane *plane,
struct drm_atomic_state *state)
{ … }
static void malidp_de_plane_disable(struct drm_plane *plane,
struct drm_atomic_state *state)
{ … }
static const struct drm_plane_helper_funcs malidp_de_plane_helper_funcs = …;
static const uint64_t linear_only_modifiers[] = …;
int malidp_de_planes_init(struct drm_device *drm)
{ … }