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>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* These types contain the property ids for several DRM objects.
|
2017-07-20 08:51:59 +00:00
|
|
|
* See https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html#kms-properties
|
2017-07-20 01:37:07 +00:00
|
|
|
* 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 {
|
2018-05-03 20:59:43 +00:00
|
|
|
// Neither of these are guaranteed to exist
|
2017-07-20 01:37:07 +00:00
|
|
|
uint32_t rotation;
|
|
|
|
uint32_t scaling_mode;
|
2017-08-09 08:43:01 +00:00
|
|
|
|
|
|
|
// atomic-modesetting only
|
|
|
|
|
|
|
|
uint32_t active;
|
|
|
|
uint32_t mode_id;
|
2018-02-01 19:27:35 +00:00
|
|
|
uint32_t gamma_lut;
|
2018-02-04 20:03:44 +00:00
|
|
|
uint32_t gamma_lut_size;
|
2017-07-20 01:37:07 +00:00
|
|
|
};
|
2018-02-04 20:03:44 +00:00
|
|
|
uint32_t props[6];
|
2017-07-20 01:37:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
union wlr_drm_plane_props {
|
|
|
|
struct {
|
|
|
|
uint32_t type;
|
2018-05-03 20:59:43 +00:00
|
|
|
uint32_t rotation; // Not guaranteed to exist
|
2017-07-20 01:37:07 +00: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;
|
|
|
|
};
|
|
|
|
uint32_t props[12];
|
|
|
|
};
|
|
|
|
|
2018-04-25 22:24:58 +00:00
|
|
|
bool get_drm_connector_props(int fd, uint32_t id,
|
2018-04-21 10:42:18 +00:00
|
|
|
union wlr_drm_connector_props *out);
|
2018-04-25 22:24:58 +00: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 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);
|
2017-07-20 08:51:59 +00:00
|
|
|
|
2017-07-20 01:37:07 +00:00
|
|
|
#endif
|