2017-09-23 08:26:01 +00:00
|
|
|
#ifndef BACKEND_DRM_PROPERTIES_H
|
|
|
|
#define BACKEND_DRM_PROPERTIES_H
|
2017-07-20 01:37:07 +00:00
|
|
|
|
|
|
|
#include <stdbool.h>
|
2023-06-05 20:45:28 +00:00
|
|
|
#include <stddef.h>
|
2017-07-20 01:37:07 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These types contain the property ids for several DRM objects.
|
2024-02-21 11:02:47 +00:00
|
|
|
* For more details, see:
|
|
|
|
* https://dri.freedesktop.org/docs/drm/gpu/drm-kms.html#kms-properties
|
2017-07-20 01:37:07 +00:00
|
|
|
*/
|
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
struct wlr_drm_connector_props {
|
|
|
|
uint32_t edid;
|
|
|
|
uint32_t dpms;
|
|
|
|
uint32_t link_status; // not guaranteed to exist
|
|
|
|
uint32_t path;
|
|
|
|
uint32_t vrr_capable; // not guaranteed to exist
|
|
|
|
uint32_t subconnector; // not guaranteed to exist
|
|
|
|
uint32_t non_desktop;
|
|
|
|
uint32_t panel_orientation; // not guaranteed to exist
|
|
|
|
uint32_t content_type; // not guaranteed to exist
|
|
|
|
uint32_t max_bpc; // not guaranteed to exist
|
2017-07-20 01:37:07 +00:00
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
// atomic-modesetting only
|
2017-07-20 01:37:07 +00:00
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
uint32_t crtc_id;
|
2017-07-20 01:37:07 +00:00
|
|
|
};
|
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
struct wlr_drm_crtc_props {
|
|
|
|
// Neither of these are guaranteed to exist
|
|
|
|
uint32_t vrr_enabled;
|
|
|
|
uint32_t gamma_lut;
|
|
|
|
uint32_t gamma_lut_size;
|
2017-08-09 08:43:01 +00:00
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
// atomic-modesetting only
|
2017-08-09 08:43:01 +00:00
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
uint32_t active;
|
|
|
|
uint32_t mode_id;
|
2021-10-20 18:09:38 +00:00
|
|
|
uint32_t out_fence_ptr;
|
2017-07-20 01:37:07 +00:00
|
|
|
};
|
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
struct wlr_drm_plane_props {
|
|
|
|
uint32_t type;
|
|
|
|
uint32_t rotation; // Not guaranteed to exist
|
|
|
|
uint32_t in_formats; // Not guaranteed to exist
|
2024-03-20 13:16:47 +00:00
|
|
|
uint32_t size_hints; // Not guaranteed to exist
|
2017-07-20 01:37:07 +00:00
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
// atomic-modesetting only
|
2017-07-20 01:37:07 +00:00
|
|
|
|
2024-06-18 14:29:48 +00:00
|
|
|
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 fb_damage_clips;
|
|
|
|
uint32_t hotspot_x;
|
|
|
|
uint32_t hotspot_y;
|
2021-10-20 18:09:38 +00:00
|
|
|
uint32_t in_fence_fd;
|
2017-07-20 01:37:07 +00:00
|
|
|
};
|
|
|
|
|
2018-04-25 22:24:58 +00:00
|
|
|
bool get_drm_connector_props(int fd, uint32_t id,
|
2024-06-18 14:29:48 +00:00
|
|
|
struct wlr_drm_connector_props *out);
|
|
|
|
bool get_drm_crtc_props(int fd, uint32_t id, struct wlr_drm_crtc_props *out);
|
|
|
|
bool get_drm_plane_props(int fd, uint32_t id, struct wlr_drm_plane_props *out);
|
2017-07-20 01:37:07 +00:00
|
|
|
|
2018-04-25 22:24:58 +00:00
|
|
|
bool get_drm_prop(int fd, uint32_t obj, uint32_t prop, uint64_t *ret);
|
|
|
|
void *get_drm_prop_blob(int fd, uint32_t obj, uint32_t prop, size_t *ret_len);
|
2021-01-12 23:33:19 +00:00
|
|
|
char *get_drm_prop_enum(int fd, uint32_t obj, uint32_t prop);
|
2017-07-20 08:51:59 +00:00
|
|
|
|
2022-06-07 13:03:39 +00:00
|
|
|
bool introspect_drm_prop_range(int fd, uint32_t prop_id,
|
|
|
|
uint64_t *min, uint64_t *max);
|
|
|
|
|
2017-07-20 01:37:07 +00:00
|
|
|
#endif
|