|
|
@ -19,7 +19,7 @@ struct prop_info {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const struct prop_info connector_info[] = {
|
|
|
|
static const struct prop_info connector_info[] = {
|
|
|
|
#define INDEX(name) (offsetof(union wlr_drm_connector_props, name) / sizeof(uint32_t))
|
|
|
|
#define INDEX(name) (offsetof(struct wlr_drm_connector_props, name) / sizeof(uint32_t))
|
|
|
|
{ "CRTC_ID", INDEX(crtc_id) },
|
|
|
|
{ "CRTC_ID", INDEX(crtc_id) },
|
|
|
|
{ "DPMS", INDEX(dpms) },
|
|
|
|
{ "DPMS", INDEX(dpms) },
|
|
|
|
{ "EDID", INDEX(edid) },
|
|
|
|
{ "EDID", INDEX(edid) },
|
|
|
@ -35,7 +35,7 @@ static const struct prop_info connector_info[] = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const struct prop_info crtc_info[] = {
|
|
|
|
static const struct prop_info crtc_info[] = {
|
|
|
|
#define INDEX(name) (offsetof(union wlr_drm_crtc_props, name) / sizeof(uint32_t))
|
|
|
|
#define INDEX(name) (offsetof(struct wlr_drm_crtc_props, name) / sizeof(uint32_t))
|
|
|
|
{ "ACTIVE", INDEX(active) },
|
|
|
|
{ "ACTIVE", INDEX(active) },
|
|
|
|
{ "GAMMA_LUT", INDEX(gamma_lut) },
|
|
|
|
{ "GAMMA_LUT", INDEX(gamma_lut) },
|
|
|
|
{ "GAMMA_LUT_SIZE", INDEX(gamma_lut_size) },
|
|
|
|
{ "GAMMA_LUT_SIZE", INDEX(gamma_lut_size) },
|
|
|
@ -45,7 +45,7 @@ static const struct prop_info crtc_info[] = {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static const struct prop_info plane_info[] = {
|
|
|
|
static const struct prop_info plane_info[] = {
|
|
|
|
#define INDEX(name) (offsetof(union wlr_drm_plane_props, name) / sizeof(uint32_t))
|
|
|
|
#define INDEX(name) (offsetof(struct wlr_drm_plane_props, name) / sizeof(uint32_t))
|
|
|
|
{ "CRTC_H", INDEX(crtc_h) },
|
|
|
|
{ "CRTC_H", INDEX(crtc_h) },
|
|
|
|
{ "CRTC_ID", INDEX(crtc_id) },
|
|
|
|
{ "CRTC_ID", INDEX(crtc_id) },
|
|
|
|
{ "CRTC_W", INDEX(crtc_w) },
|
|
|
|
{ "CRTC_W", INDEX(crtc_w) },
|
|
|
@ -100,19 +100,18 @@ static bool scan_properties(int fd, uint32_t id, uint32_t type, uint32_t *result
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool get_drm_connector_props(int fd, uint32_t id,
|
|
|
|
bool get_drm_connector_props(int fd, uint32_t id, struct wlr_drm_connector_props *out) {
|
|
|
|
union wlr_drm_connector_props *out) {
|
|
|
|
return scan_properties(fd, id, DRM_MODE_OBJECT_CONNECTOR, (uint32_t *)out,
|
|
|
|
return scan_properties(fd, id, DRM_MODE_OBJECT_CONNECTOR, out->props,
|
|
|
|
|
|
|
|
connector_info, sizeof(connector_info) / sizeof(connector_info[0]));
|
|
|
|
connector_info, sizeof(connector_info) / sizeof(connector_info[0]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool get_drm_crtc_props(int fd, uint32_t id, union wlr_drm_crtc_props *out) {
|
|
|
|
bool get_drm_crtc_props(int fd, uint32_t id, struct wlr_drm_crtc_props *out) {
|
|
|
|
return scan_properties(fd, id, DRM_MODE_OBJECT_CRTC, out->props,
|
|
|
|
return scan_properties(fd, id, DRM_MODE_OBJECT_CRTC, (uint32_t *)out,
|
|
|
|
crtc_info, sizeof(crtc_info) / sizeof(crtc_info[0]));
|
|
|
|
crtc_info, sizeof(crtc_info) / sizeof(crtc_info[0]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool get_drm_plane_props(int fd, uint32_t id, union wlr_drm_plane_props *out) {
|
|
|
|
bool get_drm_plane_props(int fd, uint32_t id, struct wlr_drm_plane_props *out) {
|
|
|
|
return scan_properties(fd, id, DRM_MODE_OBJECT_PLANE, out->props,
|
|
|
|
return scan_properties(fd, id, DRM_MODE_OBJECT_PLANE, (uint32_t *)out,
|
|
|
|
plane_info, sizeof(plane_info) / sizeof(plane_info[0]));
|
|
|
|
plane_info, sizeof(plane_info) / sizeof(plane_info[0]));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|