Skip to content

Commit 28edaac

Browse files
Sean Andersontomba
authored andcommitted
drm: zynqmp_dp: Add debugfs interface for compliance testing
Add a debugfs interface for exercising the various test modes supported by the DisplayPort controller. This allows performing compliance testing, or performing signal integrity measurements on a failing link. At the moment, we do not support sink-driven link quality testing, although such support would be fairly easy to add. Additionally, add some debugfs files for ignoring AUX errors and HPD events, as this can allow testing with equipment that cannot emulate a DPRX. Signed-off-by: Sean Anderson <[email protected]> [Tomi: fixed a few minor formatting issues] Signed-off-by: Tomi Valkeinen <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 76f2c96 commit 28edaac

File tree

4 files changed

+828
-3
lines changed

4 files changed

+828
-3
lines changed

Documentation/gpu/drivers.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ GPU Driver Documentation
2222
afbc
2323
komeda-kms
2424
panfrost
25+
zynqmp
2526

2627
.. only:: subproject and html
2728

Documentation/gpu/zynqmp.rst

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
3+
===============================================
4+
Xilinx ZynqMP Ultrascale+ DisplayPort Subsystem
5+
===============================================
6+
7+
This subsystem handles DisplayPort video and audio output on the ZynqMP. It
8+
supports in-memory framebuffers with the DisplayPort DMA controller
9+
(xilinx-dpdma), as well as "live" video and audio from the programmable logic
10+
(PL). This subsystem can perform several transformations, including color space
11+
conversion, alpha blending, and audio mixing, although not all features are
12+
currently supported.
13+
14+
debugfs
15+
-------
16+
17+
To support debugging and compliance testing, several test modes can be enabled
18+
though debugfs. The following files in /sys/kernel/debug/dri/X/DP-1/test/
19+
control the DisplayPort test modes:
20+
21+
active:
22+
Writing a 1 to this file will activate test mode, and writing a 0 will
23+
deactivate test mode. Writing a 1 or 0 when the test mode is already
24+
active/inactive will re-activate/re-deactivate test mode. When test
25+
mode is inactive, changes made to other files will have no (immediate)
26+
effect, although the settings will be saved for when test mode is
27+
activated. When test mode is active, changes made to other files will
28+
apply immediately.
29+
30+
custom:
31+
Custom test pattern value
32+
33+
downspread:
34+
Enable/disable clock downspreading (spread-spectrum clocking) by
35+
writing 1/0
36+
37+
enhanced:
38+
Enable/disable enhanced framing
39+
40+
ignore_aux_errors:
41+
Ignore AUX errors when set to 1. Writes to this file take effect
42+
immediately (regardless of whether test mode is active) and affect all
43+
AUX transfers.
44+
45+
ignore_hpd:
46+
Ignore hotplug events (such as cable removals or monitor link
47+
retraining requests) when set to 1. Writes to this file take effect
48+
immediately (regardless of whether test mode is active).
49+
50+
laneX_preemphasis:
51+
Preemphasis from 0 (lowest) to 2 (highest) for lane X
52+
53+
laneX_swing:
54+
Voltage swing from 0 (lowest) to 3 (highest) for lane X
55+
56+
lanes:
57+
Number of lanes to use (1, 2, or 4)
58+
59+
pattern:
60+
Test pattern. May be one of:
61+
62+
video
63+
Use regular video input
64+
65+
symbol-error
66+
Symbol error measurement pattern
67+
68+
prbs7
69+
Output of the PRBS7 (x^7 + x^6 + 1) polynomial
70+
71+
80bit-custom
72+
A custom 80-bit pattern
73+
74+
cp2520
75+
HBR2 compliance eye pattern
76+
77+
tps1
78+
Link training symbol pattern TPS1 (/D10.2/)
79+
80+
tps2
81+
Link training symbol pattern TPS2
82+
83+
tps3
84+
Link training symbol pattern TPS3 (for HBR2)
85+
86+
rate:
87+
Rate in hertz. One of
88+
89+
* 5400000000 (HBR2)
90+
* 2700000000 (HBR)
91+
* 1620000000 (RBR)
92+
93+
You can dump the displayport test settings with the following command::
94+
95+
for prop in /sys/kernel/debug/dri/1/DP-1/test/*; do
96+
printf '%-17s ' ${prop##*/}
97+
if [ ${prop##*/} = custom ]; then
98+
hexdump -C $prop | head -1
99+
else
100+
cat $prop
101+
fi
102+
done
103+
104+
The output could look something like::
105+
106+
active 1
107+
custom 00000000 00 00 00 00 00 00 00 00 00 00 |..........|
108+
downspread 0
109+
enhanced 1
110+
ignore_aux_errors 1
111+
ignore_hpd 1
112+
lane0_preemphasis 0
113+
lane0_swing 3
114+
lane1_preemphasis 0
115+
lane1_swing 3
116+
lanes 2
117+
pattern prbs7
118+
rate 1620000000
119+
120+
The recommended test procedure is to connect the board to a monitor,
121+
configure test mode, activate test mode, and then disconnect the cable
122+
and connect it to your test equipment of choice. For example, one
123+
sequence of commands could be::
124+
125+
echo 1 > /sys/kernel/debug/dri/1/DP-1/test/enhanced
126+
echo tps1 > /sys/kernel/debug/dri/1/DP-1/test/pattern
127+
echo 1620000000 > /sys/kernel/debug/dri/1/DP-1/test/rate
128+
echo 1 > /sys/kernel/debug/dri/1/DP-1/test/ignore_aux_errors
129+
echo 1 > /sys/kernel/debug/dri/1/DP-1/test/ignore_hpd
130+
echo 1 > /sys/kernel/debug/dri/1/DP-1/test/active
131+
132+
at which point the cable could be disconnected from the monitor.
133+
134+
Internals
135+
---------
136+
137+
.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_disp.h
138+
139+
.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_dpsub.h
140+
141+
.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_kms.h
142+
143+
.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_disp.c
144+
145+
.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_dp.c
146+
147+
.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_dpsub.c
148+
149+
.. kernel-doc:: drivers/gpu/drm/xlnx/zynqmp_kms.c

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7838,6 +7838,7 @@ L: [email protected]
78387838
S: Maintained
78397839
T: git https://gitlab.freedesktop.org/drm/misc/kernel.git
78407840
F: Documentation/devicetree/bindings/display/xlnx/
7841+
F: Documentation/gpu/zynqmp.rst
78417842
F: drivers/gpu/drm/xlnx/
78427843

78437844
DRM GPU SCHEDULER

0 commit comments

Comments
 (0)