aboutsummaryrefslogtreecommitdiff
path: root/include/backend/drm/properties.h
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-02 08:46:06 -0400
committerGitHub <noreply@github.com>2017-10-02 08:46:06 -0400
commit87a0cb7ba37eed29662ec16ce95493a0238ef660 (patch)
tree95554cb777848ce7246b651c09740d307bcdd506 /include/backend/drm/properties.h
parentaa8a4f12b7e7ea8c3a1876f0585dd6171f8cb705 (diff)
parent9ec9edc40d4694dedfd7f00eb9106ce5ed133239 (diff)
Merge pull request #182 from ascent12/drm-multi-gpu
DRM Multi-GPU
Diffstat (limited to 'include/backend/drm/properties.h')
-rw-r--r--include/backend/drm/properties.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/include/backend/drm/properties.h b/include/backend/drm/properties.h
new file mode 100644
index 00000000..7de386ea
--- /dev/null
+++ b/include/backend/drm/properties.h
@@ -0,0 +1,67 @@
+#ifndef BACKEND_DRM_PROPERTIES_H
+#define BACKEND_DRM_PROPERTIES_H
+
+#include <stdbool.h>
+#include <stdint.h>
+
+/*
+ * These types contain the property ids for several DRM objects.
+ * See https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html#kms-properties
+ * for more details.
+ */
+
+union wlr_drm_connector_props {
+ struct {
+ uint32_t edid;
+ uint32_t dpms;
+
+ // atomic-modesetting only
+
+ uint32_t crtc_id;
+ };
+ uint32_t props[3];
+};
+
+union wlr_drm_crtc_props {
+ struct {
+ // Neither of these are guranteed to exist
+ uint32_t rotation;
+ uint32_t scaling_mode;
+
+ // atomic-modesetting only
+
+ uint32_t active;
+ uint32_t mode_id;
+ };
+ uint32_t props[4];
+};
+
+union wlr_drm_plane_props {
+ struct {
+ uint32_t type;
+ uint32_t rotation; // Not guranteed to exist
+
+ // atomic-modesetting only
+
+ uint32_t src_x;
+ uint32_t src_y;
+ uint32_t src_w;
+ uint32_t src_h;
+ uint32_t crtc_x;
+ uint32_t crtc_y;
+ uint32_t crtc_w;
+ uint32_t crtc_h;
+ uint32_t fb_id;
+ uint32_t crtc_id;
+ };
+ uint32_t props[12];
+};
+
+bool wlr_drm_get_connector_props(int fd, uint32_t id, union wlr_drm_connector_props *out);
+bool wlr_drm_get_crtc_props(int fd, uint32_t id, union wlr_drm_crtc_props *out);
+bool wlr_drm_get_plane_props(int fd, uint32_t id, union wlr_drm_plane_props *out);
+
+bool wlr_drm_get_prop(int fd, uint32_t obj, uint32_t prop, uint64_t *ret);
+void *wlr_drm_get_prop_blob(int fd, uint32_t obj, uint32_t prop, size_t *ret_len);
+
+#endif