[Mesa-dev] [PATCH] mesa/st: Fix piglit read-front with new drawable invalidation
Jakob Bornecrantz
wallbraker at gmail.com
Thu Jul 7 06:20:19 PDT 2011
On Thu, Jul 7, 2011 at 3:08 PM, Thomas Hellstrom <thellstrom at vmware.com> wrote:
> When the state tracker adds a front buffer, nothing triggers a validate
> drawable call, since the state tracker manager is never notified.
>
> Force a validate drawable call by invalidating the framebuffer's stamp, so
> that the window system's renderbuffer (if any) is picked up.
>
> This fixes bug 38988
> https://bugs.freedesktop.org/show_bug.cgi?id=38988
>
> Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> ---
> src/mesa/state_tracker/st_manager.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
> index a8c4b5c..d04db8b 100644
> --- a/src/mesa/state_tracker/st_manager.c
> +++ b/src/mesa/state_tracker/st_manager.c
> @@ -196,7 +196,7 @@ st_framebuffer_validate(struct st_framebuffer *stfb,
>
> stfb->iface_stamp = new_stamp;
> new_stamp = p_atomic_read(&stfb->iface->stamp);
> - } while(stfb->iface_stamp != new_stamp);
> + } while(0);
Is this supposed to be here?
>
> width = stfb->Base.Width;
> height = stfb->Base.Height;
> @@ -918,6 +918,15 @@ st_manager_add_color_renderbuffer(struct st_context *st,
> return FALSE;
>
> st_framebuffer_update_attachments(stfb);
> +
> + /*
> + * Force a call to the state tracker manager to validate the
> + * new renderbuffer. It might be that there is a window system
> + * renderbuffer available.
> + */
> + if(stfb->iface)
> + stfb->iface_stamp = p_atomic_read(&stfb->iface_stamp) - 1;
> +
I have a slight concern that if we in the future change how stamp is changed
in st/dri and we have made assumptions like this in the code things might
break randomly. But this is fine for now, please commit.
Cheers Jakob.
More information about the mesa-dev
mailing list