1DRMMODEGETRESOURCES(3)     Direct Rendering Manager     DRMMODEGETRESOURCES(3)
2
3
4

NAME

6       drmModeGetResources  -  retrieve current display configuration informa‐
7       tion
8

SYNOPSIS

10       #include <xf86drm.h>
11
12       #include <xf86drmMode.h>
13
14       drmModeResPtr drmModeGetResources(int fd);
15

DESCRIPTION

17       drmModeGetResources allocates,  populates,  and  returns  a  drmModeRes
18       structure  containing  information about the current display configura‐
19       tion. The structure contains the following fields:
20
21          typedef struct _drmModeRes {
22              int count_fbs;
23              uint32_t *fbs;
24
25              int count_crtcs;
26              uint32_t *crtcs;
27
28              int count_connectors;
29              uint32_t *connectors;
30
31              int count_encoders;
32              uint32_t *encoders;
33
34              uint32_t min_width, max_width;
35              uint32_t min_height, max_height;
36          } drmModeRes, *drmModeResPtr;
37
38       The count_fbs and fbs fields indicate the number of currently allocated
39       framebuffer objects (i.e., objects that can be attached to a given CRTC
40       or sprite for display).
41
42       The count_crtcs and crtcs fields list the available CRTCs in  the  con‐
43       figuration.  A CRTC is simply an object that can scan out a framebuffer
44       to a display sink, and contains mode timing and relative  position  in‐
45       formation.  CRTCs  drive encoders, which are responsible for converting
46       the pixel stream into a specific display protocol (e.g., MIPI or HDMI).
47
48       The count_connectors and connectors fields list the available  physical
49       connectors  on  the  system. Note that some of these may not be exposed
50       from the chassis (e.g., LVDS or eDP). Connectors are  attached  to  en‐
51       coders  and  contain information about the attached display sink (e.g.,
52       width and height in mm, subpixel ordering, and  various  other  proper‐
53       ties).
54
55       The  count_encoders  and encoders fields list the available encoders on
56       the device. Each encoder may be associated with a CRTC, and may be used
57       to drive a particular encoder.
58
59       The  min_*  and max_* fields indicate the maximum size of a framebuffer
60       for this device (i.e., the scanout size limit).
61

RETURN VALUE

63       drmModeGetResources returns a drmModeRes structure pointer on  success,
64       NULL  on  failure.  The  returned structure must be freed with drmMode‐
65       FreeResources(3).
66

REPORTING BUGS

68       Bugs     in     this     function     should     be     reported     to
69       https://gitlab.freedesktop.org/mesa/drm/-/issues
70

SEE ALSO

72       drm(7), drm-kms(7), drmModeGetFB(3), drmModeAddFB(3), drmModeAddFB2(3),
73       drmModeRmFB(3),  drmModeDirtyFB(3),  drmModeGetCrtc(3),  drmModeSetCrtc
74       (3), drmModeGetEncoder (3), drmModeGetConnector(3)
75
76
77
78
79                                September 2012          DRMMODEGETRESOURCES(3)
Impressum