Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

drmmodegetresources(3) [debian man page]

drmModeGetResources(libdrm 2.4.40)										drmModeGetResources(libdrm 2.4.40)

NAME
drmModeGetResources - retrieve current display configuration information SYNOPSIS
#include <xf86drmMode.h> typedef struct _drmModeRes { int count_fbs; uint32_t *fbs; int count_crtcs; uint32_t *crtcs; int count_connectors; uint32_t *connectors; int count_encoders; uint32_t *encoders; uint32_t min_width, max_width; uint32_t min_height, max_height; } drmModeRes, *drmModeResPtr; drmModeResPtr drmModeGetResources(int fd); DESCRIPTION
This function will allocate, populate, and return a drmModeRes structure containing information about the current display configuration. The count_fbs and fbs fields indicate the number of currently allocated framebuffer objects (i.e. objects that can be attached to a given CRTC or sprite for display). The count_crtcs and crtcs fields list the available CRTCs in the configuration. A CRTC is simply an object that can scan out a framebuffer to a display sink, and contains mode timing and relative position information. CRTCs drive encoders, which are responsible for converting the pixel stream into a specific display protocol (e.g. MIPI or HDMI). The count_connectors and connectors fields list the available physical connectors on the system. Note that some of these may not be exposed from the chassis (e.g. LVDS or eDP). Connectors are attached to encoders and contain information about the attached display sink (e.g. width and height in mm, subpixel ordering, and various other properties). The count_encoders and encoders fields list the available encoders on the device. Each encoder may be associated with a CRTC, and may be used to drive a particular encoder. The min and max height fields indicate the maximum size of a framebuffer for this device (i.e. the scanout size limit). RETURN VALUE
Returns a drmModeRes structure pointer on success, 0 on failure. REPORTING BUGS
Bugs in this function should be reported to http://bugs.freedesktop.org under the "Mesa" product, with "Other" or "libdrm" as the compo- nent. SEE ALSO
drmModeGetFB(3), drmModeAddFB(3), drmModeAddFB2(3), drmModeRmFB(3), drmModeDirtyFB(3), drmModeGetCrtc(3), drmModeSetCrtc(3), drmModeGetEn- coder(3), drmModeGetConnector(3) drmModeGetResources(libdrm 2.4.40)

Check Out this Related Man Page

DRM(7)							     Direct Rendering Manager							    DRM(7)

NAME
drm - Direct Rendering Manager SYNOPSIS
#include <xf86drm.h> DESCRIPTION
The Direct Rendering Manager (DRM) is a framework to manage Graphics Processing Units (GPUs). It is designed to support the needs of complex graphics devices, usually containing programmable pipelines well suited to 3D graphics acceleration. Furthermore, it is responsible for memory management, interrupt handling and DMA to provide a uniform interface to applications. In earlier days, the kernel framework was solely used to provide raw hardware access to priviledged user-space processes which implement all the hardware abstraction layers. But more and more tasks where moved into the kernel. All these interfaces are based on ioctl(2) commands on the DRM character device. The libdrm library provides wrappers for these system-calls and many helpers to simplify the API. When a GPU is detected, the DRM system loads a driver for the detected hardware type. Each connected GPU is then presented to user-space via a character-device that is usually available as /dev/dri/card0 and can be accessed with open(2) and close(2). However, it still depends on the grapics driver which interfaces are available on these devices. If an interface is not available, the syscalls will fail with EINVAL. Authentication All DRM devices provide authentication mechanisms. Only a DRM-Master is allowed to perform mode-setting or modify core state and only one user can be DRM-Master at a time. See drmSetMaster(3) for information on how to become DRM-Master and what the limitations are. Other DRM users can be authenticated to the DRM-Master via drmAuthMagic(3) so they can perform buffer allocations and rendering. Mode-Setting Managing connected monitors and displays and changing the current modes is called Mode-Setting. This is restricted to the current DRM-Master. Historically, this was implemented in user-space, but new DRM drivers implement a kernel interface to perform mode-setting called Kernel Mode Setting (KMS). If your hardware-driver supports it, you can use the KMS API provided by DRM. This includes allocating framebuffers, selecting modes and managing CRTCs and encoders. See drm-kms(7) for more. Memory Management The most sophisticated tasks for GPUs today is managing memory objects. Textures, framebuffers, command-buffers and all other kinds of commands for the GPU have to be stored in memory. The DRM driver takes care of managing all memory objects, flushing caches, synchronizing access and providing CPU access to GPU memory. All memory management is hardware driver dependent. However, two generic frameworks are available that are used by most DRM drivers. These are the Translation Table Manager (TTM) and the Graphics Execution Manager (GEM). They provide generic APIs to create, destroy and access buffers from user-space. However, there are still many differences between the drivers so driver-depedent code is still needed. Many helpers are provided in libgbm (Graphics Buffer Manager) from the mesa-project. For more information on DRM memory-management, see drm-memory(7). REPORTING BUGS
Bugs in this manual should be reported to http://bugs.freedesktop.org under the "Mesa" product, with "Other" or "libdrm" as the component. SEE ALSO
drm-kms(7), drm-memory(7), drmSetMaster(3), drmAuthMagic(3), drmAvailable(3), drmOpen(3) libdrm September 2012 DRM(7)
Man Page