diff options
author | Rob Clark <robdclark@gmail.com> | 2017-09-15 10:46:45 -0400 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2017-10-28 13:59:18 -0400 |
commit | 998b9a588314faa334dd0f94007e1c685bf664dd (patch) | |
tree | 1a19ede70bb4d727655f62299d526245b50254a6 /drivers | |
parent | 2165e2b9cba277a5088c2e771af477e95dcc37bf (diff) |
drm/msm/rd: allow adding addition msg to top of dump
For faults or hangs, it is nice to be able to include a bit more
information.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_gpu.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/msm_rd.c | 15 |
3 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index b01bd7fa9c2b..a007bbf4d94d 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -299,7 +299,8 @@ void msm_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m); int msm_debugfs_late_init(struct drm_device *dev); int msm_rd_debugfs_init(struct drm_minor *minor); void msm_rd_debugfs_cleanup(struct msm_drm_private *priv); -void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit); +void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit, + const char *fmt, ...); int msm_perf_debugfs_init(struct drm_minor *minor); void msm_perf_debugfs_cleanup(struct msm_drm_private *priv); #else diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 7fc6f68d6aec..4dd0c917e30c 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -557,7 +557,7 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, list_add_tail(&submit->node, &ring->submits); - msm_rd_dump_submit(priv->rd, submit); + msm_rd_dump_submit(priv->rd, submit, NULL); update_sw_cntrs(gpu); diff --git a/drivers/gpu/drm/msm/msm_rd.c b/drivers/gpu/drm/msm/msm_rd.c index 0fac6ea5f906..96d678b582d9 100644 --- a/drivers/gpu/drm/msm/msm_rd.c +++ b/drivers/gpu/drm/msm/msm_rd.c @@ -338,11 +338,12 @@ static void snapshot_buf(struct msm_rd_state *rd, } /* called under struct_mutex */ -void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit) +void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit, + const char *fmt, ...) { struct drm_device *dev = submit->dev; struct task_struct *task; - char msg[128]; + char msg[256]; int i, n; if (!rd->open) @@ -353,6 +354,16 @@ void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit) */ WARN_ON(!mutex_is_locked(&dev->struct_mutex)); + if (fmt) { + va_list args; + + va_start(args, fmt); + n = vsnprintf(msg, sizeof(msg), fmt, args); + va_end(args); + + rd_write_section(rd, RD_CMD, msg, ALIGN(n, 4)); + } + rcu_read_lock(); task = pid_task(submit->pid, PIDTYPE_PID); if (task) { |