Module: Mesa
Branch: main
Commit: 942d9cc17b425223e1168f8c8308a6b7f21d368d
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=942d9cc17b425223e1168f8c8308a6b7f21d368d

Author: Asahi Lina <[email protected]>
Date:   Wed Mar  1 17:35:37 2023 +0900

asahi: Align device submission API with upcoming UAPI

Nothing implemented, but this lets us get the batch tracking bits in,
including explicit sync/DMA-BUF integration which uses generic ioctls.

Signed-off-by: Asahi Lina <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>

---

 src/asahi/lib/agx_device.c | 10 +++++++---
 src/asahi/lib/agx_device.h | 12 +++++++++---
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/asahi/lib/agx_device.c b/src/asahi/lib/agx_device.c
index f5cd3d5f4b6..5f6653802e2 100644
--- a/src/asahi/lib/agx_device.c
+++ b/src/asahi/lib/agx_device.c
@@ -139,8 +139,12 @@ agx_close_device(struct agx_device *dev)
    util_sparse_array_finish(&dev->bo_map);
 }
 
-void
-agx_submit_cmdbuf(struct agx_device *dev, unsigned cmdbuf, unsigned mappings,
-                  uint64_t scalar)
+int
+agx_submit_single(struct agx_device *dev, enum drm_asahi_cmd_type cmd_type,
+                  uint32_t barriers, struct drm_asahi_sync *in_syncs,
+                  unsigned in_sync_count, struct drm_asahi_sync *out_syncs,
+                  unsigned out_sync_count, void *cmdbuf, uint32_t 
result_handle,
+                  uint32_t result_off, uint32_t result_size)
 {
+   unreachable("Linux UAPI not yet upstream");
 }
diff --git a/src/asahi/lib/agx_device.h b/src/asahi/lib/agx_device.h
index bfbbb7f2af7..25aced23289 100644
--- a/src/asahi/lib/agx_device.h
+++ b/src/asahi/lib/agx_device.h
@@ -28,7 +28,6 @@
 #include "util/sparse_array.h"
 #include "agx_bo.h"
 #include "agx_formats.h"
-#include "agx_bo.h"
 
 enum agx_dbg {
    AGX_DBG_TRACE = BITFIELD_BIT(0),
@@ -43,6 +42,9 @@ enum agx_dbg {
    AGX_DBG_STATS = BITFIELD_BIT(9),
 };
 
+enum drm_asahi_cmd_type { DRM_ASAHI_CMD_TYPE_PLACEHOLDER_FOR_DOWNSTREAM_UAPI };
+struct drm_asahi_sync {};
+
 /* How many power-of-two levels in the BO cache do we want? 2^14 minimum chosen
  * as it is the page size that all allocations are rounded to
  */
@@ -97,7 +99,11 @@ agx_lookup_bo(struct agx_device *dev, uint32_t handle)
 
 uint64_t agx_get_global_id(struct agx_device *dev);
 
-void agx_submit_cmdbuf(struct agx_device *dev, unsigned cmdbuf,
-                       unsigned mappings, uint64_t scalar);
+int agx_submit_single(struct agx_device *dev, enum drm_asahi_cmd_type cmd_type,
+                      uint32_t barriers, struct drm_asahi_sync *in_syncs,
+                      unsigned in_sync_count, struct drm_asahi_sync *out_syncs,
+                      unsigned out_sync_count, void *cmdbuf,
+                      uint32_t result_handle, uint32_t result_off,
+                      uint32_t result_size);
 
 #endif

Reply via email to