hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/gpu/drm/etnaviv/etnaviv_gpu.h
....@@ -6,21 +6,20 @@
66 #ifndef __ETNAVIV_GPU_H__
77 #define __ETNAVIV_GPU_H__
88
9
-#include <linux/clk.h>
10
-#include <linux/regulator/consumer.h>
11
-
129 #include "etnaviv_cmdbuf.h"
10
+#include "etnaviv_gem.h"
11
+#include "etnaviv_mmu.h"
1312 #include "etnaviv_drv.h"
1413
1514 struct etnaviv_gem_submit;
1615 struct etnaviv_vram_mapping;
1716
1817 struct etnaviv_chip_identity {
19
- /* Chip model. */
2018 u32 model;
21
-
22
- /* Revision value.*/
2319 u32 revision;
20
+ u32 product_id;
21
+ u32 customer_id;
22
+ u32 eco_id;
2423
2524 /* Supported feature fields. */
2625 u32 features;
....@@ -87,7 +86,8 @@
8786 };
8887
8988 struct etnaviv_cmdbuf_suballoc;
90
-struct etnaviv_cmdbuf;
89
+struct regulator;
90
+struct clk;
9191
9292 #define ETNA_NR_EVENTS 30
9393
....@@ -98,16 +98,14 @@
9898 struct mutex lock;
9999 struct etnaviv_chip_identity identity;
100100 enum etnaviv_sec_mode sec_mode;
101
- struct etnaviv_file_private *lastctx;
102101 struct workqueue_struct *wq;
103102 struct drm_gpu_scheduler sched;
103
+ bool initialized;
104
+ bool fe_running;
104105
105106 /* 'ring'-buffer: */
106107 struct etnaviv_cmdbuf buffer;
107108 int exec_state;
108
-
109
- /* bus base address of memory */
110
- u32 memory_base;
111109
112110 /* event management: */
113111 DECLARE_BITMAP(event_bitmap, ETNA_NR_EVENTS);
....@@ -121,7 +119,6 @@
121119 struct mutex fence_lock;
122120 struct idr fence_idr;
123121 u32 next_fence;
124
- u32 active_fence;
125122 u32 completed_fence;
126123 wait_queue_head_t fence_event;
127124 u64 fence_context;
....@@ -133,12 +130,12 @@
133130
134131 /* hang detection */
135132 u32 hangcheck_dma_addr;
133
+ u32 hangcheck_fence;
136134
137135 void __iomem *mmio;
138136 int irq;
139137
140
- struct etnaviv_iommu *mmu;
141
- struct etnaviv_cmdbuf_suballoc *cmdbuf_suballoc;
138
+ struct etnaviv_iommu_context *mmu_context;
142139 unsigned int flush_seq;
143140
144141 /* Power Control: */
....@@ -162,11 +159,6 @@
162159 return readl(gpu->mmio + reg);
163160 }
164161
165
-static inline bool fence_completed(struct etnaviv_gpu *gpu, u32 fence)
166
-{
167
- return fence_after_eq(gpu->completed_fence, fence);
168
-}
169
-
170162 int etnaviv_gpu_get_param(struct etnaviv_gpu *gpu, u32 param, u64 *value);
171163
172164 int etnaviv_gpu_init(struct etnaviv_gpu *gpu);
....@@ -179,9 +171,10 @@
179171 void etnaviv_gpu_recover_hang(struct etnaviv_gpu *gpu);
180172 void etnaviv_gpu_retire(struct etnaviv_gpu *gpu);
181173 int etnaviv_gpu_wait_fence_interruptible(struct etnaviv_gpu *gpu,
182
- u32 fence, struct timespec *timeout);
174
+ u32 fence, struct drm_etnaviv_timespec *timeout);
183175 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);
185178 struct dma_fence *etnaviv_gpu_submit(struct etnaviv_gem_submit *submit);
186179 int etnaviv_gpu_pm_get_sync(struct etnaviv_gpu *gpu);
187180 void etnaviv_gpu_pm_put(struct etnaviv_gpu *gpu);