.. | .. |
---|
16 | 16 | #include <linux/dma-mapping.h> |
---|
17 | 17 | #include <linux/err.h> |
---|
18 | 18 | #include <linux/fb.h> |
---|
| 19 | +#include <linux/fdtable.h> |
---|
19 | 20 | #include <linux/fs.h> |
---|
20 | 21 | #include <linux/init.h> |
---|
21 | 22 | #include <linux/interrupt.h> |
---|
.. | .. |
---|
48 | 49 | |
---|
49 | 50 | #include <linux/iommu.h> |
---|
50 | 51 | #include <linux/iova.h> |
---|
51 | | -#include <linux/dma-iommu.h> |
---|
52 | 52 | #include <linux/pagemap.h> |
---|
53 | 53 | |
---|
54 | 54 | #ifdef CONFIG_DMABUF_CACHE |
---|
.. | .. |
---|
87 | 87 | |
---|
88 | 88 | #define DRIVER_MAJOR_VERISON 1 |
---|
89 | 89 | #define DRIVER_MINOR_VERSION 2 |
---|
90 | | -#define DRIVER_REVISION_VERSION 20 |
---|
| 90 | +#define DRIVER_REVISION_VERSION 26 |
---|
91 | 91 | #define DRIVER_PATCH_VERSION |
---|
92 | 92 | |
---|
93 | 93 | #define DRIVER_VERSION (STR(DRIVER_MAJOR_VERISON) "." STR(DRIVER_MINOR_VERSION) \ |
---|
.. | .. |
---|
135 | 135 | RGA_SCHEDULER_IDLE = 0, |
---|
136 | 136 | RGA_SCHEDULER_WORKING, |
---|
137 | 137 | 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, |
---|
138 | 149 | }; |
---|
139 | 150 | |
---|
140 | 151 | struct rga_iommu_dma_cookie { |
---|
.. | .. |
---|
285 | 296 | int ret; |
---|
286 | 297 | pid_t pid; |
---|
287 | 298 | 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; |
---|
288 | 305 | }; |
---|
289 | 306 | |
---|
290 | 307 | struct rga_backend_ops { |
---|
.. | .. |
---|
292 | 309 | int (*set_reg)(struct rga_job *job, struct rga_scheduler_t *scheduler); |
---|
293 | 310 | int (*init_reg)(struct rga_job *job); |
---|
294 | 311 | 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); |
---|
295 | 315 | }; |
---|
296 | 316 | |
---|
297 | 317 | struct rga_timer { |
---|
.. | .. |
---|
421 | 441 | struct rga_match_data_t { |
---|
422 | 442 | const char * const *clks; |
---|
423 | 443 | int num_clks; |
---|
424 | | - const struct rga_irqs_data_t *irqs; |
---|
425 | | - int num_irqs; |
---|
426 | 444 | }; |
---|
427 | 445 | |
---|
428 | 446 | static inline int rga_read(int offset, struct rga_scheduler_t *scheduler) |
---|