/* Used by gbm fbs */
struct gbm_bo *bo;
+ struct gbm_surface *gbm_surface;
/* Used by dumb fbs */
void *map;
}
static void
-drm_output_release_fb(struct drm_output *output, struct drm_fb *fb)
+drm_fb_unref(struct drm_fb *fb)
{
if (!fb)
return;
gbm_bo_destroy(fb->bo);
break;
case BUFFER_GBM_SURFACE:
- gbm_surface_release_buffer(output->gbm_surface, fb->bo);
+ gbm_surface_release_buffer(fb->gbm_surface, fb->bo);
break;
default:
assert(NULL);
gbm_surface_release_buffer(output->gbm_surface, bo);
return;
}
+ output->next->gbm_surface = output->gbm_surface;
}
static void
err_pageflip:
output->cursor_view = NULL;
if (output->next) {
- drm_output_release_fb(output, output->next);
+ drm_fb_unref(output->next);
output->next = NULL;
}
drm_output_update_msc(output, frame);
output->vblank_pending = 0;
- drm_output_release_fb(output, s->current);
+ drm_fb_unref(s->current);
s->current = s->next;
s->next = NULL;
* we just want to page flip to the current buffer to get an accurate
* timestamp */
if (output->page_flip_pending) {
- drm_output_release_fb(output, output->current);
+ drm_fb_unref(output->current);
output->current = output->next;
output->next = NULL;
}
WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
/* reset rendering stuff. */
- drm_output_release_fb(output, output->current);
- drm_output_release_fb(output, output->next);
+ drm_fb_unref(output->current);
+ drm_fb_unref(output->next);
output->current = output->next = NULL;
if (b->use_pixman) {
sprite->plane_id,
output->crtc_id, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0);
- drm_output_release_fb(output, sprite->current);
- drm_output_release_fb(output, sprite->next);
+ drm_fb_unref(sprite->current);
+ drm_fb_unref(sprite->next);
weston_plane_release(&sprite->plane);
free(sprite);
}