diff options
-rw-r--r-- | backend/drm/drm.c | 5 | ||||
-rw-r--r-- | include/wlr/backend/drm.h | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index d2a4f074..cc887a14 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -907,6 +907,11 @@ struct wlr_output_mode *wlr_drm_connector_add_mode(struct wlr_output *output, return &mode->wlr_mode; } +const drmModeModeInfo *wlr_drm_mode_get_info(struct wlr_output_mode *wlr_mode) { + const struct wlr_drm_mode *mode = wl_container_of(wlr_mode, mode, wlr_mode); + return &mode->drm_mode; +} + static bool drm_connector_set_cursor(struct wlr_output *output, struct wlr_buffer *buffer, int hotspot_x, int hotspot_y) { struct wlr_drm_connector *conn = get_drm_connector_from_output(output); diff --git a/include/wlr/backend/drm.h b/include/wlr/backend/drm.h index 414d90c0..e4fdf65d 100644 --- a/include/wlr/backend/drm.h +++ b/include/wlr/backend/drm.h @@ -79,6 +79,13 @@ struct wlr_output_mode *wlr_drm_connector_add_mode(struct wlr_output *output, const drmModeModeInfo *mode); /** + * Get the raw DRM mode information from a struct wlr_output_mode. + * + * The mode passed in must belong to a DRM output. + */ +const drmModeModeInfo *wlr_drm_mode_get_info(struct wlr_output_mode *mode); + +/** * Get the connector's panel orientation. * * On some devices the panel is mounted in the casing in such a way that the |