linux/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <[email protected]>
 */

#include <linux/sort.h>

#include <drm/drm_atomic.h>
#include <drm/drm_blend.h>
#include <drm/drm_mode.h>
#include <drm/drm_crtc.h>
#include <drm/drm_flip_work.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_managed.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>

#include "mdp5_kms.h"
#include "msm_gem.h"

#define CURSOR_WIDTH
#define CURSOR_HEIGHT

struct mdp5_crtc {};
#define to_mdp5_crtc(x)

static void mdp5_crtc_restore_cursor(struct drm_crtc *crtc);

static struct mdp5_kms *get_kms(struct drm_crtc *crtc)
{}

static void request_pending(struct drm_crtc *crtc, uint32_t pending)
{}

static void request_pp_done_pending(struct drm_crtc *crtc)
{}

static u32 crtc_flush(struct drm_crtc *crtc, u32 flush_mask)
{}

/*
 * flush updates, to make sure hw is updated to new scanout fb,
 * so that we can safely queue unref to current fb (ie. next
 * vblank we know hw is done w/ previous scanout_fb).
 */
static u32 crtc_flush_all(struct drm_crtc *crtc)
{}

/* if file!=NULL, this is preclose potential cancel-flip path */
static void complete_flip(struct drm_crtc *crtc, struct drm_file *file)
{}

static void unref_cursor_worker(struct drm_flip_work *work, void *val)
{}

static void mdp5_crtc_flip_cleanup(struct drm_device *dev, void *ptr)
{}

static inline u32 mdp5_lm_use_fg_alpha_mask(enum mdp_mixer_stage_id stage)
{}

/*
 * left/right pipe offsets for the stage array used in blend_setup()
 */
#define PIPE_LEFT
#define PIPE_RIGHT

/*
 * blend_setup() - blend all the planes of a CRTC
 *
 * If no base layer is available, border will be enabled as the base layer.
 * Otherwise all layers will be blended based on their stage calculated
 * in mdp5_crtc_atomic_check.
 */
static void blend_setup(struct drm_crtc *crtc)
{}

static void mdp5_crtc_mode_set_nofb(struct drm_crtc *crtc)
{}

static struct drm_encoder *get_encoder_from_crtc(struct drm_crtc *crtc)
{}

static bool mdp5_crtc_get_scanout_position(struct drm_crtc *crtc,
					   bool in_vblank_irq,
					   int *vpos, int *hpos,
					   ktime_t *stime, ktime_t *etime,
					   const struct drm_display_mode *mode)
{}

static u32 mdp5_crtc_get_vblank_counter(struct drm_crtc *crtc)
{}

static void mdp5_crtc_atomic_disable(struct drm_crtc *crtc,
				     struct drm_atomic_state *state)
{}

static void mdp5_crtc_vblank_on(struct drm_crtc *crtc)
{}

static void mdp5_crtc_atomic_enable(struct drm_crtc *crtc,
				    struct drm_atomic_state *state)
{}

static int mdp5_crtc_setup_pipeline(struct drm_crtc *crtc,
				    struct drm_crtc_state *new_crtc_state,
				    bool need_right_mixer)
{}

struct plane_state {};

static int pstate_cmp(const void *a, const void *b)
{}

/* is there a helper for this? */
static bool is_fullscreen(struct drm_crtc_state *cstate,
		struct drm_plane_state *pstate)
{}

static enum mdp_mixer_stage_id get_start_stage(struct drm_crtc *crtc,
					struct drm_crtc_state *new_crtc_state,
					struct drm_plane_state *bpstate)
{}

static int mdp5_crtc_atomic_check(struct drm_crtc *crtc,
		struct drm_atomic_state *state)
{}

static void mdp5_crtc_atomic_begin(struct drm_crtc *crtc,
				   struct drm_atomic_state *state)
{}

static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc,
				   struct drm_atomic_state *state)
{}

static void get_roi(struct drm_crtc *crtc, uint32_t *roi_w, uint32_t *roi_h)
{}

static void mdp5_crtc_restore_cursor(struct drm_crtc *crtc)
{}

static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
		struct drm_file *file, uint32_t handle,
		uint32_t width, uint32_t height)
{}

static int mdp5_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
{}

static void
mdp5_crtc_atomic_print_state(struct drm_printer *p,
			     const struct drm_crtc_state *state)
{}

static struct drm_crtc_state *
mdp5_crtc_duplicate_state(struct drm_crtc *crtc)
{}

static void mdp5_crtc_destroy_state(struct drm_crtc *crtc, struct drm_crtc_state *state)
{}

static void mdp5_crtc_reset(struct drm_crtc *crtc)
{}

static const struct drm_crtc_funcs mdp5_crtc_no_lm_cursor_funcs =;

static const struct drm_crtc_funcs mdp5_crtc_funcs =;

static const struct drm_crtc_helper_funcs mdp5_crtc_helper_funcs =;

static void mdp5_crtc_vblank_irq(struct mdp_irq *irq, uint32_t irqstatus)
{}

static void mdp5_crtc_err_irq(struct mdp_irq *irq, uint32_t irqstatus)
{}

static void mdp5_crtc_pp_done_irq(struct mdp_irq *irq, uint32_t irqstatus)
{}

static void mdp5_crtc_wait_for_pp_done(struct drm_crtc *crtc)
{}

static void mdp5_crtc_wait_for_flush_done(struct drm_crtc *crtc)
{}

uint32_t mdp5_crtc_vblank(struct drm_crtc *crtc)
{}

void mdp5_crtc_set_pipeline(struct drm_crtc *crtc)
{}

struct mdp5_ctl *mdp5_crtc_get_ctl(struct drm_crtc *crtc)
{}

struct mdp5_hw_mixer *mdp5_crtc_get_mixer(struct drm_crtc *crtc)
{}

struct mdp5_pipeline *mdp5_crtc_get_pipeline(struct drm_crtc *crtc)
{}

void mdp5_crtc_wait_for_commit_done(struct drm_crtc *crtc)
{}

/* initialize crtc */
struct drm_crtc *mdp5_crtc_init(struct drm_device *dev,
				struct drm_plane *plane,
				struct drm_plane *cursor_plane, int id)
{}