1=================== 2drmModeGetResources 3=================== 4 5-------------------------------------------------- 6retrieve current display configuration information 7-------------------------------------------------- 8 9:Date: September 2012 10:Manual section: 3 11:Manual group: Direct Rendering Manager 12 13Synopsis 14======== 15 16``#include <xf86drm.h>`` 17 18``#include <xf86drmMode.h>`` 19 20``drmModeResPtr drmModeGetResources(int fd);`` 21 22Description 23=========== 24 25``drmModeGetResources`` allocates, populates, and returns a drmModeRes 26structure containing information about the current display 27configuration. The structure contains the following fields: 28 29:: 30 31 typedef struct _drmModeRes { 32 int count_fbs; 33 uint32_t *fbs; 34 35 int count_crtcs; 36 uint32_t *crtcs; 37 38 int count_connectors; 39 uint32_t *connectors; 40 41 int count_encoders; 42 uint32_t *encoders; 43 44 uint32_t min_width, max_width; 45 uint32_t min_height, max_height; 46 } drmModeRes, *drmModeResPtr; 47 48The *count_fbs* and *fbs* fields indicate the number of currently allocated 49framebuffer objects (i.e., objects that can be attached to a given CRTC 50or sprite for display). 51 52The *count_crtcs* and *crtcs* fields list the available CRTCs in the 53configuration. A CRTC is simply an object that can scan out a 54framebuffer to a display sink, and contains mode timing and relative 55position information. CRTCs drive encoders, which are responsible for 56converting the pixel stream into a specific display protocol (e.g., MIPI 57or HDMI). 58 59The *count_connectors* and *connectors* fields list the available physical 60connectors on the system. Note that some of these may not be exposed 61from the chassis (e.g., LVDS or eDP). Connectors are attached to 62encoders and contain information about the attached display sink (e.g., 63width and height in mm, subpixel ordering, and various other 64properties). 65 66The *count_encoders* and *encoders* fields list the available encoders on 67the device. Each encoder may be associated with a CRTC, and may be used 68to drive a particular encoder. 69 70The *min_\** and *max_\** fields indicate the maximum size of a framebuffer 71for this device (i.e., the scanout size limit). 72 73Return Value 74============ 75 76``drmModeGetResources`` returns a drmModeRes structure pointer on 77success, NULL on failure. The returned structure must be freed with 78**drmModeFreeResources**\ (3). 79 80Reporting Bugs 81============== 82 83Bugs in this function should be reported to 84https://gitlab.freedesktop.org/mesa/drm/-/issues 85 86See Also 87======== 88 89**drm**\ (7), **drm-kms**\ (7), **drmModeGetFB**\ (3), **drmModeAddFB**\ (3), 90**drmModeAddFB2**\ (3), **drmModeRmFB**\ (3), **drmModeDirtyFB**\ (3), 91**drmModeGetCrtc**\ (3), **drmModeSetCrtc** (3), **drmModeGetEncoder** (3), 92**drmModeGetConnector**\ (3) 93