Debian Codegraph @

man/drmModeGetResources.3.rst

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