UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
1,319 Views
Registered: ‎09-05-2018

Use Scaler IP in a HDMI output

Jump to solution

Hello 

we wants to implement a scaler at the HDMI output.

such as FrameBuffer -> Mixer -> Scaler -> HDMI TX

we used Vivado to create the Scaler IP between Mixer and HDMI Tx and then import the project hardware into TRD 2018.3 petalinux.
The problem is that after this the HDMI Display is not recognize anymore, I'm just seeing th DP monitor, the vmix driver seems to need a reference to an entity called "xnlx,bridge" but it's not clear what I need to refer there..

root@KDS-DEC10-1:~# dmesg | grep drm
[ 3.340238] xlnx,scaler-bridge a00c0000.v_proc_ss: EZ xlnx drm scaler experimental driver probed
[ 3.447728] xlnx-drm xlnx-drm.0: trying to bring up master
[ 3.447733] xlnx-drm xlnx-drm.0: Looking for component 0
[ 3.447737] xlnx-drm xlnx-drm.0: found component fd4a0000.zynqmp-display, duplicate 0
[ 3.447847] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 3.454459] [drm] No driver support for vblank timestamp query.
[ 3.460387] xlnx-drm xlnx-drm.0: binding fd4a0000.zynqmp-display (ops 0xffffff8008b383e0)
[ 3.460447] xlnx-drm xlnx-drm.0: bound fd4a0000.zynqmp-display (ops 0xffffff8008b383e0)
[ 3.667318] [drm] Initialized xlnx 1.0.0 20130509 for fd4a0000.zynqmp-display on minor 0
[ 6.660271] xlnx-drm-hdmi a0020000.v_hdmi_tx_ss: probed
[ 6.661685] xlnx-drm-hdmi a0020000.v_hdmi_tx_ss: hdmi tx audio initialized
[ 6.661689] xlnx-drm-hdmi a0020000.v_hdmi_tx_ss: probe successful
[ 6.661734] xlnx-drm-hdmi a0020000.v_hdmi_tx_ss: adding component (ops xlnx_drm_hdmi_component_ops [xilinx_hdmi_tx])
root@KDS-DEC10-1:~#

 

root@KDS-DEC10-1:~# dmesg | grep mix
[ 3.349174] xlnx-mixer a0070000.v_mix: Didn't get vtc bridge instance

...

I have refer the mixer to the scaler but It's not working

