amdgpu: add amdgpu_cs_query_reset_state2 for AMDGPU_CTX_OP_QUERY_STATE2
This is a better GPU reset query. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>main
parent
9a61cf4e0e
commit
00320d7d68
|
@ -46,6 +46,7 @@ amdgpu_cs_fence_to_handle
|
|||
amdgpu_cs_import_syncobj
|
||||
amdgpu_cs_query_fence_status
|
||||
amdgpu_cs_query_reset_state
|
||||
amdgpu_cs_query_reset_state2
|
||||
amdgpu_query_sw_info
|
||||
amdgpu_cs_signal_semaphore
|
||||
amdgpu_cs_submit
|
||||
|
|
|
@ -942,6 +942,21 @@ int amdgpu_cs_ctx_override_priority(amdgpu_device_handle dev,
|
|||
int amdgpu_cs_query_reset_state(amdgpu_context_handle context,
|
||||
uint32_t *state, uint32_t *hangs);
|
||||
|
||||
/**
|
||||
* Query reset state for the specific GPU Context.
|
||||
*
|
||||
* \param context - \c [in] GPU Context handle
|
||||
* \param flags - \c [out] A combination of AMDGPU_CTX_QUERY2_FLAGS_*
|
||||
*
|
||||
* \return 0 on success\n
|
||||
* <0 - Negative POSIX Error code
|
||||
*
|
||||
* \sa amdgpu_cs_ctx_create()
|
||||
*
|
||||
*/
|
||||
int amdgpu_cs_query_reset_state2(amdgpu_context_handle context,
|
||||
uint64_t *flags);
|
||||
|
||||
/*
|
||||
* Command Buffers Management
|
||||
*
|
||||
|
|
|
@ -188,6 +188,25 @@ drm_public int amdgpu_cs_query_reset_state(amdgpu_context_handle context,
|
|||
return r;
|
||||
}
|
||||
|
||||
drm_public int amdgpu_cs_query_reset_state2(amdgpu_context_handle context,
|
||||
uint64_t *flags)
|
||||
{
|
||||
union drm_amdgpu_ctx args;
|
||||
int r;
|
||||
|
||||
if (!context)
|
||||
return -EINVAL;
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.in.op = AMDGPU_CTX_OP_QUERY_STATE2;
|
||||
args.in.ctx_id = context->id;
|
||||
r = drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_CTX,
|
||||
&args, sizeof(args));
|
||||
if (!r)
|
||||
*flags = args.out.state.flags;
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit command to kernel DRM
|
||||
* \param dev - \c [in] Device handle
|
||||
|
|
Loading…
Reference in New Issue