mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
drm/msm: add param to retrieve # of GPU faults (global)
For KHR_robustness, userspace wants to know two things, the count of GPU faults globally, and the count of faults attributed to a given context. This patch providees the former, and the next patch provides the latter. Signed-off-by: Rob Clark <robdclark@chromium.org> Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
This commit is contained in:
parent
d674c963af
commit
48dc4241c9
4 changed files with 10 additions and 0 deletions
|
@ -66,6 +66,9 @@ int adreno_get_param(struct msm_gpu *gpu, uint32_t param, uint64_t *value)
|
||||||
case MSM_PARAM_PP_PGTABLE:
|
case MSM_PARAM_PP_PGTABLE:
|
||||||
*value = 0;
|
*value = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
case MSM_PARAM_FAULTS:
|
||||||
|
*value = gpu->global_faults;
|
||||||
|
return 0;
|
||||||
default:
|
default:
|
||||||
DBG("%s: invalid param: %u", gpu->name, param);
|
DBG("%s: invalid param: %u", gpu->name, param);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
|
@ -443,6 +443,9 @@ static void recover_worker(struct work_struct *work)
|
||||||
if (submit) {
|
if (submit) {
|
||||||
struct task_struct *task;
|
struct task_struct *task;
|
||||||
|
|
||||||
|
/* Increment the fault count */
|
||||||
|
gpu->global_faults++;
|
||||||
|
|
||||||
task = get_pid_task(submit->pid, PIDTYPE_PID);
|
task = get_pid_task(submit->pid, PIDTYPE_PID);
|
||||||
if (task) {
|
if (task) {
|
||||||
comm = kstrdup(task->comm, GFP_KERNEL);
|
comm = kstrdup(task->comm, GFP_KERNEL);
|
||||||
|
|
|
@ -104,6 +104,9 @@ struct msm_gpu {
|
||||||
/* does gpu need hw_init? */
|
/* does gpu need hw_init? */
|
||||||
bool needs_hw_init;
|
bool needs_hw_init;
|
||||||
|
|
||||||
|
/* number of GPU hangs (for all contexts) */
|
||||||
|
int global_faults;
|
||||||
|
|
||||||
/* worker for handling active-list retiring: */
|
/* worker for handling active-list retiring: */
|
||||||
struct work_struct retire_work;
|
struct work_struct retire_work;
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ struct drm_msm_timespec {
|
||||||
#define MSM_PARAM_GMEM_BASE 0x06
|
#define MSM_PARAM_GMEM_BASE 0x06
|
||||||
#define MSM_PARAM_NR_RINGS 0x07
|
#define MSM_PARAM_NR_RINGS 0x07
|
||||||
#define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */
|
#define MSM_PARAM_PP_PGTABLE 0x08 /* => 1 for per-process pagetables, else 0 */
|
||||||
|
#define MSM_PARAM_FAULTS 0x09
|
||||||
|
|
||||||
struct drm_msm_param {
|
struct drm_msm_param {
|
||||||
__u32 pipe; /* in, MSM_PIPE_x */
|
__u32 pipe; /* in, MSM_PIPE_x */
|
||||||
|
|
Loading…
Reference in a new issue