diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-06-14 16:17:05 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-06-14 16:17:05 -0400 |
commit | e65f83d7f2f29f54b0cae27807e3b6a9b2299a10 (patch) | |
tree | 1e09a3e32427167b2b690548b2d07bb34ee9f69e /backend | |
parent | 3f24f8a1bee10fb3aadf8c57ca107fe5aaa7cffa (diff) |
Add more DRM info to wlr_output
Yes I know this is the libinput branch, I thought this would be useful
for a libinput feature (but it wasn't)
Diffstat (limited to 'backend')
-rw-r--r-- | backend/drm/drm.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index d6a3f8a2..225035b7 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -457,6 +457,31 @@ void wlr_drm_scan_connectors(struct wlr_backend_state *state) { snprintf(wlr_output->name, sizeof(wlr_output->name), "%s-%"PRIu32, conn_name[conn->connector_type], conn->connector_type_id); + wlr_output->phys_width = conn->mmWidth; + wlr_output->phys_height = conn->mmHeight; + switch (conn->subpixel) { + case DRM_MODE_SUBPIXEL_UNKNOWN: + wlr_output->subpixel = WL_OUTPUT_SUBPIXEL_UNKNOWN; + break; + case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB: + wlr_output->subpixel = WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB; + break; + case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR: + wlr_output->subpixel = WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR; + break; + case DRM_MODE_SUBPIXEL_VERTICAL_RGB: + wlr_output->subpixel = WL_OUTPUT_SUBPIXEL_VERTICAL_RGB; + break; + case DRM_MODE_SUBPIXEL_VERTICAL_BGR: + wlr_output->subpixel = WL_OUTPUT_SUBPIXEL_VERTICAL_BGR; + break; + case DRM_MODE_SUBPIXEL_NONE: + default: + wlr_output->subpixel = WL_OUTPUT_SUBPIXEL_NONE; + break; + } + strcpy(wlr_output->make, "drm"); + strcpy(wlr_output->model, "unknown"); drmModeEncoder *curr_enc = drmModeGetEncoder(state->fd, conn->encoder_id); if (curr_enc) { |