hc
2023-11-06 e3e12f52b214121840b44c91de5b3e5af5d3eb84
kernel/drivers/video/rockchip/rga3/include/rga_drv.h
....@@ -16,6 +16,7 @@
1616 #include <linux/dma-mapping.h>
1717 #include <linux/err.h>
1818 #include <linux/fb.h>
19
+#include <linux/fdtable.h>
1920 #include <linux/fs.h>
2021 #include <linux/init.h>
2122 #include <linux/interrupt.h>
....@@ -48,7 +49,6 @@
4849
4950 #include <linux/iommu.h>
5051 #include <linux/iova.h>
51
-#include <linux/dma-iommu.h>
5252 #include <linux/pagemap.h>
5353
5454 #ifdef CONFIG_DMABUF_CACHE
....@@ -87,7 +87,7 @@
8787
8888 #define DRIVER_MAJOR_VERISON 1
8989 #define DRIVER_MINOR_VERSION 2
90
-#define DRIVER_REVISION_VERSION 20
90
+#define DRIVER_REVISION_VERSION 26
9191 #define DRIVER_PATCH_VERSION
9292
9393 #define DRIVER_VERSION (STR(DRIVER_MAJOR_VERISON) "." STR(DRIVER_MINOR_VERSION) \
....@@ -135,6 +135,17 @@
135135 RGA_SCHEDULER_IDLE = 0,
136136 RGA_SCHEDULER_WORKING,
137137 RGA_SCHEDULER_ABORT,
138
+};
139
+
140
+enum rga_job_state {
141
+ RGA_JOB_STATE_PENDING = 0,
142
+ RGA_JOB_STATE_PREPARE,
143
+ RGA_JOB_STATE_RUNNING,
144
+ RGA_JOB_STATE_FINISH,
145
+ RGA_JOB_STATE_DONE,
146
+ RGA_JOB_STATE_INTR_ERR,
147
+ RGA_JOB_STATE_HW_TIMEOUT,
148
+ RGA_JOB_STATE_ABORT,
138149 };
139150
140151 struct rga_iommu_dma_cookie {
....@@ -285,6 +296,12 @@
285296 int ret;
286297 pid_t pid;
287298 bool use_batch_mode;
299
+
300
+ struct kref refcount;
301
+ unsigned long state;
302
+ uint32_t intr_status;
303
+ uint32_t hw_status;
304
+ uint32_t cmd_status;
288305 };
289306
290307 struct rga_backend_ops {
....@@ -292,6 +309,9 @@
292309 int (*set_reg)(struct rga_job *job, struct rga_scheduler_t *scheduler);
293310 int (*init_reg)(struct rga_job *job);
294311 void (*soft_reset)(struct rga_scheduler_t *scheduler);
312
+ int (*read_back_reg)(struct rga_job *job, struct rga_scheduler_t *scheduler);
313
+ int (*irq)(struct rga_scheduler_t *scheduler);
314
+ int (*isr_thread)(struct rga_job *job, struct rga_scheduler_t *scheduler);
295315 };
296316
297317 struct rga_timer {
....@@ -421,8 +441,6 @@
421441 struct rga_match_data_t {
422442 const char * const *clks;
423443 int num_clks;
424
- const struct rga_irqs_data_t *irqs;
425
- int num_irqs;
426444 };
427445
428446 static inline int rga_read(int offset, struct rga_scheduler_t *scheduler)