cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
hokim
Scholar
Scholar
497 Views
Registered: ‎10-21-2015

Bug report on DRM CRTC DMA engine driver

Hi

When I use xlnx_pl_disp together with xlnx_vtc, I found the bug.

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/gpu/drm/xlnx/xlnx_pl_disp.c#L575

should be replace with

ret = -EPROBE_DEFER;
goto err_dma;

For dma acquirement in the next time probe, the acquired dma  should be released in https://github.com/Xilinx/linux-xlnx/blob/master/drivers/gpu/drm/xlnx/xlnx_pl_disp.c#L549

 

 

Tags (1)
0 Kudos
Reply
3 Replies
florentw
Moderator
Moderator
407 Views
Registered: ‎11-09-2015

Hi @hokim 

Can you give some details about what failure you were getting and how this can be reproduced?


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Reply
hokim
Scholar
Scholar
389 Views
Registered: ‎10-21-2015

Hi

I wrote  linux drm encoder driver for hdmi of digilent's zybo z7 board

The below figure is vivado design which uses digilent's custom ips(axi_dynclk_0, rgb2dvi_0) for dynamic clocks generation and tmds signal generations

hdmi_out.png  

This is devicetree

/delete-node/ &misc_clk_0;
&axi_dynclk_0 {
    compatible = "digilent,axi-dynclk";
    #clock-cells = <0>;
    clocks = <&clkc 16>;
};

&v_frmbuf_rd_0 {
    reset-gpios = <&gpio0 54 1>;
};

&v_tc_0 {
   compatible = "xlnx,bridge-v-tc-6.1";
   xlnx,pixels-per-clock = <1>;
   clocks = <&axi_dynclk_0>, <&clkc 15>;
};

&amba {
   digilent_encoder {
       compatible = "digilent,drm-hdmi";
       digilent,fmax = <150000>;
       digilent,edid-i2c = <&i2c0>;

       #address-cell = <1>;
       #size-cell = <0>;
       port@0 {
           reg = <0>;
           hdmi_encoder: endpoint {
               remote-endpoint = <&dmaengine_crtc>;
           };
       };
   };

   drm-pl_disp-drv {
       compatible = "xlnx,pl-disp";
       dmas = <&v_frmbuf_rd_0 0>;
       dma-names = "dma0";
       xlnx,vformat = "BG24";
       xlnx,bridge = <&v_tc_0>;
       #address-cells = <1>;
       #size-cells = <0>;
       port@0 {
           reg = <0>;
           dmaengine_crtc: endpoint {
               remote-endpoint = <&hdmi_encoder>;
           };
       };
   };
};

When I used the original xlnx_pl_disp, it was not probed because it failed to request dma

xilinx-frmbuf 43c00000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV
xilinx-frmbuf 43c00000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx-pl-disp amba:drm-pl_disp-drv: Didn't get vtc bridge instance
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx-pl-disp amba:drm-pl_disp-drv: failed to request dma channel
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
digilent_drm_hdmi: loading out-of-tree module taints kernel.
digilent-drm-hdmi amba:digilent_encoder: No max horizontal width in DT, using default 1920
digilent-drm-hdmi amba:digilent_encoder: No max vertical height in DT, using default 1080
digilent-drm-hdmi amba:digilent_encoder: Digilent HDMI DRM Driver probed 0
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: Xilinx VTC IP version : 0x0602000b
xlnx,bridge-vtc 43c20000.v_tc: Xilinx VTC DRM Bridge driver probed

I could figure out that it was because the driver requested the acquired dma in the previous failed probe again through the following  investigation

$ cat /sys/class/dma/dma1chan0/device/of_node/name
v_frmbuf_rd
$ cat /sys/class/dma/dma1chan0/in_use
1

I can fix it with my patch for xlnx_pl_disp which releases dma when it failed to probe due to deferred bridge vtc

The following shows successful log

xilinx-frmbuf 43c00000.v_frmbuf_rd: Xilinx AXI frmbuf DMA_MEM_TO_DEV
xilinx-frmbuf 43c00000.v_frmbuf_rd: Xilinx AXI FrameBuffer Engine Driver Probed!!
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx-pl-disp amba:drm-pl_disp-drv: Didn't get vtc bridge instance

xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx-pl-disp amba:drm-pl_disp-drv: Didn't get vtc bridge instance
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx-pl-disp amba:drm-pl_disp-drv: Didn't get vtc bridge instance
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx-pl-disp amba:drm-pl_disp-drv: Didn't get vtc bridge instance
digilent_drm_hdmi: loading out-of-tree module taints kernel.
digilent-drm-hdmi amba:digilent_encoder: No max horizontal width in DT, using default 1920
digilent-drm-hdmi amba:digilent_encoder: No max vertical height in DT, using default 1080
digilent-drm-hdmi amba:digilent_encoder: Digilent HDMI DRM Driver probed 0
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: failed to get video clk -517
xlnx-pl-disp amba:drm-pl_disp-drv: Didn't get vtc bridge instance
xlnx,bridge-vtc 43c20000.v_tc: vtc ppc = 1
xlnx,bridge-vtc 43c20000.v_tc: Xilinx VTC IP version : 0x0602000b
xlnx,bridge-vtc 43c20000.v_tc: Xilinx VTC DRM Bridge driver probed
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
xlnx-drm xlnx-drm.0: bound amba:drm-pl_disp-drv (ops 0xc073dad0)
xlnx-drm xlnx-drm.0: bound amba:digilent_encoder (ops hdmi_drm_driver_exit [digilent_drm_hdmi])
Console: switching to colour frame buffer device 100x30
xlnx-pl-disp amba:drm-pl_disp-drv: fb0:  frame buffer device
[drm] Initialized xlnx 1.0.0 20130509 for amba:drm-pl_disp-drv on minor 0
xlnx-pl-disp amba:drm-pl_disp-drv: Xlnx PL display driver probed

 

0 Kudos
Reply
florentw
Moderator
Moderator
346 Views
Registered: ‎11-09-2015

Hi @hokim 

Thank you for reporting this issue (with the fix) and for giving details on it.

I have sent the details to the SW developer, he has submitted the patch to be included in next release.

Regards


Florent
Product Application Engineer - Xilinx Technical Support EMEA
**~ Don't forget to reply, give kudos, and accept as solution.~**
0 Kudos
Reply