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