[Kernel] How to display 4 windows(A, B, C, D) on one monitor by one dc controller

Now, In our project, we want to display 4 1080P video streams(YUV420P) on one monitor. The below pic shows it.

| 1920x1080(win A)|1920x1080(win B)|
|-----------------±---------------+ 2160
| 1920x1080(win C)|1920x1080(win D)|


We have trouble in realizing it. In our config, we modify file “kernel/driver/video/tegra/dc/dc.c”,

add three fb_mem resources to be mapped with win B, win C, win D. And modify file “kerne/driver/video/tegra/fb.c”,

modify tegra_fb_set_par function. Firstly, we add YUV420P support, beacuse only RGB format is supported

in Nvidia’s official Kernel. Secondly, we set tegar_fb->win.out_x, tegar_fb->win.out_y, tegar_fb->win.out.w,

tegar_fb->win.out_h according to the tegar_fb->win.idx. But it doesn’t work rightly.

********* win A ** win B ** win C ** win D

win.out_x ** 0 * 1920 * 0 * 1920

win.out_y ** 0 * 0 * 1080 * 1080

win.out_w * 1920 * 1920 * 1920 *1920

win.out_h * 1080 * 1080 * 1080 * 1080

Then we also set tegar_fb->win.stride, tegar_fb->win.stride_nv, tegra_fb->win.phys_addr_u, tegra_fb->win.phys_addr_v.

But it still doesn’t work rightly.

tegra_fb->win.stride = var->xres / 2 * var->bits_per_pixel / 8; (because win’s width is half of monitor’s width)

tegra_fb->win.stride_uv = tegra_fb->win.stride;

tegra_fb->win.phys_addr_u = tegar_fb->phys_start + tegar_fb->win.out_w * tegra_fb->win.out_h;

tegar_fb->win.phys_addr_v = tegar_fb->win.phys_addr_u + tegar_fb->win.out_w * tegra_fb->win.out_h / 4;

We could put different video frames to the win A, win B, win C, win D, but the image showed on monitor is not right.

Our problem is how to modify some driver source files to support 4 windows displaying ? Or is this usecase supported

by Nvidia Tgera X1 Display Controller ?

Hi shiautsung,

I believe there would be some problems in your implementation.

According to TX1 TRM chapter 25. display controller, you can see there are 5 display controller windows: A,B,C and D,T.

Window D is a simple window with only RGB support. As a result, only 3 windows can be used for rendering different video streaming.

The whole ubuntu gnome desktop only uses one dc window in current BSP. If you are using X-based API to do rendering, only one window would be used.

nvoverlaysink is a solution that can directly use dc windows.

Hi, WayneWWW,

Firstly, thanks for your repley.
And if we use nvoverlaysink to render three video streams, could you give some examples to realize it. Such as gst-launch-1.0 command line parameters.

Hi shiautsung,

Please follow


Hi WayneWWW,

Another question.
if we render 2 video streams on one monitor, are these video data arranged in application layer or in kernel driver layer? Because we applied two nvoverlaysink to render 2 video streams, and find the time delay is about 2 seconds. It is not accepted for us.

Hi shiautsung,

Have you enhanced the performance by using jetson_clock.sh already?