radeonsi/winsys: add cs_get_ip_type function

Will be used in the next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26774>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2023-10-03 10:24:20 +02:00 committed by Marge Bot
parent c1f08608b8
commit a2cfd4186f
3 changed files with 20 additions and 0 deletions

View file

@ -676,6 +676,11 @@ struct radeon_winsys {
*/
void (*cs_add_syncobj_signal)(struct radeon_cmdbuf *cs, struct pipe_fence_handle *fence);
/**
* Returns the amd_ip_type type of a CS.
*/
enum amd_ip_type (*cs_get_ip_type)(struct radeon_cmdbuf *cs);
/**
* Wait for the fence and return true if the fence has been signalled.
* The timeout of 0 will only return the status.

View file

@ -940,6 +940,13 @@ static void amdgpu_destroy_cs_context(struct amdgpu_winsys *ws, struct amdgpu_cs
}
static enum amd_ip_type amdgpu_cs_get_ip_type(struct radeon_cmdbuf *rcs)
{
struct amdgpu_cs *cs = amdgpu_cs(rcs);
return cs->ip_type;
}
static bool
amdgpu_cs_create(struct radeon_cmdbuf *rcs,
struct radeon_winsys_ctx *rwctx,
@ -1815,6 +1822,7 @@ void amdgpu_cs_init_functions(struct amdgpu_screen_winsys *ws)
ws->base.cs_sync_flush = amdgpu_cs_sync_flush;
ws->base.cs_add_fence_dependency = amdgpu_cs_add_fence_dependency;
ws->base.cs_add_syncobj_signal = amdgpu_cs_add_syncobj_signal;
ws->base.cs_get_ip_type = amdgpu_cs_get_ip_type;
ws->base.fence_wait = amdgpu_fence_wait_rel_timeout;
ws->base.fence_reference = amdgpu_fence_reference;
ws->base.fence_import_syncobj = amdgpu_fence_import_syncobj;

View file

@ -167,6 +167,13 @@ static void radeon_destroy_cs_context(struct radeon_cs_context *csc)
}
static enum amd_ip_type radeon_drm_cs_get_ip_type(struct radeon_cmdbuf *rcs)
{
struct radeon_drm_cs *cs = radeon_drm_cs(rcs);
return cs->ip_type;
}
static bool
radeon_drm_cs_create(struct radeon_cmdbuf *rcs,
struct radeon_winsys_ctx *ctx,