hdmi_output_v_mix_0: v_mix@a0070000 {
clock-names = "ap_clk";
clocks = <&clk 72>;
compatible = "xlnx,v-mix-3.0", "xlnx,mixer-3.0";
interrupt-names = "interrupt";
interrupt-parent = <&gic>;
interrupts = <0 96 4>;
reg = <0x0 0xa0070000 0x0 0x10000>;
reset-gpios = <&gpio 94 1>;
xlnx,bpc = <8>;
xlnx,num-layers = <8>;
xlnx,ppc = <2>;
xlnx,bridge = <&hdmi_output_v_proc_ss_0>;
crtc_mixer_port: port@0 {
reg = <0>;
mixer_crtc: endpoint {
remote-endpoint = <&hdmi_encoder>;
};
};

my question is how should I define the Device Tree to complete the mixer driver initialization.

Attached pl.dtsi base of device tree

 

0 Kudos
1 Solution

Accepted Solutions
Adventurer
Adventurer
1,142 Views
Registered: ‎09-05-2018

Re: Use Scaler IP in a HDMI output

Jump to solution

hello xud

I have found the way xilinx kernel developper wants we config the scaler as inherited of xlnx-bridge

there is a sysfs command that configure the component from userspace to kernel directly like this

#!/bin/bash
do_config_bridge_4k()
{
cd /sys/kernel/debug/xlnx-bridge
echo "disable" > xlnx_bridge-v_proc_ss
echo "set_input 3840 2160 0x100a" > xlnx_bridge-v_proc_ss
echo "set_output 3840 2160 0x100a" > xlnx_bridge-v_proc_ss
echo "enable" > xlnx_bridge-v_proc_ss
}



9 Replies
Xilinx Employee
Xilinx Employee
1,231 Views
Registered: ‎08-02-2007

Re: Use Scaler IP in a HDMI output

Jump to solution

Hi @ericzerbib

From your dtsi file, your HDMI RX is driven to VPSS scraler but HDMI TX is still from mixer. Can you double check it? Also which port number do you use in modetest command (probably you can find it in autostart.sh)

  hdmi_output_v_hdmi_tx_ss_0: v_hdmi_tx_ss@a0020000 {
   /* User needs to change the property xlnx,audio-enabled=<0x1> based on the HDMI audio path */
   clock-names = "s_axi_cpu_aclk", "link_clk", "s_axis_audio_aclk", "video_clk", "s_axis_video_aclk";
   clocks = <&clk 71>, <&misc_clk_1>, <&clk 71>, <&misc_clk_2>, <&clk 72>;
   compatible = "xlnx,v-hdmi-tx-ss-3.1", "xlnx,v-hdmi-tx-ss-3.0";
   interrupt-names = "irq";
   interrupt-parent = <&gic>;
   interrupts = <0 93 4>;
   phy-names = "hdmi-phy0", "hdmi-phy1", "hdmi-phy2";
   phys = <&vphy_lane0 0 1 1 1>, <&vphy_lane1 0 1 1 1>, <&vphy_lane2 0 1 1 1>;
   reg = <0x0 0xa0020000 0x0 0x20000>;
   xlnx,audio-enabled = <0x0>;
   xlnx,input-pixels-per-clock = <2>;
   xlnx,max-bits-per-component = <8>;
   xlnx,xlnx-hdmi-acr-ctrl = <&hdmi_input_hdmi_acr_ctrl_0>;
   encoder_hdmi_port: port@0 {
    reg = <0>;
    hdmi_encoder: endpoint {
     remote-endpoint = <&mixer_crtc>;
    };
   };
  };

0 Kudos
Adventurer
Adventurer
1,212 Views
Registered: ‎09-05-2018

Re: Use Scaler IP in a HDMI output

Jump to solution

In my first approach I was thinikng that the scaler driver is wrote only to be use and configure as HDMI_VCAP api and my effort was to include the scaler as it was a scaler as input

But after digging in th code I have understand that ther is another driver (xnlx,vpss_scaler) perhaps experimental that inherit from the bridge interface present in the kernel DRM framework.

I have search for example of use and I have found the the scaler is used as scaler drm bridge in two other project

SDI Tx and DSI

the reference of (xlnx,bridge = <&...>) int the device tree in the mixer dirver is only for vtc_bridge which have not the same interface that the drm bridge... which lead me to another question

What is the good way to implement in the mixer the possibility to use the scaler as bridge and how to configure from the userspace the side of modeset at input , at output, and enbale disable which are the main functions for the vpss_scaler ?

0 Kudos
Xilinx Employee
Xilinx Employee
1,203 Views
Registered: ‎08-02-2007

Re: Use Scaler IP in a HDMI output

Jump to solution

Hi @ericzerbib

Please take a look at VCU TRD : https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/25329832/Zynq+UltraScale+MPSoC+VCU+TRD+2018.3

At HDMI input, it does use Scaler from VPSS, and it also contains mixers.

It also has examples which uses SDI.

0 Kudos
Adventurer
Adventurer
1,196 Views
Registered: ‎09-05-2018

Re: Use Scaler IP in a HDMI output

Jump to solution

Yes you are right it was the depart point from my investigation but it doesn't explain in detail, it just say the for the moment you can only use scaler as input under the V4l2/vcap hdmi input.

My investigation a more about how to connect the same scaler used as input also at output between the mixer and HDMI TX

0 Kudos
Xilinx Employee
Xilinx Employee
1,184 Views
Registered: ‎08-02-2007

Re: Use Scaler IP in a HDMI output

Jump to solution

Hi @ericzerbib

Can you let me know which design module you used as a starting point? I will have a closer look, and explain to you how it's related to the hardware.

Forgot to mention, if your Vivado and petalinux version is 2018.3, device tree of SDI is generated automatically, under xilinx-vcu-trd-zcu106-v2018.3-final/components/plnx_workspace/device-tree/device-tree.

0 Kudos
Adventurer
Adventurer
1,174 Views
Registered: ‎09-05-2018

Re: Use Scaler IP in a HDMI output

Jump to solution

We have base our module design from 

3HDMI AudioDesign supporting Audio with HDMI-Rx and HDMI-Tx and showcasing capabilities of VCU

 because our application need HDMI output and audio

basically a RTSP streamer decoder and we wants to be sure that which ever stream format we receive at the network, the output will fit perfectly all the screen at the output ( e.g receive 1080p60 at input will upscale to 4k60 at output when the native resolution of the TV screen is 4k for example)

2) The device tree was generated automatically and i used it, but after it was hard to make changes so i disable the automatic generation

My question stay always what is the right way to use or if needed to modify the kernel source code to be able to configure the scaler as output  ( we use for now "scaler only" profile in VPSS IP)

see code at 

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

to be able to see an image I have for now made these changes in blue an i can see my image, but when i use input as 1080p output as 4k it doesn't work and modeset fails to set the mode at the HDMI TV. Secondly the change is static in the code and i want to be able to modify the  input/output from a program in the linux userspace.

