brintos

brintos / linux-shallow public Read only

0
0
Text · 4.3 KiB · 817631b Raw
119 lines · plain
1========================2Display Core Debug tools3========================4 5DC Visual Confirmation6======================7 8Display core provides a feature named visual confirmation, which is a set of9bars added at the scanout time by the driver to convey some specific10information. In general, you can enable this debug option by using::11 12  echo <N> > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm13 14Where `N` is an integer number for some specific scenarios that the developer15wants to enable, you will see some of these debug cases in the following16subsection.17 18Multiple Planes Debug19---------------------20 21If you want to enable or debug multiple planes in a specific user-space22application, you can leverage a debug feature named visual confirm. For23enabling it, you will need::24 25  echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm26 27You need to reload your GUI to see the visual confirmation. When the plane28configuration changes or a full update occurs there will be a colored bar at29the bottom of each hardware plane being drawn on the screen.30 31* The color indicates the format - For example, red is AR24 and green is NV1232* The height of the bar indicates the index of the plane33* Pipe split can be observed if there are two bars with a difference in height34  covering the same plane35 36Consider the video playback case in which a video is played in a specific37plane, and the desktop is drawn in another plane. The video plane should38feature one or two green bars at the bottom of the video depending on pipe39split configuration.40 41* There should **not** be any visual corruption42* There should **not** be any underflow or screen flashes43* There should **not** be any black screens44* There should **not** be any cursor corruption45* Multiple plane **may** be briefly disabled during window transitions or46  resizing but should come back after the action has finished47 48Pipe Split Debug49----------------50 51Sometimes we need to debug if DCN is splitting pipes correctly, and visual52confirmation is also handy for this case. Similar to the MPO case, you can use53the below command to enable visual confirmation::54 55  echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm56 57In this case, if you have a pipe split, you will see one small red bar at the58bottom of the display covering the entire display width and another bar59covering the second pipe. In other words, you will see a bit high bar in the60second pipe.61 62DTN Debug63=========64 65DC (DCN) provides an extensive log that dumps multiple details from our66hardware configuration. Via debugfs, you can capture those status values by67using Display Test Next (DTN) log, which can be captured via debugfs by using::68 69  cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log70 71Since this log is updated accordingly with DCN status, you can also follow the72change in real-time by using something like::73 74  sudo watch -d cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log75 76When reporting a bug related to DC, consider attaching this log before and77after you reproduce the bug.78 79DMUB Firmware Debug80===================81 82Sometimes, dmesg logs aren't enough. This is especially true if a feature is83implemented primarily in DMUB firmware. In such cases, all we see in dmesg when84an issue arises is some generic timeout error. So, to get more relevant85information, we can trace DMUB commands by enabling the relevant bits in86`amdgpu_dm_dmub_trace_mask`.87 88Currently, we support the tracing of the following groups:89 90Trace Groups91------------92 93.. csv-table::94   :header-rows: 195   :widths: 1, 196   :file: ./trace-groups-table.csv97 98**Note: Not all ASICs support all of the listed trace groups**99 100So, to enable just PSR tracing you can use the following command::101 102  # echo 0x8020 > /sys/kernel/debug/dri/0/amdgpu_dm_dmub_trace_mask103 104Then, you need to enable logging trace events to the buffer, which you can do105using the following::106 107  # echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_dmcub_trace_event_en108 109Lastly, after you are able to reproduce the issue you are trying to debug,110you can disable tracing and read the trace log by using the following::111 112  # echo 0 > /sys/kernel/debug/dri/0/amdgpu_dm_dmcub_trace_event_en113  # cat /sys/kernel/debug/dri/0/amdgpu_dm_dmub_tracebuffer114 115So, when reporting bugs related to features such as PSR and ABM, consider116enabling the relevant bits in the mask before reproducing the issue and117attach the log that you obtain from the trace buffer in any bug reports that you118create.119