amdgpu: add amdgpu_cs_fence_to_handle
v2: update amdgpu-symbol-check Reviewed-by: Chunming Zhou <david1.zhou@amd.com>main
parent
59aa57b363
commit
c74d461404
|
@ -34,6 +34,7 @@ amdgpu_cs_ctx_free
|
|||
amdgpu_cs_destroy_semaphore
|
||||
amdgpu_cs_destroy_syncobj
|
||||
amdgpu_cs_export_syncobj
|
||||
amdgpu_cs_fence_to_handle
|
||||
amdgpu_cs_import_syncobj
|
||||
amdgpu_cs_query_fence_status
|
||||
amdgpu_cs_query_reset_state
|
||||
|
|
|
@ -1432,6 +1432,20 @@ int amdgpu_cs_syncobj_import_sync_file(amdgpu_device_handle dev,
|
|||
uint32_t syncobj,
|
||||
int sync_file_fd);
|
||||
|
||||
/**
|
||||
* Export an amdgpu fence as a handle (syncobj or fd).
|
||||
*
|
||||
* \param what AMDGPU_FENCE_TO_HANDLE_GET_{SYNCOBJ, FD}
|
||||
* \param out_handle returned handle
|
||||
*
|
||||
* \return 0 on success\n
|
||||
* <0 - Negative POSIX Error code
|
||||
*/
|
||||
int amdgpu_cs_fence_to_handle(amdgpu_device_handle dev,
|
||||
struct amdgpu_cs_fence *fence,
|
||||
uint32_t what,
|
||||
uint32_t *out_handle);
|
||||
|
||||
/**
|
||||
* Submit raw command submission to kernel
|
||||
*
|
||||
|
|
|
@ -713,3 +713,25 @@ void amdgpu_cs_chunk_fence_to_dep(struct amdgpu_cs_fence *fence,
|
|||
dep->ctx_id = fence->context->id;
|
||||
dep->handle = fence->fence;
|
||||
}
|
||||
|
||||
int amdgpu_cs_fence_to_handle(amdgpu_device_handle dev,
|
||||
struct amdgpu_cs_fence *fence,
|
||||
uint32_t what,
|
||||
uint32_t *out_handle)
|
||||
{
|
||||
union drm_amdgpu_fence_to_handle fth = {0};
|
||||
int r;
|
||||
|
||||
fth.in.fence.ctx_id = fence->context->id;
|
||||
fth.in.fence.ip_type = fence->ip_type;
|
||||
fth.in.fence.ip_instance = fence->ip_instance;
|
||||
fth.in.fence.ring = fence->ring;
|
||||
fth.in.fence.seq_no = fence->fence;
|
||||
fth.in.what = what;
|
||||
|
||||
r = drmCommandWriteRead(dev->fd, DRM_AMDGPU_FENCE_TO_HANDLE,
|
||||
&fth, sizeof(fth));
|
||||
if (r == 0)
|
||||
*out_handle = fth.out.handle;
|
||||
return r;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue