aboutsummaryrefslogtreecommitdiff
path: root/include/backend/drm/drm.h
diff options
context:
space:
mode:
authorScott Anderson <scott@anderso.nz>2020-02-08 19:02:31 +1300
committerSimon Ser <contact@emersion.fr>2020-04-28 09:54:52 +0200
commit8da9d9679e4cad640b0f0a518ca1529c8cdecbe0 (patch)
treea29446d46d0b537687e8181e3cfe5a40621a1b31 /include/backend/drm/drm.h
parentfa5d709fc3ea96b14163cdad435caccdbdd5bbda (diff)
backend/drm: introduce wlr_drm_fb
This is a type which manages gbm_surfaces and imported dmabufs in the same place, and makes the lifetime management between the two shared. It should lead to easier to understand code, and fewer special cases. This also contains a fair bit of refactoring to start using this new type. Co-authored-by: Simon Ser <contact@emersion.fr>
Diffstat (limited to 'include/backend/drm/drm.h')
-rw-r--r--include/backend/drm/drm.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h
index ffd3138f..0ab4ff21 100644
--- a/include/backend/drm/drm.h
+++ b/include/backend/drm/drm.h
@@ -25,11 +25,17 @@ struct wlr_drm_plane {
struct wlr_drm_surface surf;
struct wlr_drm_surface mgpu_surf;
+ /* Buffer to be submitted to the kernel on the next page-flip */
+ struct wlr_drm_fb pending_fb;
+ /* Buffer submitted to the kernel, will be presented on next vblank */
+ struct wlr_drm_fb queued_fb;
+ /* Buffer currently displayed on screen */
+ struct wlr_drm_fb current_fb;
+
uint32_t drm_format; // ARGB8888 or XRGB8888
struct wlr_drm_format_set formats;
// Only used by cursor
- float matrix[9];
bool cursor_enabled;
int32_t cursor_hotspot_x, cursor_hotspot_y;
@@ -124,16 +130,16 @@ struct wlr_drm_connector {
drmModeCrtc *old_crtc;
- bool pageflip_pending;
struct wl_event_source *retry_pageflip;
struct wl_list link;
- // Buffer submitted to the kernel but not yet displayed
- struct wlr_buffer *pending_buffer;
- struct gbm_bo *pending_bo;
- // Buffer currently being displayed
- struct wlr_buffer *current_buffer;
- struct gbm_bo *current_bo;
+ /*
+ * We've asked for a state change in the kernel, and yet to recieve a
+ * notification for its completion. Currently, the kernel only has a
+ * queue length of 1, and no way to modify your submissions after
+ * they're sent.
+ */
+ bool pageflip_pending;
};
struct wlr_drm_backend *get_drm_backend_from_backend(
@@ -150,6 +156,8 @@ bool set_drm_connector_gamma(struct wlr_output *output, size_t size,
bool drm_connector_set_mode(struct wlr_output *output,
struct wlr_output_mode *mode);
+struct wlr_drm_fb *plane_get_next_fb(struct wlr_drm_plane *plane);
+
bool legacy_crtc_set_cursor(struct wlr_drm_backend *drm,
struct wlr_drm_crtc *crtc, struct gbm_bo *bo);
bool legacy_crtc_move_cursor(struct wlr_drm_backend *drm,