Posts: 103
Joined: Wed Mar 15, 2017 11:35 am

Getting Dispmanx window/layer/element from a X Window

Tue Mar 21, 2017 10:24 pm

I'm a little new to programming the Raspberry Pi, but from what I've read, I'm under the impression that everything on the screen is eventually just a Dispmanx entity (window/element/layer/resource whatever the terminology is). Is this also true for X Windows?

If so, is there any way to get the Dispmanx entity (window/element/layer/resource) of an X window?


Posts: 7893
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Getting Dispmanx window/layer/element from a X Window

Wed Mar 22, 2017 8:19 am

X has no idea about dispmanx layers , and dispmanx has no idea about X windows' windows. They are independent , with dispmanx layers overriding X output.
omxplayerGUI and MinecraftPi create an empty X window and "manually" sync position and size of the dispmanx layer when the X window is manipulated.

Last edited by ghans on Thu Apr 20, 2017 9:47 am, edited 1 time in total.
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 32794
Joined: Sat Jul 30, 2011 7:41 pm

Re: Getting Dispmanx window/layer/element from a X Window

Wed Mar 22, 2017 1:52 pm

All of X displays on one dispmanx layer, at least on the standard build. I am not sure what happens with the latest GL driver, but I suspect it is the same.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

User avatar
Posts: 240
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany

Re: Getting Dispmanx window/layer/element from a X Window

Fri Mar 24, 2017 12:07 pm

If you want to understand how the content of the screen is put together, you can run vcgencmd like this:

Code: Select all

pi ~ # vcgencmd dispmanx_list
display:2 format:XRGB8888 transform:0 layer:-127 src:0,0,1920,1080 dst:0,0,1920,1080 cost:1156 lbm:0
display is the Diplay for that layer: 2 being HDMI/analog, 0 being DSI (like the Raspberry Pi 7" screen). transform shows things like vertical/horizontal flipping or rotations. layer is the layer: Higher layers cover lower layers. src is which part of a source is actually used for the layer output: Videos, for example, can be scaled up by selecting parts of it and drawing it fullscreen. In dispmanx_list output that might look like this:

Code: Select all

display:2 format:YUV_UV transform:10000 layer:-190 src:0,0,1080,640 dst:49,0,1822,1080 cost:1162 lbm:17408
This transforms a 1920x1080 video, rotates it and takes the 0, 0 -> 640,1080 area and draws that on the screen at the coordinates given in dst. cost is some cost indicator. I'm not entirely sure how useful it is. lbm is "[..]the line buffer memory. That is the context required for vertical resizing. That is a dedicated block of memory in the HVS hardware of 96K. Go above that and elements can't be displayed.[...]" (quote source).

Additional information can be found here: https://github.com/raspberrypi/firmware/issues/695 and https://info-beamer.com/blog/raspberry- ... deo-scaler
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

Return to “Graphics programming”