mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
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}.
This commit is contained in:
parent
d9bbc416a6
commit
c94728b53a
2 changed files with 12 additions and 7 deletions
|
@ -139,13 +139,16 @@ static void set_plane_props(struct atomic *atom, struct wlr_drm_backend *drm,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32_t width = gbm_bo_get_width(fb->bo);
|
||||||
|
uint32_t height = gbm_bo_get_height(fb->bo);
|
||||||
|
|
||||||
// The src_* properties are in 16.16 fixed point
|
// The src_* properties are in 16.16 fixed point
|
||||||
atomic_add(atom, id, props->src_x, 0);
|
atomic_add(atom, id, props->src_x, 0);
|
||||||
atomic_add(atom, id, props->src_y, 0);
|
atomic_add(atom, id, props->src_y, 0);
|
||||||
atomic_add(atom, id, props->src_w, (uint64_t)plane->surf.width << 16);
|
atomic_add(atom, id, props->src_w, (uint64_t)width << 16);
|
||||||
atomic_add(atom, id, props->src_h, (uint64_t)plane->surf.height << 16);
|
atomic_add(atom, id, props->src_h, (uint64_t)height << 16);
|
||||||
atomic_add(atom, id, props->crtc_w, plane->surf.width);
|
atomic_add(atom, id, props->crtc_w, width);
|
||||||
atomic_add(atom, id, props->crtc_h, plane->surf.height);
|
atomic_add(atom, id, props->crtc_h, height);
|
||||||
atomic_add(atom, id, props->fb_id, fb->id);
|
atomic_add(atom, id, props->fb_id, fb->id);
|
||||||
atomic_add(atom, id, props->crtc_id, crtc_id);
|
atomic_add(atom, id, props->crtc_id, crtc_id);
|
||||||
atomic_add(atom, id, props->crtc_x, (uint64_t)x);
|
atomic_add(atom, id, props->crtc_x, (uint64_t)x);
|
||||||
|
|
|
@ -81,9 +81,11 @@ static bool legacy_crtc_commit(struct wlr_drm_backend *drm,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drmModeSetCursor(drm->fd, crtc->id,
|
uint32_t cursor_handle = gbm_bo_get_handle(cursor_fb->bo).u32;
|
||||||
gbm_bo_get_handle(cursor_fb->bo).u32,
|
uint32_t cursor_width = gbm_bo_get_width(cursor_fb->bo);
|
||||||
cursor->surf.width, cursor->surf.height)) {
|
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");
|
wlr_drm_conn_log_errno(conn, WLR_DEBUG, "drmModeSetCursor failed");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue