#include <linux/debugfs.h>
#include <linux/delay.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_vblank.h>
#include "lsdc_drv.h"
static void lsdc_crtc0_soft_reset(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_soft_reset(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_enable(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_disable(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_enable(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_disable(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_scan_pos(struct lsdc_crtc *lcrtc, int *hpos, int *vpos)
{ … }
static void lsdc_crtc1_scan_pos(struct lsdc_crtc *lcrtc, int *hpos, int *vpos)
{ … }
static void lsdc_crtc0_enable_vblank(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_disable_vblank(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_enable_vblank(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_disable_vblank(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_flip(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_flip(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_clone(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_clone(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_set_mode(struct lsdc_crtc *lcrtc,
const struct drm_display_mode *mode)
{ … }
static void lsdc_crtc1_set_mode(struct lsdc_crtc *lcrtc,
const struct drm_display_mode *mode)
{ … }
static void lsdc_crtc0_reset(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc1_reset(struct lsdc_crtc *lcrtc)
{ … }
static const struct lsdc_crtc_hw_ops ls7a1000_crtc_hw_ops[2] = …;
static u32 lsdc_crtc0_get_vblank_count(struct lsdc_crtc *lcrtc)
{ … }
static u32 lsdc_crtc1_get_vblank_count(struct lsdc_crtc *lcrtc)
{ … }
static void lsdc_crtc0_set_dma_step(struct lsdc_crtc *lcrtc,
enum lsdc_dma_steps dma_step)
{ … }
static void lsdc_crtc1_set_dma_step(struct lsdc_crtc *lcrtc,
enum lsdc_dma_steps dma_step)
{ … }
static const struct lsdc_crtc_hw_ops ls7a2000_crtc_hw_ops[2] = …;
static void lsdc_crtc_reset(struct drm_crtc *crtc)
{ … }
static void lsdc_crtc_atomic_destroy_state(struct drm_crtc *crtc,
struct drm_crtc_state *state)
{ … }
static struct drm_crtc_state *
lsdc_crtc_atomic_duplicate_state(struct drm_crtc *crtc)
{ … }
static u32 lsdc_crtc_get_vblank_counter(struct drm_crtc *crtc)
{ … }
static int lsdc_crtc_enable_vblank(struct drm_crtc *crtc)
{ … }
static void lsdc_crtc_disable_vblank(struct drm_crtc *crtc)
{ … }
#define REG_DEF(reg) …
static const struct lsdc_reg32 lsdc_crtc_regs_array[2][21] = …;
static int lsdc_crtc_show_regs(struct seq_file *m, void *arg)
{ … }
static int lsdc_crtc_show_scan_position(struct seq_file *m, void *arg)
{ … }
static int lsdc_crtc_show_vblank_counter(struct seq_file *m, void *arg)
{ … }
static int lsdc_pixpll_show_clock(struct seq_file *m, void *arg)
{ … }
static struct drm_info_list lsdc_crtc_debugfs_list[2][4] = …;
static int lsdc_crtc_man_op_show(struct seq_file *m, void *data)
{ … }
static int lsdc_crtc_man_op_open(struct inode *inode, struct file *file)
{ … }
static ssize_t lsdc_crtc_man_op_write(struct file *file,
const char __user *ubuf,
size_t len,
loff_t *offp)
{ … }
static const struct file_operations lsdc_crtc_man_op_fops = …;
static int lsdc_crtc_late_register(struct drm_crtc *crtc)
{ … }
static void lsdc_crtc_atomic_print_state(struct drm_printer *p,
const struct drm_crtc_state *state)
{ … }
static const struct drm_crtc_funcs ls7a1000_crtc_funcs = …;
static const struct drm_crtc_funcs ls7a2000_crtc_funcs = …;
static enum drm_mode_status
lsdc_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode)
{ … }
static int lsdc_pixpll_atomic_check(struct drm_crtc *crtc,
struct drm_crtc_state *state)
{ … }
static int lsdc_crtc_helper_atomic_check(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{ … }
static void lsdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
{ … }
static void lsdc_crtc_send_vblank(struct drm_crtc *crtc)
{ … }
static void lsdc_crtc_atomic_enable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{ … }
static void lsdc_crtc_atomic_disable(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{ … }
static void lsdc_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_atomic_state *state)
{ … }
static bool lsdc_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 const struct drm_crtc_helper_funcs lsdc_crtc_helper_funcs = …;
int ls7a1000_crtc_init(struct drm_device *ddev,
struct drm_crtc *crtc,
struct drm_plane *primary,
struct drm_plane *cursor,
unsigned int index,
bool has_vblank)
{ … }
int ls7a2000_crtc_init(struct drm_device *ddev,
struct drm_crtc *crtc,
struct drm_plane *primary,
struct drm_plane *cursor,
unsigned int index,
bool has_vblank)
{ … }