summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2016-11-01 23:28:04 +0000
committerDaniel Stone <daniels@collabora.com>2017-02-07 19:16:31 +0000
commitb445bfaed63fa2d1d34d7d11faa679b31df43aa7 (patch)
tree5a82f9af02bdb802f5f73a081f54ae9c9fd12902
parentb43778f112e09f6cdfd4f4a3f7840bfa420d4f2d (diff)
compositor-drm: Use refcounted FBs for Pixman
When using the Pixman renderer, use drm_fb refcounting explicitly. Differential Revision: https://phabricator.freedesktop.org/D1492 Signed-off-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--libweston/compositor-drm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 3e589ad2..473cb6f5 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -490,7 +490,7 @@ drm_fb_unref(struct drm_fb *fb)
switch (fb->type) {
case BUFFER_PIXMAN_DUMB:
- /* nothing: pixman buffers are destroyed manually */
+ drm_fb_destroy_dumb(fb);
break;
case BUFFER_CLIENT:
gbm_bo_destroy(fb->bo);
@@ -651,7 +651,7 @@ drm_output_render_pixman(struct drm_output *output, pixman_region32_t *damage)
output->current_image ^= 1;
- output->next = output->dumb[output->current_image];
+ output->next = drm_fb_ref(output->dumb[output->current_image]);
pixman_renderer_output_set_buffer(&output->base,
output->image[output->current_image]);
@@ -1979,7 +1979,7 @@ drm_output_init_pixman(struct drm_output *output, struct drm_backend *b)
err:
for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) {
if (output->dumb[i])
- drm_fb_destroy_dumb(output->dumb[i]);
+ drm_fb_unref(output->dumb[i]);
if (output->image[i])
pixman_image_unref(output->image[i]);
@@ -1999,8 +1999,8 @@ drm_output_fini_pixman(struct drm_output *output)
pixman_region32_fini(&output->previous_damage);
for (i = 0; i < ARRAY_LENGTH(output->dumb); i++) {
- drm_fb_destroy_dumb(output->dumb[i]);
pixman_image_unref(output->image[i]);
+ drm_fb_unref(output->dumb[i]);
output->dumb[i] = NULL;
output->image[i] = NULL;
}