From 7e038a6110501a51e7f3d3366e8bc54a02766f22 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 16 Jun 2017 15:38:34 -0400 Subject: Add (broken) DRM hardware cursors --- include/backend/drm.h | 8 +++++--- include/types.h | 3 +++ include/wlr/types.h | 3 +++ 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/backend/drm.h b/include/backend/drm.h index e001186d..10850d1f 100644 --- a/include/backend/drm.h +++ b/include/backend/drm.h @@ -73,10 +73,12 @@ struct wlr_output_state { drmModeCrtc *old_crtc; struct wlr_drm_renderer *renderer; - struct gbm_surface *gbm; - struct gbm_bo *bo_last; - struct gbm_bo *bo_current; EGLSurface *egl; + struct gbm_surface *gbm; + struct gbm_bo *bo[2]; + struct gbm_bo *cursor_bo[2]; + int current_cursor; + uint32_t cursor_width, cursor_height; bool pageflip_pending; bool cleanup; diff --git a/include/types.h b/include/types.h index efead03c..e2930a9f 100644 --- a/include/types.h +++ b/include/types.h @@ -11,6 +11,9 @@ struct wlr_output_impl { struct wlr_output_mode *mode); void (*transform)(struct wlr_output_state *state, enum wl_output_transform transform); + bool (*set_cursor)(struct wlr_output_state *state, + const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height); + bool (*move_cursor)(struct wlr_output_state *state, int x, int y); void (*destroy)(struct wlr_output_state *state); }; diff --git a/include/wlr/types.h b/include/wlr/types.h index aae76f06..3afc361e 100644 --- a/include/wlr/types.h +++ b/include/wlr/types.h @@ -46,6 +46,9 @@ bool wlr_output_set_mode(struct wlr_output *output, struct wlr_output_mode *mode); void wlr_output_transform(struct wlr_output *output, enum wl_output_transform transform); +bool wlr_output_set_cursor(struct wlr_output *output, + const uint8_t *buf, int32_t stride, uint32_t width, uint32_t height); +bool wlr_output_move_cursor(struct wlr_output *output, int x, int y); void wlr_output_destroy(struct wlr_output *output); void wlr_output_effective_resolution(struct wlr_output *output, int *width, int *height); -- cgit v1.2.3