1 #ifndef __ROCKCHIP_DRM_RGA__
2 #define __ROCKCHIP_DRM_RGA__
4 #define RGA_CMDBUF_SIZE 14
5 #define RGA_CMDLIST_SIZE 0x20
6 #define RGA_CMDLIST_NUM 64
8 /* cmdlist data structure */
11 u32 data[(RGA_CMDLIST_SIZE + RGA_CMDBUF_SIZE) * 2];
12 u32 last; /* last data offset */
16 struct dma_buf_attachment *src_attach;
17 struct dma_buf_attachment *src1_attach;
18 struct dma_buf_attachment *dst_attach;
21 struct rga_cmdlist_node {
22 struct list_head list;
23 struct rga_cmdlist cmdlist;
26 struct rga_runqueue_node {
27 struct list_head list;
29 struct drm_device *drm_dev;
32 struct drm_file *file;
33 struct completion complete;
35 struct list_head run_cmdlist;
38 void *cmdlist_pool_virt;
39 dma_addr_t cmdlist_pool;
40 struct dma_attrs cmdlist_dma_attrs;
43 struct rockchip_rga_version {
49 struct drm_device *drm_dev;
58 struct rockchip_rga_version version;
59 struct drm_rockchip_subdrv subdrv;
60 struct workqueue_struct *rga_workq;
61 struct work_struct runqueue_work;
63 /* rga command list pool */
64 struct rga_cmdlist_node cmdlist_node[RGA_CMDLIST_NUM];
65 struct mutex cmdlist_mutex;
67 struct list_head free_cmdlist;
70 struct rga_runqueue_node *runqueue_node;
71 struct list_head runqueue_list;
72 struct mutex runqueue_mutex;
73 struct kmem_cache *runqueue_slab;
76 struct rockchip_drm_rga_private {
78 struct list_head inuse_cmdlist;
79 struct list_head userptr_list;
82 #ifdef CONFIG_ROCKCHIP_DRM_RGA
83 int rockchip_rga_get_ver_ioctl(struct drm_device *dev, void *data,
84 struct drm_file *file_priv);
85 int rockchip_rga_set_cmdlist_ioctl(struct drm_device *dev, void *data,
86 struct drm_file *file_priv);
87 int rockchip_rga_exec_ioctl(struct drm_device *dev, void *data,
88 struct drm_file *file_priv);
90 static inline int rockchip_rga_get_ver_ioctl(struct drm_device *dev, void *data,
91 struct drm_file *file_priv)
96 static inline int rockchip_rga_set_cmdlist_ioctl(struct drm_device *dev,
98 struct drm_file *file_priv)
103 static inline int rockchip_rga_exec_ioctl(struct drm_device *dev, void *data,
104 struct drm_file *file_priv)
110 #endif /* __ROCKCHIP_DRM_RGA__ */