freedreno/drm: Add support to query device suspend count

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>
This commit is contained in:
Rob Clark
2021-03-24 15:48:37 -07:00
committed by Marge Bot
parent 3e4f1798d4
commit e63ef520fe
3 changed files with 4 additions and 0 deletions

View File

@@ -76,6 +76,7 @@ struct drm_msm_timespec {
#define MSM_PARAM_NR_RINGS 0x07
#define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */
#define MSM_PARAM_FAULTS 0x09
#define MSM_PARAM_SUSPENDS 0x0a
struct drm_msm_param {
__u32 pipe; /* in, MSM_PIPE_x */

View File

@@ -61,6 +61,7 @@ enum fd_param_id {
FD_PP_PGTABLE, /* are per-process pagetables used for the pipe/ctx */
FD_CTX_FAULTS, /* # of per context faults */
FD_GLOBAL_FAULTS, /* # of global (all context) faults */
FD_SUSPEND_COUNT, /* # of times the GPU has suspended, and potentially lost state */
};
/**

View File

@@ -99,6 +99,8 @@ msm_pipe_get_param(struct fd_pipe *pipe, enum fd_param_id param,
return query_queue_param(pipe, MSM_SUBMITQUEUE_PARAM_FAULTS, value);
case FD_GLOBAL_FAULTS:
return query_param(pipe, MSM_PARAM_FAULTS, value);
case FD_SUSPEND_COUNT:
return query_param(pipe, MSM_PARAM_SUSPENDS, value);
default:
ERROR_MSG("invalid param id: %d", param);
return -1;