dc-debug.rst 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. ========================
  2. Display Core Debug tools
  3. ========================
  4. DC Visual Confirmation
  5. ======================
  6. Display core provides a feature named visual confirmation, which is a set of
  7. bars added at the scanout time by the driver to convey some specific
  8. information. In general, you can enable this debug option by using::
  9. echo <N> > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm
  10. Where `N` is an integer number for some specific scenarios that the developer
  11. wants to enable, you will see some of these debug cases in the following
  12. subsection.
  13. Multiple Planes Debug
  14. ---------------------
  15. If you want to enable or debug multiple planes in a specific user-space
  16. application, you can leverage a debug feature named visual confirm. For
  17. enabling it, you will need::
  18. echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm
  19. You need to reload your GUI to see the visual confirmation. When the plane
  20. configuration changes or a full update occurs there will be a colored bar at
  21. the bottom of each hardware plane being drawn on the screen.
  22. * The color indicates the format - For example, red is AR24 and green is NV12
  23. * The height of the bar indicates the index of the plane
  24. * Pipe split can be observed if there are two bars with a difference in height
  25. covering the same plane
  26. Consider the video playback case in which a video is played in a specific
  27. plane, and the desktop is drawn in another plane. The video plane should
  28. feature one or two green bars at the bottom of the video depending on pipe
  29. split configuration.
  30. * There should **not** be any visual corruption
  31. * There should **not** be any underflow or screen flashes
  32. * There should **not** be any black screens
  33. * There should **not** be any cursor corruption
  34. * Multiple plane **may** be briefly disabled during window transitions or
  35. resizing but should come back after the action has finished
  36. Pipe Split Debug
  37. ----------------
  38. Sometimes we need to debug if DCN is splitting pipes correctly, and visual
  39. confirmation is also handy for this case. Similar to the MPO case, you can use
  40. the below command to enable visual confirmation::
  41. echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm
  42. In this case, if you have a pipe split, you will see one small red bar at the
  43. bottom of the display covering the entire display width and another bar
  44. covering the second pipe. In other words, you will see a bit high bar in the
  45. second pipe.
  46. DTN Debug
  47. =========
  48. DC (DCN) provides an extensive log that dumps multiple details from our
  49. hardware configuration. Via debugfs, you can capture those status values by
  50. using Display Test Next (DTN) log, which can be captured via debugfs by using::
  51. cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log
  52. Since this log is updated accordingly with DCN status, you can also follow the
  53. change in real-time by using something like::
  54. sudo watch -d cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log
  55. When reporting a bug related to DC, consider attaching this log before and
  56. after you reproduce the bug.
  57. DMUB Firmware Debug
  58. ===================
  59. Sometimes, dmesg logs aren't enough. This is especially true if a feature is
  60. implemented primarily in DMUB firmware. In such cases, all we see in dmesg when
  61. an issue arises is some generic timeout error. So, to get more relevant
  62. information, we can trace DMUB commands by enabling the relevant bits in
  63. `amdgpu_dm_dmub_trace_mask`.
  64. Currently, we support the tracing of the following groups:
  65. Trace Groups
  66. ------------
  67. .. csv-table::
  68. :header-rows: 1
  69. :widths: 1, 1
  70. :file: ./trace-groups-table.csv
  71. **Note: Not all ASICs support all of the listed trace groups**
  72. So, to enable just PSR tracing you can use the following command::
  73. # echo 0x8020 > /sys/kernel/debug/dri/0/amdgpu_dm_dmub_trace_mask
  74. Then, you need to enable logging trace events to the buffer, which you can do
  75. using the following::
  76. # echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_dmcub_trace_event_en
  77. Lastly, after you are able to reproduce the issue you are trying to debug,
  78. you can disable tracing and read the trace log by using the following::
  79. # echo 0 > /sys/kernel/debug/dri/0/amdgpu_dm_dmcub_trace_event_en
  80. # cat /sys/kernel/debug/dri/0/amdgpu_dm_dmub_tracebuffer
  81. So, when reporting bugs related to features such as PSR and ABM, consider
  82. enabling the relevant bits in the mask before reproducing the issue and
  83. attach the log that you obtain from the trace buffer in any bug reports that you
  84. create.