From e63ef520fe01e099042d0f318f969cbe27db4a6b Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 24 Mar 2021 15:48:37 -0700 Subject: [PATCH] freedreno/drm: Add support to query device suspend count Signed-off-by: Rob Clark Acked-by: Emma Anholt Part-of: --- include/drm-uapi/msm_drm.h | 1 + src/freedreno/drm/freedreno_drmif.h | 1 + src/freedreno/drm/msm_pipe.c | 2 ++ 3 files changed, 4 insertions(+) diff --git a/include/drm-uapi/msm_drm.h b/include/drm-uapi/msm_drm.h index a6c1f3eb262..5596d7c37f9 100644 --- a/include/drm-uapi/msm_drm.h +++ b/include/drm-uapi/msm_drm.h @@ -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 */ diff --git a/src/freedreno/drm/freedreno_drmif.h b/src/freedreno/drm/freedreno_drmif.h index f6384fa0274..d9b645f9cb1 100644 --- a/src/freedreno/drm/freedreno_drmif.h +++ b/src/freedreno/drm/freedreno_drmif.h @@ -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 */ }; /** diff --git a/src/freedreno/drm/msm_pipe.c b/src/freedreno/drm/msm_pipe.c index 8793494ca11..09e598a248c 100644 --- a/src/freedreno/drm/msm_pipe.c +++ b/src/freedreno/drm/msm_pipe.c @@ -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;