backend/drm: add drm_fb_copy()

Similar to drm_fb_move(), but leaves old as-is.
This commit is contained in:
Simon Ser 2024-02-28 14:05:20 +01:00
parent 1a54d33e77
commit f6659414ba
3 changed files with 9 additions and 4 deletions

View file

@ -249,3 +249,10 @@ void drm_fb_move(struct wlr_drm_fb **new, struct wlr_drm_fb **old) {
*new = *old;
*old = NULL;
}
void drm_fb_copy(struct wlr_drm_fb **new, struct wlr_drm_fb *old) {
drm_fb_clear(new);
if (old != NULL) {
*new = drm_fb_lock(old);
}
}