drmModeGetResources.3.rst 2.7 KB

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