pvr: Add pvrsrvkm sync prim set bridge call

To reuse a sync prim we'll need to set it to 0 so adding the
bridge call for that.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23076>
This commit is contained in:
Karmjit Mahil 2023-05-12 09:33:06 +01:00 committed by Marge Bot
parent 9938865705
commit d1e61d563d
2 changed files with 50 additions and 0 deletions

View file

@ -309,6 +309,37 @@ void pvr_srv_free_sync_primitive_block(int fd, void *handle)
}
}
VkResult
pvr_srv_set_sync_primitive(int fd, void *handle, uint32_t index, uint32_t value)
{
struct pvr_srv_bridge_sync_prim_set_cmd cmd = {
.handle = handle,
.index = index,
.value = value,
};
struct pvr_srv_bridge_sync_prim_set_ret ret = {
.error = PVR_SRV_ERROR_BRIDGE_CALL_FAILED,
};
int result;
result = pvr_srv_bridge_call(fd,
PVR_SRV_BRIDGE_SYNC,
PVR_SRV_BRIDGE_SYNC_SYNCPRIMSET,
&cmd,
sizeof(cmd),
&ret,
sizeof(ret));
if (result || ret.error != PVR_SRV_OK) {
return vk_bridge_err(VK_ERROR_UNKNOWN,
"PVR_SRV_BRIDGE_SYNC_SYNCPRIMSET",
ret);
}
return VK_SUCCESS;
}
VkResult pvr_srv_get_heap_count(int fd, uint32_t *const heap_count_out)
{
struct pvr_srv_heap_count_cmd cmd = {

View file

@ -46,6 +46,7 @@
#define PVR_SRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK 0UL
#define PVR_SRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK 1UL
#define PVR_SRV_BRIDGE_SYNC_SYNCPRIMSET 2UL
#define PVR_SRV_BRIDGE_MM 6UL
@ -247,6 +248,20 @@ struct pvr_srv_bridge_free_sync_primitive_block_ret {
enum pvr_srv_error error;
} PACKED;
/******************************************************************************
PVR_SRV_BRIDGE_SYNC_SYNCPRIMSET structs
******************************************************************************/
struct pvr_srv_bridge_sync_prim_set_cmd {
void *handle;
uint32_t index;
uint32_t value;
} PACKED;
struct pvr_srv_bridge_sync_prim_set_ret {
enum pvr_srv_error error;
} PACKED;
/******************************************************************************
PVR_SRV_BRIDGE_MM_DEVMEMINTCTXCREATE structs
******************************************************************************/
@ -885,6 +900,10 @@ VkResult pvr_srv_alloc_sync_primitive_block(int fd,
uint32_t *const size_out,
uint32_t *const addr_out);
void pvr_srv_free_sync_primitive_block(int fd, void *handle);
VkResult pvr_srv_set_sync_primitive(int fd,
void *handle,
uint32_t index,
uint32_t value);
VkResult pvr_srv_get_heap_count(int fd, uint32_t *const heap_count_out);
VkResult pvr_srv_get_heap_details(int fd,