介紹
PetaLinux 能夠根據(jù)Vivado的設(shè)計(jì),自動生成V4L2的Video Pipeline的devicetree。但是它主要為Xilinx的VCU TRD服務(wù),測試的組合比較少。很多時候,需要根據(jù)自己的工程,修改V4L2的Video Pipeline的devicetree。
硬件設(shè)計(jì)
有項(xiàng)目需要對輸入的視頻,既需要對原始視頻做編解碼,也需要縮放后再做編解碼。于是創(chuàng)建了下面的硬件設(shè)計(jì)。
axis_data_fifo主要用于暫時緩存數(shù)據(jù)。axis_broadcaster和vpss之間的axis_data_fifo、axis_register_slice,可以刪除,完全不影響共。
兩個framebuffer_write的tready通過邏輯門的“或”操作,連接到了一起,再連接到前級axis_register_slice的輸入,保證只要有一個framebuffer_write在工作,前面的模塊就能向后輸出數(shù)據(jù)。
devicetree
對于上述的硬件設(shè)計(jì),對應(yīng)的V4L2的devicetree如下:
&amba_pl {
/delete-node/ axis_broadcasterhdmi_input_axis_broadcaster_0@0;
/* media-ctl prints out each node name of the video pipeline.
hdmi_brdcst_0@0: media-ctl prints it out. */
hdmi_brdcst_0_lb: hdmi_brdcst_0@0 {
compatible = “xlnx,axis-broadcaster-1.1”;
hdmi_brdcst_0_ports: ports {
#address-cells = ;
#size-cells = ;
};
};
/delete-node/ vcapaxis_broad_out1hdmi_input_axis_broadcaster_0;
/delete-node/ vcap_hdmi_input_v_proc_ss_0;
/* vcap_hdmi_brdcst_0: media-ctl prints it out. */
vcap_hdmi_brdcst_0 {
compatible = “xlnx,video”;
dma-names = “port0”, “port1”;
dmas = , ;
/* vcap_hdmi_brdcst_0_ports: Linux prints it out in log. */
vcap_hdmi_brdcst_0_ports: ports {
#address-cells = ;
#size-cells = ;
vcap_broadcaster_0_port1: port@0 {
direction = “input”;
reg = ;
/* Video input pipeline 1:
hdmi_rx_ss --》 broadcaster_0 : 1 --》 v_proc_ss_0 --》 v_frmbuf_wr_1
hdmi_rx_ss : source_to_axis_broad_in0_from_v_hdmi_rx_ss_0
broadcaster_0 : out 1 : port2 :: src_to_vpss0_from_broad_port2_hwout1
v_proc_ss_0 @a0040000 port@0 :: sink_to_vpss0_from_broad_port2_hwout1
v_proc_ss_0 @a0040000 port@1 :: src_to_frmbuf_wr1_from_vpss_0
v_frmbuf_wr_1 @a0080000 :: hdmi_input_v_frmbuf_wr_1
*/
sink_to_frmbuf_wr1_from_vpss_0: endpoint {
remote-endpoint = ;
};
};
vcap_broadcaster_0_port2: port@1 {
direction = “input”;
reg = ;
/* Video input pipeline 0:
hdmi_rx_ss --》 broadcaster_0 : 0 --》 v_frmbuf_wr_0
hdmi_rx_ss : source_to_axis_broad_in0_from_v_hdmi_rx_ss_0
broadcaster_0 : out 0 : port1 :: src_to_frmbuf_wr0_from_broad_port1_hwout0
v_frmbuf_wr_1 @a0010000 :: hdmi_input_v_frmbuf_wr_0
hdmi_input_ v_frmbuf_wr_0 hdmi_input_ axis_broadcaster_0
*/
sink_to_frmbuf_wr0_from_broad_port1_hwout0: endpoint {
remote-endpoint = ;
};
};
};
};
};
/* hdmi_input_v_hdmi_rx_ss_0: v_hdmi_rx_ss@a0000000 */
&hdmirx_porthdmi_input_v_hdmi_rx_ss_0 {
source_to_axis_broad_in0_from_v_hdmi_rx_ss_0: endpoint {
remote-endpoint = ;
};
};
&hdmi_brdcst_0_ports{
/delete-node/ axis_broad_port1hdmi_input_axis_broadcaster_0;
/delete-node/ axis_broad_port2hdmi_input_axis_broadcaster_0;
/delete-node/ axis_broad_port0hdmi_input_axis_broadcaster_0;
axis_broad_port1_hw_output0: port@1 {
reg = ;
src_to_frmbuf_wr0_from_broad_port1_hwout0: endpoint {
remote-endpoint = ;
};
};
axis_broad_port2_hw_output1: port@2 {
reg = ;
src_to_vpss0_from_broad_port2_hwout1: endpoint {
remote-endpoint = ;
};
};
axis_broad_port0_hw_input: port@0 {
reg = ;
sink_to_broad_in0__from_v_hdmi_rx_ss_0: endpoint {
remote-endpoint = ;
};
};
};
&scaler_portshdmi_input_v_proc_ss_0{
/delete-node/ port@0;
/delete-node/ port@1;
scaler_port1_v_proc_ss_0: port@1 {
/* For xlnx,video-format user needs to fill as per their requirement */
reg = ;
xlnx,video-format = ;
xlnx,video-width = ;
src_to_frmbuf_wr1_from_vpss_0: endpoint {
remote-endpoint = ;
};
};
scaler_port0_v_proc_ss_0: port@0 {
/* For xlnx,video-format user needs to fill as per their requirement */
reg = ;
xlnx,video-format = ;
xlnx,video-width = ;
sink_to_vpss0_from_broad_port2_hwout1: endpoint {
remote-endpoint = ;
};
};
};
上述的devicetree,使用了更短更好理解的標(biāo)簽名稱。
v_proc_ss的devicetree里,port@0是輸入;port@1是輸出。
broadcaster的devicetree里,port@0是輸入;port@1和port@2是輸出。
另外,V4L2的設(shè)備號,根據(jù)“xlnx,video”設(shè)備里的port順序分配。 如果port@0在port@1后面,那么port@0也會被分配video1; 而port@1也會被分配video0.
審核編輯:郭婷
-
Linux
+關(guān)注
關(guān)注
87文章
11207瀏覽量
208721 -
編解碼
+關(guān)注
關(guān)注
1文章
140瀏覽量
19579
發(fā)布評論請先 登錄
相關(guān)推薦
評論