NOTE: that the TPG command below should only be used before running modetest -P.
modetest –D fd4a0000.zynqmp-display –w 34:tpg:1 –w 35:alpha:100
Live Input
The live input can be configured through Xilinx bridge interface (https://gitenterprise.xilinx.com/Linux/linux-xlnx/blob/xilinx-v2018.2/drivers/gpu/drm/xlnx/xlnx_bridge.h#L65), which is the kernel level APIs. The interface is available through debugfs for userspace application to control.
The live input requires the clock and timing to be generated from PL, so that such requirement should be reflected in the PL design. The clock should be specified in the devicetree, with 'dp_live_video_in_clk' (https://gitenterprise.xilinx.com/Linux/linux-xlnx/blob/xilinx-v2018.2/Documentation/devicetree/bindings/display/xlnx/xlnx%2Czynqmp-dpsub.txt#L20). The driver will automatically switches to PL clock when switching to live input. The DT binding doc describes as below.
- clocks: phandles for axi, audio, non-live video, and live video clocks.
axi clock is required. Audio clock is optional. If not present, audio will
be disabled. One of non-live or live video clock should be present.
- clock-names: The identification strings are required. "aclk" for axi clock.
"dp_aud_clk" for audio clock. "dp_vtc_pixel_clk_in" for non-live video clock.
"dp_live_video_in_clk" for live video clock (clock from programmable logic).
As an example, if the si570 is connected to DP live clock through FPGA logic, the DT change is as below.
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi
index a02ad79..dd747d0 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi
+++ b/arch/arm64/boot/dts/xilinx/zynqmp-clk-ccf.dtsi
@@ -272,7 +272,7 @@
};
&zynqmp_dpsub {
- clocks = <&dp_aclk>, <&clk 17>, <&clk 16>;
+ clocks = <&dp_aclk>, <&clk 17>, <&clk 16>, <&si570_1>;
};
&xlnx_dpdma {
diff --git a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
index fb196a1..acd7cf2 100644
--- a/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
+++ b/arch/arm64/boot/dts/xilinx/zynqmp.dtsi
@@ -1151,7 +1151,8 @@
interrupt-parent = <&gic>;
clock-names = "dp_apb_clk", "dp_aud_clk",
- "dp_vtc_pixel_clk_in";
+ "dp_vtc_pixel_clk_in",
+ "dp_live_video_in_clk";
power-domains = <&pd_dp>;
There are two live inputs available, video and graphics, and two debugfs entries are available.
/sys/kernel/debug/xlnx-bridge/xlnx_bridge-vid-layer
/sys/kernel/debug/xlnx-bridge/xlnx_bridge-gfx-layer
Some operations can be done through debugfs: enable / disable / set_input:
https://gitenterprise.xilinx.com/Linux/linux-xlnx/blob/xilinx-v2018.2/drivers/gpu/drm/xlnx/xlnx_bridge.c#L310. But please note, debugfs is not treated as stable ABI, so any application shouldn't rely on specific ABI, meaning it may change from one version to another.
The below command will set video layer to use live input.
echo "set_input 1920 1080 0x100e" > /sys/kernel/debug/xlnx-bridge/xlnx_bridge-vid-layer
echo "enable" > /sys/kernel/debug/xlnx-bridge/xlnx_bridge-vid-layer
For 'set_input', 1st arg = width, 2nd arg = height, 3rd arg = media bus format (from media-bus-format.h). 0x100e maps to RGB24 (
https://gitenterprise.xilinx.com/Linux/linux-xlnx/blob/xilinx-v2018.2/include/uapi/linux/media-bus-format.h#L49)
This assumes that the logic connected to live input (ex, TPG / VTC) are already configured prior to enable command. Then the live input can be disabled as below.
echo "disable" > /sys/kernel/debug/xlnx-bridge/xlnx_bridge-vid-layer
ALSA
The "aplay" is an ALSA (Linux audio/sound subsystem) example and demonstrates the audio play. The command sends audio data on specific pcm channel which is audible at DPout.