aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/legacy.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-12-18 16:24:36 +0100
committerSimon Ser <contact@emersion.fr>2021-01-10 11:24:44 +0100
commitc94728b53ade17d152ba1f600475140660db7a75 (patch)
treeafe3bbf109603ff26534574cfd1fe06acdcd7986 /backend/drm/legacy.c
parentd9bbc416a62c2d280e6921da6b25128a1b3a9e22 (diff)
backend/drm: stop using surface size for BO
Stop using wlr_drm_surface.{width,height} to figure out the size of a gbm_bo. In the future we'll stop using wlr_drm_plane.surf, so these will be zero. Instead, rely on gbm_bo_get_{width,height}.
Diffstat (limited to 'backend/drm/legacy.c')
-rw-r--r--backend/drm/legacy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/drm/legacy.c b/backend/drm/legacy.c
index accb18ff..da2e0d9f 100644
--- a/backend/drm/legacy.c
+++ b/backend/drm/legacy.c
@@ -81,9 +81,11 @@ static bool legacy_crtc_commit(struct wlr_drm_backend *drm,
return false;
}
- if (drmModeSetCursor(drm->fd, crtc->id,
- gbm_bo_get_handle(cursor_fb->bo).u32,
- cursor->surf.width, cursor->surf.height)) {
+ uint32_t cursor_handle = gbm_bo_get_handle(cursor_fb->bo).u32;
+ uint32_t cursor_width = gbm_bo_get_width(cursor_fb->bo);
+ uint32_t cursor_height = gbm_bo_get_height(cursor_fb->bo);
+ if (drmModeSetCursor(drm->fd, crtc->id, cursor_handle,
+ cursor_width, cursor_height)) {
wlr_drm_conn_log_errno(conn, WLR_DEBUG, "drmModeSetCursor failed");
return false;
}