static int xilinx_scaler_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct resource *res;
struct xilinx_scaler *scaler;
int ret;

scaler = devm_kzalloc(dev, sizeof(*scaler), GFP_KERNEL);
if (!scaler)
return -ENOMEM;
scaler->dev = dev;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
scaler->base = devm_ioremap_resource(dev, res);
if (IS_ERR(scaler->base)) {
dev_err(dev, "failed to remap io region\n");
return -ENOMEM;
}
platform_set_drvdata(pdev, scaler);

ret = xilinx_scaler_parse_of(scaler);
if (ret < 0) {
dev_info(scaler->dev, "parse_of failed ret=%d\n",ret);
return ret;
}
scaler->max_num_phases = XSCALER_MAX_PHASES;
scaler->max_lines = XSCALER_MAX_HEIGHT;
scaler->max_pixels = XSCALER_MAX_WIDTH;

/* Reset the Global IP Reset through a GPIO */
gpiod_set_value_cansleep(scaler->rst_gpio, XSCALER_RESET_DEASSERT);
xilinx_scaler_reset(scaler);

scaler->bridge.enable = &xilinx_scaler_bridge_enable;
scaler->bridge.disable = &xilinx_scaler_bridge_disable;
scaler->bridge.set_input = &xilinx_scaler_bridge_set_input;
scaler->bridge.get_input_fmts = &xilinx_scaler_bridge_get_input_fmts;
scaler->bridge.set_output = &xilinx_scaler_bridge_set_output;
scaler->bridge.get_output_fmts = &xilinx_scaler_bridge_get_output_fmts;
scaler->bridge.of_node = dev->of_node;

ret = xlnx_bridge_register(&scaler->bridge);
if (ret) {
dev_info(scaler->dev, "Bridge registration failed\n");
return ret;
}

dev_info(scaler->dev, "EZ xlnx drm scaler before set [out/in]put\n");
xilinx_scaler_bridge_set_input((&scaler->bridge), 1920, 1080,MEDIA_BUS_FMT_RGB888_1X24);
//xilinx_scaler_bridge_set_output((&scaler->bridge), 3180, 2160,MEDIA_BUS_FMT_RGB888_1X24);
//xilinx_scaler_bridge_set_input((&scaler->bridge), 3180, 2160,MEDIA_BUS_FMT_RGB888_1X24);
xilinx_scaler_bridge_set_output((&scaler->bridge), 1920, 1080,MEDIA_BUS_FMT_RGB888_1X24);
dev_info(scaler->dev, "EZ xlnx drm scaler before enable\n");
xilinx_scaler_bridge_enable(&scaler->bridge);
dev_info(scaler->dev, "EZ xlnx drm scaler after enable\n");

dev_info(scaler->dev, "EZ xlnx drm scaler experimental driver probed\n");


return 0;
}

0 Kudos
Adventurer
Adventurer
1,143 Views
Registered: ‎09-05-2018

Re: Use Scaler IP in a HDMI output

Jump to solution

hello xud

I have found the way xilinx kernel developper wants we config the scaler as inherited of xlnx-bridge

there is a sysfs command that configure the component from userspace to kernel directly like this

#!/bin/bash
do_config_bridge_4k()
{
cd /sys/kernel/debug/xlnx-bridge
echo "disable" > xlnx_bridge-v_proc_ss
echo "set_input 3840 2160 0x100a" > xlnx_bridge-v_proc_ss
echo "set_output 3840 2160 0x100a" > xlnx_bridge-v_proc_ss
echo "enable" > xlnx_bridge-v_proc_ss
}



Xilinx Employee
Xilinx Employee
1,135 Views
Registered: ‎08-02-2007

Re: Use Scaler IP in a HDMI output

Jump to solution

Hi ericzerbib,

Great to hear you've found the way.

Associated code is

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

Can you share information on how you figure out the bus_fmt value, please?

0 Kudos
Adventurer
Adventurer
1,128 Views
Registered: ‎09-05-2018

Re: Use Scaler IP in a HDMI output

Jump to solution

Obvously

see : https://github.com/Xilinx/linux-xlnx/blob/master/drivers/gpu/drm/xlnx/xlnx_scaler.c

static int
 xv_vscaler_setup_video_fmt(struct xilinx_scaler *scaler, u32 code_in)

only these formats are available

case MEDIA_BUS_FMT_UYVY8_1X16
case MEDIA_BUS_FMT_VUY8_1X24:
case MEDIA_BUS_FMT_RGB888_1X24:
case MEDIA_BUS_FMT_VYYUYY8_1X24:

which are defined in <..../media-bus-format.h>