.. | .. |
---|
6 | 6 | #ifndef __ETNAVIV_GPU_H__ |
---|
7 | 7 | #define __ETNAVIV_GPU_H__ |
---|
8 | 8 | |
---|
9 | | -#include <linux/clk.h> |
---|
10 | | -#include <linux/regulator/consumer.h> |
---|
11 | | - |
---|
12 | 9 | #include "etnaviv_cmdbuf.h" |
---|
| 10 | +#include "etnaviv_gem.h" |
---|
| 11 | +#include "etnaviv_mmu.h" |
---|
13 | 12 | #include "etnaviv_drv.h" |
---|
14 | 13 | |
---|
15 | 14 | struct etnaviv_gem_submit; |
---|
16 | 15 | struct etnaviv_vram_mapping; |
---|
17 | 16 | |
---|
18 | 17 | struct etnaviv_chip_identity { |
---|
19 | | - /* Chip model. */ |
---|
20 | 18 | u32 model; |
---|
21 | | - |
---|
22 | | - /* Revision value.*/ |
---|
23 | 19 | u32 revision; |
---|
| 20 | + u32 product_id; |
---|
| 21 | + u32 customer_id; |
---|
| 22 | + u32 eco_id; |
---|
24 | 23 | |
---|
25 | 24 | /* Supported feature fields. */ |
---|
26 | 25 | u32 features; |
---|
.. | .. |
---|
87 | 86 | }; |
---|
88 | 87 | |
---|
89 | 88 | struct etnaviv_cmdbuf_suballoc; |
---|
90 | | -struct etnaviv_cmdbuf; |
---|
| 89 | +struct regulator; |
---|
| 90 | +struct clk; |
---|
91 | 91 | |
---|
92 | 92 | #define ETNA_NR_EVENTS 30 |
---|
93 | 93 | |
---|
.. | .. |
---|
98 | 98 | struct mutex lock; |
---|
99 | 99 | struct etnaviv_chip_identity identity; |
---|
100 | 100 | enum etnaviv_sec_mode sec_mode; |
---|
101 | | - struct etnaviv_file_private *lastctx; |
---|
102 | 101 | struct workqueue_struct *wq; |
---|
103 | 102 | struct drm_gpu_scheduler sched; |
---|
| 103 | + bool initialized; |
---|
| 104 | + bool fe_running; |
---|
104 | 105 | |
---|
105 | 106 | /* 'ring'-buffer: */ |
---|
106 | 107 | struct etnaviv_cmdbuf buffer; |
---|
107 | 108 | int exec_state; |
---|
108 | | - |
---|
109 | | - /* bus base address of memory */ |
---|
110 | | - u32 memory_base; |
---|
111 | 109 | |
---|
112 | 110 | /* event management: */ |
---|
113 | 111 | DECLARE_BITMAP(event_bitmap, ETNA_NR_EVENTS); |
---|
.. | .. |
---|
121 | 119 | struct mutex fence_lock; |
---|
122 | 120 | struct idr fence_idr; |
---|
123 | 121 | u32 next_fence; |
---|
124 | | - u32 active_fence; |
---|
125 | 122 | u32 completed_fence; |
---|
126 | 123 | wait_queue_head_t fence_event; |
---|
127 | 124 | u64 fence_context; |
---|
.. | .. |
---|
133 | 130 | |
---|
134 | 131 | /* hang detection */ |
---|
135 | 132 | u32 hangcheck_dma_addr; |
---|
| 133 | + u32 hangcheck_fence; |
---|
136 | 134 | |
---|
137 | 135 | void __iomem *mmio; |
---|
138 | 136 | int irq; |
---|
139 | 137 | |
---|
140 | | - struct etnaviv_iommu *mmu; |
---|
141 | | - struct etnaviv_cmdbuf_suballoc *cmdbuf_suballoc; |
---|
| 138 | + struct etnaviv_iommu_context *mmu_context; |
---|
142 | 139 | unsigned int flush_seq; |
---|
143 | 140 | |
---|
144 | 141 | /* Power Control: */ |
---|
.. | .. |
---|
162 | 159 | return readl(gpu->mmio + reg); |
---|
163 | 160 | } |
---|
164 | 161 | |
---|
165 | | -static inline bool fence_completed(struct etnaviv_gpu *gpu, u32 fence) |
---|
166 | | -{ |
---|
167 | | - return fence_after_eq(gpu->completed_fence, fence); |
---|
168 | | -} |
---|
169 | | - |
---|
170 | 162 | int etnaviv_gpu_get_param(struct etnaviv_gpu *gpu, u32 param, u64 *value); |
---|
171 | 163 | |
---|
172 | 164 | int etnaviv_gpu_init(struct etnaviv_gpu *gpu); |
---|
.. | .. |
---|
179 | 171 | void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu); |
---|
180 | 172 | void etnaviv_gpu_retire(struct etnaviv_gpu *gpu); |
---|
181 | 173 | int etnaviv_gpu_wait_fence_interruptible(struct etnaviv_gpu *gpu, |
---|
182 | | - u32 fence, struct timespec *timeout); |
---|
| 174 | + u32 fence, struct drm_etnaviv_timespec *timeout); |
---|
183 | 175 | int etnaviv_gpu_wait_obj_inactive(struct etnaviv_gpu *gpu, |
---|
184 | | - struct etnaviv_gem_object *etnaviv_obj, struct timespec *timeout); |
---|
| 176 | + struct etnaviv_gem_object *etnaviv_obj, |
---|
| 177 | + struct drm_etnaviv_timespec *timeout); |
---|
185 | 178 | struct dma_fence *etnaviv_gpu_submit(struct etnaviv_gem_submit *submit); |
---|
186 | 179 | int etnaviv_gpu_pm_get_sync(struct etnaviv_gpu *gpu); |
---|
187 | 180 | void etnaviv_gpu_pm_put(struct etnaviv_gpu *gpu); |
---|