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 <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21662>
This commit is contained in:
Asahi Lina 2023-03-01 17:35:37 +09:00 committed by Marge Bot
parent 7f2e24d2ef
commit 942d9cc17b
2 changed files with 16 additions and 6 deletions

View file

@ -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");
}

View file

@ -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