#ifndef __LSDC_DRV_H__
#define __LSDC_DRV_H__
#include <linux/pci.h>
#include <drm/drm_connector.h>
#include <drm/drm_crtc.h>
#include <drm/drm_device.h>
#include <drm/drm_encoder.h>
#include <drm/drm_file.h>
#include <drm/drm_plane.h>
#include <drm/ttm/ttm_device.h>
#include "lsdc_i2c.h"
#include "lsdc_irq.h"
#include "lsdc_gfxpll.h"
#include "lsdc_output.h"
#include "lsdc_pixpll.h"
#include "lsdc_regs.h"
#define LSDC_NUM_CRTC …
enum loongson_chip_id { … };
const struct lsdc_desc *
lsdc_device_probe(struct pci_dev *pdev, enum loongson_chip_id chip);
struct lsdc_kms_funcs;
struct lsdc_desc { … };
struct loongson_gfx_desc { … };
static inline const struct loongson_gfx_desc *
to_loongson_gfx(const struct lsdc_desc *dcp)
{
return container_of_const(dcp, struct loongson_gfx_desc, dc);
};
struct lsdc_reg32 { … };
struct lsdc_crtc;
struct lsdc_crtc_hw_ops { … };
struct lsdc_crtc { … };
struct lsdc_primary;
struct lsdc_primary_plane_ops { … };
struct lsdc_primary { … };
struct lsdc_cursor;
struct lsdc_cursor_plane_ops { … };
struct lsdc_cursor { … };
struct lsdc_output { … };
static inline struct lsdc_output *
connector_to_lsdc_output(struct drm_connector *connector)
{ … }
static inline struct lsdc_output *
encoder_to_lsdc_output(struct drm_encoder *encoder)
{ … }
struct lsdc_display_pipe { … };
static inline struct lsdc_display_pipe *
output_to_display_pipe(struct lsdc_output *output)
{ … }
struct lsdc_kms_funcs { … };
static inline struct lsdc_crtc *
to_lsdc_crtc(struct drm_crtc *crtc)
{ … }
static inline struct lsdc_display_pipe *
crtc_to_display_pipe(struct drm_crtc *crtc)
{ … }
static inline struct lsdc_primary *
to_lsdc_primary(struct drm_plane *plane)
{ … }
static inline struct lsdc_cursor *
to_lsdc_cursor(struct drm_plane *plane)
{ … }
struct lsdc_crtc_state { … };
struct lsdc_gem { … };
struct lsdc_device { … };
static inline struct lsdc_device *tdev_to_ldev(struct ttm_device *bdev)
{ … }
static inline struct lsdc_device *to_lsdc(struct drm_device *ddev)
{ … }
static inline struct lsdc_crtc_state *
to_lsdc_crtc_state(struct drm_crtc_state *base)
{ … }
void lsdc_debugfs_init(struct drm_minor *minor);
int ls7a1000_crtc_init(struct drm_device *ddev,
struct drm_crtc *crtc,
struct drm_plane *primary,
struct drm_plane *cursor,
unsigned int index,
bool no_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 no_vblank);
int lsdc_primary_plane_init(struct drm_device *ddev,
struct drm_plane *plane,
unsigned int index);
int ls7a1000_cursor_plane_init(struct drm_device *ddev,
struct drm_plane *plane,
unsigned int index);
int ls7a2000_cursor_plane_init(struct drm_device *ddev,
struct drm_plane *plane,
unsigned int index);
static inline u32 lsdc_rreg32(struct lsdc_device *ldev, u32 offset)
{ … }
static inline void lsdc_wreg32(struct lsdc_device *ldev, u32 offset, u32 val)
{ … }
static inline void lsdc_ureg32_set(struct lsdc_device *ldev,
u32 offset,
u32 mask)
{ … }
static inline void lsdc_ureg32_clr(struct lsdc_device *ldev,
u32 offset,
u32 mask)
{ … }
static inline u32 lsdc_pipe_rreg32(struct lsdc_device *ldev,
u32 offset, u32 pipe)
{ … }
static inline void lsdc_pipe_wreg32(struct lsdc_device *ldev,
u32 offset, u32 pipe, u32 val)
{ … }
#endif