kingbox1
Posts: 15
Joined: Fri Mar 29, 2019 6:21 am

Display device id of primary monitor??

Tue Aug 20, 2019 6:00 am

Hi All
I have recently got my new pi4 device. However, I am getting trouble trying to get the device id of my primary monitor.
I am using vc_dispmanx_display_open(int device_id) to open a display when i want to draw something to that monitor and I managed to find that the device_id for two display output port on pi4 is 2 and 7(weird....) and I can use Xrandr or Xinerama extension sdk to get the monitor layout or the primary monitor and its position. However, I cannot find a way to map the primary monitor to the device id(2 or 7). Any advice??

User avatar
dividuum
Posts: 163
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: Display device id of primary monitor??

Thu Aug 22, 2019 10:43 am

kingbox1 wrote:
Tue Aug 20, 2019 6:00 am
Hi All
I have recently got my new pi4 device. However, I am getting trouble trying to get the device id of my primary monitor.
I am using vc_dispmanx_display_open(int device_id) to open a display when i want to draw something to that monitor and I managed to find that the device_id for two display output port on pi4 is 2 and 7(weird....) and I can use Xrandr or Xinerama extension sdk to get the monitor layout or the primary monitor and its position. However, I cannot find a way to map the primary monitor to the device id(2 or 7). Any advice??
I'm not entirely sure what you're trying to achieve, but the display ids 2/7 (if you're curious what other ids exist, have a look at /opt/vc/include/interface/vmcs_host/vc_dispmanx_types.h) are relevant for dispmanx, while X now uses DRM to show content. The latter doesn't expose the internally used dispmanx display ids, so the only way to correlate them AFAIK is to use the offset within the display_number array from vc_tv_get_attached_devices and the connectors returned by drmModeGetResources. See also here.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

Return to “Graphics programming”