[PATCH weston 20/68] compositor-drm: Use refcounted FBs for Pixman

Pekka Paalanen ppaalanen at gmail.com
Wed Feb 22 13:31:10 UTC 2017


On Fri,  9 Dec 2016 19:57:35 +0000
Daniel Stone <daniels at collabora.com> wrote:

> When using the Pixman renderer, use drm_fb refcounting explicitly.
> 
> Differential Revision: https://phabricator.freedesktop.org/D1492
> 
> Signed-off-by: Daniel Stone <daniels at collabora.com>
> ---
>  libweston/compositor-drm.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
> index a684ac9..950c265 100644
> --- a/libweston/compositor-drm.c
> +++ b/libweston/compositor-drm.c
> @@ -491,7 +491,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);
> @@ -652,7 +652,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]);
>  
> @@ -1973,7 +1973,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]);
>  
> @@ -1993,8 +1993,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;
>  	}

Reviewed-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170222/62c5dfec/attachment.sig>


More information about the wayland-devel mailing list