[PATCH] Do not release buffer when it is going to be used again.
Ander Conselvan de Oliveira
conselvan2 at gmail.com
Thu Nov 7 02:01:57 PST 2013
Em 06-11-2013 21:47, Axel Davy escreveu:
> Solve a bug for some fullscreen clients which wouldn't show up.
>
> Signed-off-by: Axel Davy <axel.davy at ens.fr>
> ---
> src/compositor-drm.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index 4f015d1..6a2500b 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -711,7 +711,8 @@ vblank_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec,
>
> output->vblank_pending = 0;
>
> - drm_output_release_fb(output, s->current);
> + if (s->current != s->next)
> + drm_output_release_fb(output, s->current);
> s->current = s->next;
> s->next = NULL;
>
> @@ -735,7 +736,8 @@ page_flip_handler(int fd, unsigned int frame,
> * 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);
> + if (output->current != output->next)
> + drm_output_release_fb(output, output->current);
We shouldn't have current equals to next in the first place. This can
happen when the repaint loop starts, but that's what the 'if
(output->page_flip_pending)' is for. In any other case, that implies we
are rendering to the front buffer.
Ander
> output->current = output->next;
> output->next = NULL;
> }
>
More information about the wayland-devel
mailing list