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 * 2];
12 u32 last; /* last data offset */
16 struct dma_buf_attachment *src_attach;
17 struct dma_buf_attachment *dst_attach;
20 struct rga_cmdlist_node {
21 struct list_head list;
22 struct rga_cmdlist cmdlist;
25 struct rga_runqueue_node {
26 struct list_head list;
30 struct drm_file *file;
31 struct completion complete;
33 struct list_head run_cmdlist;
36 void *cmdlist_pool_virt;
37 dma_addr_t cmdlist_pool;
38 struct dma_attrs cmdlist_dma_attrs;
41 struct rockchip_rga_version {
47 struct drm_device *drm_dev;
56 struct rockchip_rga_version version;
57 struct drm_rockchip_subdrv subdrv;
58 struct workqueue_struct *rga_workq;
59 struct work_struct runqueue_work;
61 /* rga command list pool */
62 struct rga_cmdlist_node cmdlist_node[RGA_CMDLIST_NUM];
63 struct mutex cmdlist_mutex;
65 struct list_head free_cmdlist;
68 struct rga_runqueue_node *runqueue_node;
69 struct list_head runqueue_list;
70 struct mutex runqueue_mutex;
71 struct kmem_cache *runqueue_slab;
74 struct rockchip_drm_rga_private {
76 struct list_head inuse_cmdlist;
77 struct list_head userptr_list;
80 #ifdef CONFIG_ROCKCHIP_DRM_RGA
81 int rockchip_rga_get_ver_ioctl(struct drm_device *dev, void *data,
82 struct drm_file *file_priv);
83 int rockchip_rga_set_cmdlist_ioctl(struct drm_device *dev, void *data,
84 struct drm_file *file_priv);
85 int rockchip_rga_exec_ioctl(struct drm_device *dev, void *data,
86 struct drm_file *file_priv);
88 static inline int rockchip_rga_get_ver_ioctl(struct drm_device *dev, void *data,
89 struct drm_file *file_priv)
94 static inline int rockchip_rga_set_cmdlist_ioctl(struct drm_device *dev,
96 struct drm_file *file_priv)
101 static inline int rockchip_rga_exec_ioctl(struct drm_device *dev, void *data,
102 struct drm_file *file_priv)
108 #endif /* __ROCKCHIP_DRM_RGA__ */