forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/vmwgfx/vmwgfx_binding.h
....@@ -27,10 +27,13 @@
2727 #ifndef _VMWGFX_BINDING_H_
2828 #define _VMWGFX_BINDING_H_
2929
30
-#include "device_include/svga3d_reg.h"
3130 #include <linux/list.h>
3231
32
+#include "device_include/svga3d_reg.h"
33
+
3334 #define VMW_MAX_VIEW_BINDINGS 128
35
+
36
+#define VMW_MAX_UAV_BIND_TYPE 2
3437
3538 struct vmw_private;
3639 struct vmw_ctx_binding_state;
....@@ -47,9 +50,12 @@
4750 vmw_ctx_binding_dx_rt,
4851 vmw_ctx_binding_sr,
4952 vmw_ctx_binding_ds,
50
- vmw_ctx_binding_so,
53
+ vmw_ctx_binding_so_target,
5154 vmw_ctx_binding_vb,
5255 vmw_ctx_binding_ib,
56
+ vmw_ctx_binding_uav,
57
+ vmw_ctx_binding_cs_uav,
58
+ vmw_ctx_binding_so,
5359 vmw_ctx_binding_max
5460 };
5561
....@@ -127,14 +133,14 @@
127133 };
128134
129135 /**
130
- * struct vmw_ctx_bindinfo_so - StreamOutput binding metadata
136
+ * struct vmw_ctx_bindinfo_so_target - StreamOutput binding metadata
131137 *
132138 * @bi: struct vmw_ctx_bindinfo we derive from.
133139 * @offset: Device data used to reconstruct binding command.
134140 * @size: Device data used to reconstruct binding command.
135141 * @slot: Device data used to reconstruct binding command.
136142 */
137
-struct vmw_ctx_bindinfo_so {
143
+struct vmw_ctx_bindinfo_so_target {
138144 struct vmw_ctx_bindinfo bi;
139145 uint32 offset;
140146 uint32 size;
....@@ -188,9 +194,31 @@
188194 unsigned long dirty;
189195 };
190196
197
+/**
198
+ * struct vmw_ctx_bindinfo_uav - UAV context binding state.
199
+ * @views: UAV view bindings.
200
+ * @splice_index: The device splice index set by user-space.
201
+ */
202
+struct vmw_ctx_bindinfo_uav {
203
+ struct vmw_ctx_bindinfo_view views[SVGA3D_MAX_UAVIEWS];
204
+ uint32 index;
205
+};
206
+
207
+/**
208
+ * struct vmw_ctx_bindinfo_so - Stream output binding metadata.
209
+ * @bi: struct vmw_ctx_bindinfo we derive from.
210
+ * @slot: Device data used to reconstruct binding command.
211
+ */
212
+struct vmw_ctx_bindinfo_so {
213
+ struct vmw_ctx_bindinfo bi;
214
+ uint32 slot;
215
+};
216
+
191217 extern void vmw_binding_add(struct vmw_ctx_binding_state *cbs,
192218 const struct vmw_ctx_bindinfo *ci,
193219 u32 shader_slot, u32 slot);
220
+extern void vmw_binding_add_uav_index(struct vmw_ctx_binding_state *cbs,
221
+ uint32 slot, uint32 splice_index);
194222 extern void
195223 vmw_binding_state_commit(struct vmw_ctx_binding_state *to,
196224 struct vmw_ctx_binding_state *from);
....@@ -205,5 +233,7 @@
205233 extern struct list_head *
206234 vmw_binding_state_list(struct vmw_ctx_binding_state *cbs);
207235 extern void vmw_binding_state_reset(struct vmw_ctx_binding_state *cbs);
236
+extern u32 vmw_binding_dirtying(enum vmw_ctx_binding_type binding_type);
237
+
208238
209239 #endif