From ef9768858e5befde26db2cc4fec26a5e5bd0fe22 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 3 May 2017 22:40:19 +1200 Subject: Changed modesetting interface. --- include/backend/drm/drm.h | 11 +++-------- include/wlr/backend/drm.h | 12 +++++++++++- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 3373f024..daafc144 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -25,7 +25,6 @@ bool wlr_drm_renderer_init(struct wlr_drm_renderer *renderer, int fd); void wlr_drm_renderer_free(struct wlr_drm_renderer *renderer); enum wlr_drm_output_state { - DRM_OUTPUT_INVALID, DRM_OUTPUT_DISCONNECTED, DRM_OUTPUT_NEEDS_MODESET, DRM_OUTPUT_CONNECTED, @@ -37,8 +36,8 @@ struct wlr_drm_output { char name[16]; size_t num_modes; - drmModeModeInfo *modes; - drmModeModeInfo *active_mode; + struct wlr_drm_mode *modes; + struct wlr_drm_mode *active_mode; uint32_t width; uint32_t height; @@ -54,11 +53,7 @@ struct wlr_drm_output { bool cleanup; }; -bool wlr_drm_output_modeset(struct wlr_drm_output *out, const char *str); -void wlr_drm_output_free(struct wlr_drm_output *out, bool restore); - -void wlr_drm_output_begin(struct wlr_drm_output *out); -void wlr_drm_output_end(struct wlr_drm_output *out); +void wlr_drm_output_cleanup(struct wlr_drm_output *out, bool restore); void wlr_drm_scan_connectors(struct wlr_drm_backend *backend); int wlr_drm_event(int fd, uint32_t mask, void *data); diff --git a/include/wlr/backend/drm.h b/include/wlr/backend/drm.h index d56c7e77..c3df2409 100644 --- a/include/wlr/backend/drm.h +++ b/include/wlr/backend/drm.h @@ -3,16 +3,26 @@ #include #include +#include // drmModeModeInfo struct wlr_drm_backend; struct wlr_drm_output; +struct wlr_drm_mode { + uint16_t width; + uint16_t height; + uint32_t rate; + drmModeModeInfo mode; +}; + struct wlr_drm_backend *wlr_drm_backend_init(struct wl_display *display, struct wlr_session *session, struct wl_listener *add, struct wl_listener *rem, struct wl_listener *render); void wlr_drm_backend_free(struct wlr_drm_backend *backend); -bool wlr_drm_output_modeset(struct wlr_drm_output *out, const char *str); +struct wlr_drm_mode *wlr_drm_output_get_modes(struct wlr_drm_output *out, size_t *count); +bool wlr_drm_output_modeset(struct wlr_drm_output *out, struct wlr_drm_mode *mode); + void wlr_drm_output_begin(struct wlr_drm_output *out); void wlr_drm_output_end(struct wlr_drm_output *out); -- cgit v1.2.3