aboutsummaryrefslogtreecommitdiff
path: root/include/backend
diff options
context:
space:
mode:
authorScott Anderson <ascent12@hotmail.com>2017-08-09 20:43:01 +1200
committerDrew DeVault <sir@cmpwn.com>2017-08-09 08:07:00 -0400
commitaf67966d9261178bebc7a3019881fc1576d311e3 (patch)
tree540544f1afc99d2447d822f1de211c424e45527f /include/backend
parent913829e381ff59a120770449ccebcaaeb8a487c1 (diff)
Atomic modesetting
Diffstat (limited to 'include/backend')
-rw-r--r--include/backend/drm-properties.h7
-rw-r--r--include/backend/drm-util.h2
-rw-r--r--include/backend/drm.h23
3 files changed, 30 insertions, 2 deletions
diff --git a/include/backend/drm-properties.h b/include/backend/drm-properties.h
index 287fc1e0..7a061dd3 100644
--- a/include/backend/drm-properties.h
+++ b/include/backend/drm-properties.h
@@ -27,8 +27,13 @@ union wlr_drm_crtc_props {
// Neither of these are guranteed to exist
uint32_t rotation;
uint32_t scaling_mode;
+
+ // atomic-modesetting only
+
+ uint32_t active;
+ uint32_t mode_id;
};
- uint32_t props[2];
+ uint32_t props[4];
};
union wlr_drm_plane_props {
diff --git a/include/backend/drm-util.h b/include/backend/drm-util.h
index 759bdb48..9abee6ea 100644
--- a/include/backend/drm-util.h
+++ b/include/backend/drm-util.h
@@ -12,6 +12,8 @@ int32_t calculate_refresh_rate(drmModeModeInfo *mode);
void parse_edid(struct wlr_output *restrict output, size_t len, const uint8_t *data);
// Returns the string representation of a DRM output type
const char *conn_get_name(uint32_t type_id);
+// Returns the DRM framebuffer id for a gbm_bo
+uint32_t get_fb_for_bo(struct gbm_bo *bo);
// Part of match_obj
enum {
diff --git a/include/backend/drm.h b/include/backend/drm.h
index aaa823f6..2f724524 100644
--- a/include/backend/drm.h
+++ b/include/backend/drm.h
@@ -43,6 +43,9 @@ struct wlr_drm_plane {
struct wlr_drm_crtc {
uint32_t id;
+ uint32_t mode_id; // atomic modesetting only
+ drmModeAtomicReq *atomic;
+
union {
struct {
struct wlr_drm_plane *overlay;
@@ -76,8 +79,11 @@ struct wlr_drm_renderer {
bool wlr_drm_renderer_init(struct wlr_drm_renderer *renderer, int fd);
void wlr_drm_renderer_free(struct wlr_drm_renderer *renderer);
+struct wlr_drm_interface;
+
struct wlr_backend_state {
struct wlr_backend *base;
+ const struct wlr_drm_interface *iface;
int fd;
dev_t dev;
@@ -150,6 +156,22 @@ struct wlr_output_state {
bool pageflip_pending;
};
+// Used to provide atomic or legacy DRM functions
+struct wlr_drm_interface {
+ // Enable or disable DPMS for output
+ void (*conn_enable)(struct wlr_backend_state *drm, struct wlr_output_state *output,
+ bool enable);
+ // Pageflip on crtc. If mode is non-NULL perform a full modeset using it.
+ bool (*crtc_pageflip)(struct wlr_backend_state *drm, struct wlr_output_state *output,
+ struct wlr_drm_crtc *crtc, uint32_t fb_id, drmModeModeInfo *mode);
+ // Enable the cursor buffer on crtc. Set bo to NULL to disable
+ bool (*crtc_set_cursor)(struct wlr_backend_state *drm, struct wlr_drm_crtc *crtc,
+ struct gbm_bo *bo);
+ // Move the cursor on crtc
+ bool (*crtc_move_cursor)(struct wlr_backend_state *drm, struct wlr_drm_crtc *crtc,
+ int x, int y);
+};
+
bool wlr_drm_check_features(struct wlr_backend_state *drm);
bool wlr_drm_resources_init(struct wlr_backend_state *drm);
void wlr_drm_resources_free(struct wlr_backend_state *drm);
@@ -159,6 +181,5 @@ void wlr_drm_scan_connectors(struct wlr_backend_state *state);
int wlr_drm_event(int fd, uint32_t mask, void *data);
void wlr_drm_output_start_renderer(struct wlr_output_state *output);
-bool wlr_drm_crtc_set_cursor(struct wlr_backend_state *drm, struct wlr_drm_crtc *crtc);
#endif