Commit 998b9a58 authored by Rob Clark's avatar Rob Clark

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: default avatarRob Clark <robdclark@gmail.com>
parent 2165e2b9
...@@ -299,7 +299,8 @@ void msm_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m); ...@@ -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_debugfs_late_init(struct drm_device *dev);
int msm_rd_debugfs_init(struct drm_minor *minor); int msm_rd_debugfs_init(struct drm_minor *minor);
void msm_rd_debugfs_cleanup(struct msm_drm_private *priv); 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); int msm_perf_debugfs_init(struct drm_minor *minor);
void msm_perf_debugfs_cleanup(struct msm_drm_private *priv); void msm_perf_debugfs_cleanup(struct msm_drm_private *priv);
#else #else
......
...@@ -557,7 +557,7 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, ...@@ -557,7 +557,7 @@ void msm_gpu_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
list_add_tail(&submit->node, &ring->submits); 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); update_sw_cntrs(gpu);
......
...@@ -338,11 +338,12 @@ static void snapshot_buf(struct msm_rd_state *rd, ...@@ -338,11 +338,12 @@ static void snapshot_buf(struct msm_rd_state *rd,
} }
/* called under struct_mutex */ /* 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 drm_device *dev = submit->dev;
struct task_struct *task; struct task_struct *task;
char msg[128]; char msg[256];
int i, n; int i, n;
if (!rd->open) if (!rd->open)
...@@ -353,6 +354,16 @@ void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit) ...@@ -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)); 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(); rcu_read_lock();
task = pid_task(submit->pid, PIDTYPE_PID); task = pid_task(submit->pid, PIDTYPE_PID);
if (task) { if (task) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment