Page 1 of 1

Getting Dispmanx window/layer/element from a X Window

Posted: Tue Mar 21, 2017 10:24 pm
by JinShil
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?

Thanks,
Mike

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

Posted: Wed Mar 22, 2017 8:19 am
by ghans
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.

ghans

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

Posted: Wed Mar 22, 2017 1:52 pm
by jamesh
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.

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

Posted: Fri Mar 24, 2017 12:07 pm
by dividuum
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