drm backend: detect non-desktop outputs

This commit is contained in:
Drew DeVault 2019-06-27 15:12:35 -04:00
parent 481fbbca58
commit 05ed202183
4 changed files with 13 additions and 2 deletions

View File

@ -1206,8 +1206,8 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
drm->display); drm->display);
struct wl_event_loop *ev = wl_display_get_event_loop(drm->display); struct wl_event_loop *ev = wl_display_get_event_loop(drm->display);
wlr_conn->retry_pageflip = wl_event_loop_add_timer(ev, retry_pageflip, wlr_conn->retry_pageflip = wl_event_loop_add_timer(
wlr_conn); ev, retry_pageflip, wlr_conn);
wlr_conn->state = WLR_DRM_CONN_DISCONNECTED; wlr_conn->state = WLR_DRM_CONN_DISCONNECTED;
wlr_conn->id = drm_conn->connector_id; wlr_conn->id = drm_conn->connector_id;
@ -1269,6 +1269,12 @@ void scan_drm_connectors(struct wlr_drm_backend *drm) {
get_drm_connector_props(drm->fd, wlr_conn->id, &wlr_conn->props); get_drm_connector_props(drm->fd, wlr_conn->id, &wlr_conn->props);
uint64_t non_desktop;
if (get_drm_prop(drm->fd, wlr_conn->id,
wlr_conn->props.non_desktop, &non_desktop)) {
wlr_conn->output.non_desktop = non_desktop;
}
size_t edid_len = 0; size_t edid_len = 0;
uint8_t *edid = get_drm_prop_blob(drm->fd, uint8_t *edid = get_drm_prop_blob(drm->fd,
wlr_conn->id, wlr_conn->props.edid, &edid_len); wlr_conn->id, wlr_conn->props.edid, &edid_len);

View File

@ -24,6 +24,7 @@ static const struct prop_info connector_info[] = {
{ "EDID", INDEX(edid) }, { "EDID", INDEX(edid) },
{ "PATH", INDEX(path) }, { "PATH", INDEX(path) },
{ "link-status", INDEX(link_status) }, { "link-status", INDEX(link_status) },
{ "non-desktop", INDEX(non_desktop) },
#undef INDEX #undef INDEX
}; };

View File

@ -16,6 +16,7 @@ union wlr_drm_connector_props {
uint32_t dpms; uint32_t dpms;
uint32_t link_status; // not guaranteed to exist uint32_t link_status; // not guaranteed to exist
uint32_t path; uint32_t path;
uint32_t non_desktop;
// atomic-modesetting only // atomic-modesetting only

View File

@ -112,6 +112,9 @@ struct wlr_output {
bool frame_pending; bool frame_pending;
float transform_matrix[9]; float transform_matrix[9];
// true, for example, with VR headsets
bool non_desktop;
struct wlr_output_state pending; struct wlr_output_state pending;
struct { struct {