#include <drm/drm_atomic.h>
#include <drm/drm_blend.h>
#include <drm/drm_damage_helper.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_framebuffer.h>
#include <drm/drm_gem_atomic_helper.h>
#include <drm/drm_print.h>
#include "mdp5_kms.h"
struct mdp5_plane { … };
#define to_mdp5_plane(x) …
static int mdp5_plane_mode_set(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_framebuffer *fb,
struct drm_rect *src, struct drm_rect *dest);
static struct mdp5_kms *get_kms(struct drm_plane *plane)
{ … }
static bool plane_enabled(struct drm_plane_state *state)
{ … }
static void mdp5_plane_install_properties(struct drm_plane *plane,
struct drm_mode_object *obj)
{ … }
static void
mdp5_plane_atomic_print_state(struct drm_printer *p,
const struct drm_plane_state *state)
{ … }
static void mdp5_plane_reset(struct drm_plane *plane)
{ … }
static struct drm_plane_state *
mdp5_plane_duplicate_state(struct drm_plane *plane)
{ … }
static void mdp5_plane_destroy_state(struct drm_plane *plane,
struct drm_plane_state *state)
{ … }
static const struct drm_plane_funcs mdp5_plane_funcs = …;
static int mdp5_plane_prepare_fb(struct drm_plane *plane,
struct drm_plane_state *new_state)
{ … }
static void mdp5_plane_cleanup_fb(struct drm_plane *plane,
struct drm_plane_state *old_state)
{ … }
static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,
struct drm_plane_state *state)
{ … }
static int mdp5_plane_atomic_check(struct drm_plane *plane,
struct drm_atomic_state *state)
{ … }
static void mdp5_plane_atomic_update(struct drm_plane *plane,
struct drm_atomic_state *state)
{ … }
static int mdp5_plane_atomic_async_check(struct drm_plane *plane,
struct drm_atomic_state *state)
{ … }
static void mdp5_plane_atomic_async_update(struct drm_plane *plane,
struct drm_atomic_state *state)
{ … }
static const struct drm_plane_helper_funcs mdp5_plane_helper_funcs = …;
static void set_scanout_locked(struct mdp5_kms *mdp5_kms,
enum mdp5_pipe pipe,
struct drm_framebuffer *fb)
{ … }
static void csc_disable(struct mdp5_kms *mdp5_kms, enum mdp5_pipe pipe)
{ … }
static void csc_enable(struct mdp5_kms *mdp5_kms, enum mdp5_pipe pipe,
struct csc_cfg *csc)
{ … }
#define PHASE_STEP_SHIFT …
#define DOWN_SCALE_RATIO_MAX …
static int calc_phase_step(uint32_t src, uint32_t dst, uint32_t *out_phase)
{ … }
static int calc_scalex_steps(struct drm_plane *plane,
uint32_t pixel_format, uint32_t src, uint32_t dest,
uint32_t phasex_steps[COMP_MAX])
{ … }
static int calc_scaley_steps(struct drm_plane *plane,
uint32_t pixel_format, uint32_t src, uint32_t dest,
uint32_t phasey_steps[COMP_MAX])
{ … }
static uint32_t get_scale_config(const struct msm_format *format,
uint32_t src, uint32_t dst, bool horz)
{ … }
static void calc_pixel_ext(const struct msm_format *format,
uint32_t src, uint32_t dst, uint32_t phase_step[2],
int pix_ext_edge1[COMP_MAX], int pix_ext_edge2[COMP_MAX],
bool horz)
{ … }
static void mdp5_write_pixel_ext(struct mdp5_kms *mdp5_kms, enum mdp5_pipe pipe,
const struct msm_format *format,
uint32_t src_w, int pe_left[COMP_MAX], int pe_right[COMP_MAX],
uint32_t src_h, int pe_top[COMP_MAX], int pe_bottom[COMP_MAX])
{ … }
struct pixel_ext { … };
struct phase_step { … };
static void mdp5_hwpipe_mode_set(struct mdp5_kms *mdp5_kms,
struct mdp5_hw_pipe *hwpipe,
struct drm_framebuffer *fb,
struct phase_step *step,
struct pixel_ext *pe,
u32 scale_config, u32 hdecm, u32 vdecm,
bool hflip, bool vflip,
int crtc_x, int crtc_y,
unsigned int crtc_w, unsigned int crtc_h,
u32 src_img_w, u32 src_img_h,
u32 src_x, u32 src_y,
u32 src_w, u32 src_h)
{ … }
static int mdp5_plane_mode_set(struct drm_plane *plane,
struct drm_crtc *crtc, struct drm_framebuffer *fb,
struct drm_rect *src, struct drm_rect *dest)
{ … }
enum mdp5_pipe mdp5_plane_pipe(struct drm_plane *plane)
{ … }
enum mdp5_pipe mdp5_plane_right_pipe(struct drm_plane *plane)
{ … }
uint32_t mdp5_plane_get_flush(struct drm_plane *plane)
{ … }
static const uint32_t mdp5_plane_formats[] = …;
struct drm_plane *mdp5_plane_init(struct drm_device *dev,
enum drm_plane_type type)
{ … }