1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 Written 2012 by David Herrmann <dh.herrmann@googlemail.com>
7 Dedicated to the Public Domain
10 <refentry id="drmModeGetResources">
12 <title>Direct Rendering Manager</title>
13 <productname>libdrm</productname>
14 <date>September 2012</date>
17 <contrib>Developer</contrib>
18 <firstname>David</firstname>
19 <surname>Herrmann</surname>
20 <email>dh.herrmann@googlemail.com</email>
26 <refentrytitle>drmModeGetResources</refentrytitle>
27 <manvolnum>3</manvolnum>
31 <refname>drmModeGetResources</refname>
32 <refpurpose>retrieve current display configuration information</refpurpose>
38 <funcsynopsisinfo>#include <xf86drm.h></funcsynopsisinfo>
39 <funcsynopsisinfo>#include <xf86drmMode.h></funcsynopsisinfo>
42 <funcdef>drmModeResPtr <function>drmModeGetResources</function></funcdef>
43 <paramdef>int <parameter>fd</parameter></paramdef>
50 <title>Description</title>
51 <para><function>drmModeGetResources</function> allocates, populates, and
52 returns a <structname>drmModeRes</structname> structure containing
53 information about the current display configuration. The structure
54 contains the following fields:
57 typedef struct _drmModeRes {
70 uint32_t min_width, max_width;
71 uint32_t min_height, max_height;
72 } drmModeRes, *drmModeResPtr;
77 <para>The <structfield>count_fbs</structfield> and
78 <structfield>fbs</structfield> fields indicate the number of currently
79 allocated framebuffer objects (i.e., objects that can be attached to
80 a given CRTC or sprite for display).</para>
82 <para>The <structfield>count_crtcs</structfield> and
83 <structfield>crtcs</structfield> fields list the available CRTCs in
84 the configuration. A CRTC is simply an object that can scan out a
85 framebuffer to a display sink, and contains mode timing and relative
86 position information. CRTCs drive encoders, which are responsible for
87 converting the pixel stream into a specific display protocol (e.g.,
90 <para>The <structfield>count_connectors</structfield> and
91 <structfield>connectors</structfield> fields list the available
92 physical connectors on the system. Note that some of these may not be
93 exposed from the chassis (e.g., LVDS or eDP). Connectors are attached
94 to encoders and contain information about the attached display sink
95 (e.g., width and height in mm, subpixel ordering, and various other
98 <para>The <structfield>count_encoders</structfield> and
99 <structfield>encoders</structfield> fields list the available encoders
100 on the device. Each encoder may be associated with a CRTC, and may be
101 used to drive a particular encoder.</para>
103 <para>The <structfield>min*</structfield> and
104 <structfield>max*</structfield> fields indicate the maximum size of a
105 framebuffer for this device (i.e., the scanout size limit).</para>
109 <title>Return Value</title>
110 <para><function>drmModeGetResources</function> returns a drmModeRes
111 structure pointer on success, <literal>NULL</literal> on failure. The
112 returned structure must be freed with
113 <citerefentry><refentrytitle>drmModeFreeResources</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
117 <title>Reporting Bugs</title>
118 <para>Bugs in this function should be reported to
119 https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=libdrm
120 under the "DRI" product, component "libdrm"</para>
124 <title>See Also</title>
126 <citerefentry><refentrytitle>drm</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
127 <citerefentry><refentrytitle>drm-kms</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
128 <citerefentry><refentrytitle>drmModeGetFB</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
129 <citerefentry><refentrytitle>drmModeAddFB</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
130 <citerefentry><refentrytitle>drmModeAddFB2</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
131 <citerefentry><refentrytitle>drmModeRmFB</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
132 <citerefentry><refentrytitle>drmModeDirtyFB</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
133 <citerefentry><refentrytitle>drmModeGetCrtc</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
134 <citerefentry><refentrytitle>drmModeSetCrtc</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
135 <citerefentry><refentrytitle>drmModeGetEncoder</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
136 <citerefentry><refentrytitle>drmModeGetConnector</refentrytitle><manvolnum>3</manvolnum></citerefentry>