17971fb35SRodrigo Siqueira======================== 2e91f8401SRodrigo SiqueiraDisplay Core Debug tools 3e91f8401SRodrigo Siqueira======================== 4e91f8401SRodrigo Siqueira 5b2568d68SRodrigo SiqueiraDC Visual Confirmation 6b2568d68SRodrigo Siqueira====================== 7b2568d68SRodrigo Siqueira 8b2568d68SRodrigo SiqueiraDisplay core provides a feature named visual confirmation, which is a set of 9b2568d68SRodrigo Siqueirabars added at the scanout time by the driver to convey some specific 10b2568d68SRodrigo Siqueirainformation. In general, you can enable this debug option by using:: 11b2568d68SRodrigo Siqueira 12b2568d68SRodrigo Siqueira echo <N> > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm 13b2568d68SRodrigo Siqueira 14b2568d68SRodrigo SiqueiraWhere `N` is an integer number for some specific scenarios that the developer 15b2568d68SRodrigo Siqueirawants to enable, you will see some of these debug cases in the following 16b2568d68SRodrigo Siqueirasubsection. 177971fb35SRodrigo Siqueira 187971fb35SRodrigo SiqueiraMultiple Planes Debug 197971fb35SRodrigo Siqueira--------------------- 207971fb35SRodrigo Siqueira 217971fb35SRodrigo SiqueiraIf you want to enable or debug multiple planes in a specific user-space 227971fb35SRodrigo Siqueiraapplication, you can leverage a debug feature named visual confirm. For 237971fb35SRodrigo Siqueiraenabling it, you will need:: 247971fb35SRodrigo Siqueira 257971fb35SRodrigo Siqueira echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm 267971fb35SRodrigo Siqueira 277971fb35SRodrigo SiqueiraYou need to reload your GUI to see the visual confirmation. When the plane 287971fb35SRodrigo Siqueiraconfiguration changes or a full update occurs there will be a colored bar at 297971fb35SRodrigo Siqueirathe bottom of each hardware plane being drawn on the screen. 307971fb35SRodrigo Siqueira 317971fb35SRodrigo Siqueira* The color indicates the format - For example, red is AR24 and green is NV12 327971fb35SRodrigo Siqueira* The height of the bar indicates the index of the plane 337971fb35SRodrigo Siqueira* Pipe split can be observed if there are two bars with a difference in height 347971fb35SRodrigo Siqueira covering the same plane 357971fb35SRodrigo Siqueira 367971fb35SRodrigo SiqueiraConsider the video playback case in which a video is played in a specific 377971fb35SRodrigo Siqueiraplane, and the desktop is drawn in another plane. The video plane should 387971fb35SRodrigo Siqueirafeature one or two green bars at the bottom of the video depending on pipe 397971fb35SRodrigo Siqueirasplit configuration. 407971fb35SRodrigo Siqueira 417971fb35SRodrigo Siqueira* There should **not** be any visual corruption 427971fb35SRodrigo Siqueira* There should **not** be any underflow or screen flashes 437971fb35SRodrigo Siqueira* There should **not** be any black screens 447971fb35SRodrigo Siqueira* There should **not** be any cursor corruption 457971fb35SRodrigo Siqueira* Multiple plane **may** be briefly disabled during window transitions or 467971fb35SRodrigo Siqueira resizing but should come back after the action has finished 47b2568d68SRodrigo Siqueira 48b2568d68SRodrigo SiqueiraPipe Split Debug 49b2568d68SRodrigo Siqueira---------------- 50b2568d68SRodrigo Siqueira 51b2568d68SRodrigo SiqueiraSometimes we need to debug if DCN is splitting pipes correctly, and visual 52b2568d68SRodrigo Siqueiraconfirmation is also handy for this case. Similar to the MPO case, you can use 53b2568d68SRodrigo Siqueirathe below command to enable visual confirmation:: 54b2568d68SRodrigo Siqueira 55b2568d68SRodrigo Siqueira echo 1 > /sys/kernel/debug/dri/0/amdgpu_dm_visual_confirm 56b2568d68SRodrigo Siqueira 57b2568d68SRodrigo SiqueiraIn this case, if you have a pipe split, you will see one small red bar at the 58b2568d68SRodrigo Siqueirabottom of the display covering the entire display width and another bar 59b2568d68SRodrigo Siqueiracovering the second pipe. In other words, you will see a bit high bar in the 60b2568d68SRodrigo Siqueirasecond pipe. 61*76659755SRodrigo Siqueira 62*76659755SRodrigo SiqueiraDTN Debug 63*76659755SRodrigo Siqueira========= 64*76659755SRodrigo Siqueira 65*76659755SRodrigo SiqueiraDC (DCN) provides an extensive log that dumps multiple details from our 66*76659755SRodrigo Siqueirahardware configuration. Via debugfs, you can capture those status values by 67*76659755SRodrigo Siqueirausing Display Test Next (DTN) log, which can be captured via debugfs by using:: 68*76659755SRodrigo Siqueira 69*76659755SRodrigo Siqueira cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log 70*76659755SRodrigo Siqueira 71*76659755SRodrigo SiqueiraSince this log is updated accordingly with DCN status, you can also follow the 72*76659755SRodrigo Siqueirachange in real-time by using something like:: 73*76659755SRodrigo Siqueira 74*76659755SRodrigo Siqueira sudo watch -d cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log 75*76659755SRodrigo Siqueira 76*76659755SRodrigo SiqueiraWhen reporting a bug related to DC, consider attaching this log before and 77*76659755SRodrigo Siqueiraafter you reproduce the bug. 78