summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_rd.c
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-09-15 17:46:45 +0300
committerRob Clark <robdclark@gmail.com>2017-10-28 20:59:18 +0300
commit998b9a588314faa334dd0f94007e1c685bf664dd (patch)
tree1a19ede70bb4d727655f62299d526245b50254a6 /drivers/gpu/drm/msm/msm_rd.c
parent2165e2b9cba277a5088c2e771af477e95dcc37bf (diff)
downloadlinux-998b9a588314faa334dd0f94007e1c685bf664dd.tar.xz
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/gpu/drm/msm/msm_rd.c')
-rw-r--r--drivers/gpu/drm/msm/msm_rd.c15
1 files changed, 13 insertions, 2 deletions
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) {