summaryrefslogtreecommitdiff
path: root/xf86drmMode.h
diff options
context:
space:
mode:
authorLuigi Santivetti <luigi.santivetti@imgtec.com>2021-03-25 22:42:38 +0000
committerSimon Ser <contact@emersion.fr>2021-11-08 16:20:04 +0000
commite641e2a632d779f638ac2ba983b9fceb20b3fac4 (patch)
treeb22964ff5fc7af84938fcfb1184c41459df64e3b /xf86drmMode.h
parentf256bb9afdcf5b677d0ac3853e45bc97fc2956d4 (diff)
downloaddrm-e641e2a632d779f638ac2ba983b9fceb20b3fac4.tar.gz
xf86drm: add iterator API for DRM/KMS IN_FORMATS blobs
Add support for parsing IN_FORMATS property blobs. Providing libdrm with this functionality helps to standardise how user-space reads kernel blobs and decreases duplication on the client side. drmModeFormatModifierBlobIterNext() allows the caller to view formats and associated modifiers given a valid property blob. An example is available inside the libdrm unit test, modetest.c. Signed-off-by: Luigi Santivetti <luigi.santivetti@imgtec.com> Reviewed-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'xf86drmMode.h')
-rw-r--r--xf86drmMode.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/xf86drmMode.h b/xf86drmMode.h
index de0e2fdb..19bf91dd 100644
--- a/xf86drmMode.h
+++ b/xf86drmMode.h
@@ -42,6 +42,7 @@ extern "C" {
#include <drm.h>
#include <drm_mode.h>
+#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
@@ -231,6 +232,12 @@ typedef struct _drmModeObjectProperties {
uint64_t *prop_values;
} drmModeObjectProperties, *drmModeObjectPropertiesPtr;
+typedef struct _drmModeFormatModifierIterator {
+ uint32_t fmt_idx, mod_idx;
+ uint32_t fmt;
+ uint64_t mod;
+} drmModeFormatModifierIterator;
+
typedef struct _drmModePlane {
uint32_t count_formats;
uint32_t *formats;
@@ -388,6 +395,8 @@ extern drmModePropertyPtr drmModeGetProperty(int fd, uint32_t propertyId);
extern void drmModeFreeProperty(drmModePropertyPtr ptr);
extern drmModePropertyBlobPtr drmModeGetPropertyBlob(int fd, uint32_t blob_id);
+extern bool drmModeFormatModifierBlobIterNext(const drmModePropertyBlobRes *blob,
+ drmModeFormatModifierIterator *iter);
extern void drmModeFreePropertyBlob(drmModePropertyBlobPtr ptr);
extern int drmModeConnectorSetProperty(int fd, uint32_t connector_id, uint32_t property_id,
uint64_t value);