diff options
author | Marek Olšák <marek.olsak@amd.com> | 2019-10-09 19:18:08 -0400 |
---|---|---|
committer | Marek Olšák <marek.olsak@amd.com> | 2019-10-15 15:20:38 -0400 |
commit | 00320d7d68ddc7d815d073bb7c92d9a1f9bb8c31 (patch) | |
tree | 1a9cda916bfa766529554b4685c44440897ee7ea /amdgpu/amdgpu_cs.c | |
parent | 9a61cf4e0e6436ff995a3a8733cdf98b23de8f6d (diff) | |
download | libdrm-00320d7d68ddc7d815d073bb7c92d9a1f9bb8c31.tar.gz libdrm-00320d7d68ddc7d815d073bb7c92d9a1f9bb8c31.tar.bz2 libdrm-00320d7d68ddc7d815d073bb7c92d9a1f9bb8c31.zip |
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>
Diffstat (limited to 'amdgpu/amdgpu_cs.c')
-rw-r--r-- | amdgpu/amdgpu_cs.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c index 20d5aef2..56502950 100644 --- a/amdgpu/amdgpu_cs.c +++ b/amdgpu/amdgpu_cs.c @@ -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 |