[Mesa-dev] [PATCH] st/egl: flush resources before presentation

Marek Olšák maraeo at gmail.com
Tue Oct 1 12:38:59 PDT 2013


Thanks, I'll commit this.

BTW, I don't like that st/egl re-implements what st/dri does. It's
code duplication and this dri2 backend should be killed with fire and
st/dri should be used instead (with all the necessary modifications to
support non-GL state trackers).

Marek

On Tue, Oct 1, 2013 at 8:02 PM, Grigori Goronzy <greg at chown.ath.cx> wrote:
> Fixes regression on r600g due to fast clear introduced by commit
> edbbfac6.
> ---
>  src/gallium/state_trackers/egl/x11/native_dri2.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c
> index 3aa7c17..3c58979 100644
> --- a/src/gallium/state_trackers/egl/x11/native_dri2.c
> +++ b/src/gallium/state_trackers/egl/x11/native_dri2.c
> @@ -290,6 +290,12 @@ dri2_surface_flush_frontbuffer(struct native_surface *nsurf)
>  {
>     struct dri2_surface *dri2surf = dri2_surface(nsurf);
>     struct dri2_display *dri2dpy = dri2surf->dri2dpy;
> +   struct native_display *ndpy = &dri2dpy->base;
> +   struct pipe_context *pipe = ndpy_get_copy_context(ndpy);
> +
> +   /* flush buffer */
> +   pipe->flush_resource(pipe, dri2surf->textures[NATIVE_ATTACHMENT_FRONT_LEFT]);
> +   pipe->flush(pipe, NULL, 0);
>
>     /* copy to real front buffer */
>     if (dri2surf->have_fake)
> @@ -313,9 +319,14 @@ dri2_surface_swap_buffers(struct native_surface *nsurf, int num_rects,
>  {
>     struct dri2_surface *dri2surf = dri2_surface(nsurf);
>     struct dri2_display *dri2dpy = dri2surf->dri2dpy;
> +   struct native_display *ndpy = &dri2dpy->base;
> +   struct pipe_context *pipe = ndpy_get_copy_context(ndpy);
>
>     /* copy to front buffer */
>     if (dri2surf->have_back) {
> +      pipe->flush_resource(pipe, dri2surf->textures[NATIVE_ATTACHMENT_BACK_LEFT]);
> +      pipe->flush(pipe, NULL, 0);
> +
>        if (num_rects > 0)
>           x11_drawable_copy_buffers_region(dri2dpy->xscr, dri2surf->drawable,
>                 num_rects, rects,
> --
> 1.8.1.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list