Skip to content
Commit 7724c5ea authored by Leandro Ribeiro's avatar Leandro Ribeiro Committed by Daniel Stone
Browse files

clients/simple-dmabuf-feedback: do not use buffer before compositor's response



This fixes an issue when running simple-dmabuf-feedback:
"wl_display@1: error 1: invalid arguments for wl_surface@3.attach".

As we are not using create_immed request from zwp_linux_dmabuf_v1, we
can't start to use a dma-buf buffer before we process compositor's event
telling us that the creation succeeded.

This was causing problems in the following scenario:

1. buffer is marked to be recreated (because of dma-buf feedback);
2. in buffer_release() event, we destroy the buffer and recreate it;
3. after we recreate it, roundtrip is not called, as we don't want to
   block during the drawing loop;
4. buffer status is not being properly tracked, so we are trying to
   use a buffer before receiving the event from the compositor telling
   us that the creation succeeded.

To fix this, this patch improves buffer status tracking. Now we only
pick a buffer in the drawing loop when it is available. Also, if we have
no buffers available we perform a roundtrip and try again, as we may
have recreated all of them but still didn't have the chance to process
compositor's events telling us that creation succeeded.

Signed-off-by: default avatarLeandro Ribeiro <leandro.ribeiro@collabora.com>
parent 509398dc
Loading
Loading
Loading
Pipeline #570671 passed with stages
in 2 minutes and 11 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment