mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-16 08:56:26 -05:00
backend/drm: add support for the link-status property
This commit is contained in:
parent
43af104fa3
commit
f5a147b739
4 changed files with 34 additions and 7 deletions
|
|
@ -19,9 +19,10 @@ struct prop_info {
|
|||
|
||||
static const struct prop_info connector_info[] = {
|
||||
#define INDEX(name) (offsetof(union wlr_drm_connector_props, name) / sizeof(uint32_t))
|
||||
{ "CRTC_ID", INDEX(crtc_id) },
|
||||
{ "DPMS", INDEX(dpms) },
|
||||
{ "EDID", INDEX(edid) },
|
||||
{ "CRTC_ID", INDEX(crtc_id) },
|
||||
{ "DPMS", INDEX(dpms) },
|
||||
{ "EDID", INDEX(edid) },
|
||||
{ "link-status", INDEX(link_status) },
|
||||
#undef INDEX
|
||||
};
|
||||
|
||||
|
|
@ -87,7 +88,8 @@ static bool scan_properties(int fd, uint32_t id, uint32_t type, uint32_t *result
|
|||
return true;
|
||||
}
|
||||
|
||||
bool get_drm_connector_props(int fd, uint32_t id, union wlr_drm_connector_props *out) {
|
||||
bool get_drm_connector_props(int fd, uint32_t id,
|
||||
union wlr_drm_connector_props *out) {
|
||||
return scan_properties(fd, id, DRM_MODE_OBJECT_CONNECTOR, out->props,
|
||||
connector_info, sizeof(connector_info) / sizeof(connector_info[0]));
|
||||
}
|
||||
|
|
@ -103,7 +105,8 @@ bool get_drm_plane_props(int fd, uint32_t id, union wlr_drm_plane_props *out) {
|
|||
}
|
||||
|
||||
bool get_drm_prop(int fd, uint32_t obj, uint32_t prop, uint64_t *ret) {
|
||||
drmModeObjectProperties *props = drmModeObjectGetProperties(fd, obj, DRM_MODE_OBJECT_ANY);
|
||||
drmModeObjectProperties *props =
|
||||
drmModeObjectGetProperties(fd, obj, DRM_MODE_OBJECT_ANY);
|
||||
if (!props) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue