0192-drm-vc4-Add-a-debugfs-node-for-tracking-execution-st.patch 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From 52b14a59aff492c6064e12e7e9c943a256a19e9c Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Fri, 22 Jan 2016 13:06:39 -0800
  4. Subject: [PATCH] drm/vc4: Add a debugfs node for tracking execution state.
  5. Signed-off-by: Eric Anholt <eric@anholt.net>
  6. ---
  7. drivers/gpu/drm/vc4/vc4_debugfs.c | 1 +
  8. drivers/gpu/drm/vc4/vc4_drv.h | 1 +
  9. drivers/gpu/drm/vc4/vc4_gem.c | 14 ++++++++++++++
  10. 3 files changed, 16 insertions(+)
  11. --- a/drivers/gpu/drm/vc4/vc4_debugfs.c
  12. +++ b/drivers/gpu/drm/vc4/vc4_debugfs.c
  13. @@ -17,6 +17,7 @@
  14. static const struct drm_info_list vc4_debugfs_list[] = {
  15. {"bo_stats", vc4_bo_stats_debugfs, 0},
  16. + {"gem_exec", vc4_gem_exec_debugfs, 0},
  17. {"hdmi_regs", vc4_hdmi_debugfs_regs, 0},
  18. {"hvs_regs", vc4_hvs_debugfs_regs, 0},
  19. {"crtc0_regs", vc4_crtc_debugfs_regs, 0, (void *)(uintptr_t)0},
  20. --- a/drivers/gpu/drm/vc4/vc4_drv.h
  21. +++ b/drivers/gpu/drm/vc4/vc4_drv.h
  22. @@ -403,6 +403,7 @@ void vc4_job_handle_completed(struct vc4
  23. int vc4_queue_seqno_cb(struct drm_device *dev,
  24. struct vc4_seqno_cb *cb, uint64_t seqno,
  25. void (*func)(struct vc4_seqno_cb *cb));
  26. +int vc4_gem_exec_debugfs(struct seq_file *m, void *arg);
  27. /* vc4_hdmi.c */
  28. extern struct platform_driver vc4_hdmi_driver;
  29. --- a/drivers/gpu/drm/vc4/vc4_gem.c
  30. +++ b/drivers/gpu/drm/vc4/vc4_gem.c
  31. @@ -31,6 +31,20 @@
  32. #include "vc4_regs.h"
  33. #include "vc4_trace.h"
  34. +#ifdef CONFIG_DEBUG_FS
  35. +int vc4_gem_exec_debugfs(struct seq_file *m, void *unused)
  36. +{
  37. + struct drm_info_node *node = (struct drm_info_node *)m->private;
  38. + struct drm_device *dev = node->minor->dev;
  39. + struct vc4_dev *vc4 = to_vc4_dev(dev);
  40. +
  41. + seq_printf(m, "Emitted seqno: 0x%016llx\n", vc4->emit_seqno);
  42. + seq_printf(m, "Finished seqno: 0x%016llx\n", vc4->finished_seqno);
  43. +
  44. + return 0;
  45. +}
  46. +#endif /* CONFIG_DEBUG_FS */
  47. +
  48. static void
  49. vc4_queue_hangcheck(struct drm_device *dev)
  50. {