From: Martin Andersson Date: Thu, 26 Dec 2013 09:33:28 +0000 (+0100) Subject: st/egl: Flush resources before presentation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c156d245258842c41d1ffac06a08ee7eeb45b33f;p=mesa.git st/egl: Flush resources before presentation Fixes wayland regression on r600g due to fast clear introduced by commit edbbfac6. Signed-off-by: Marek Olšák --- diff --git a/src/gallium/state_trackers/egl/common/native_helper.c b/src/gallium/state_trackers/egl/common/native_helper.c index 4a77a502e87..856cbb6d675 100644 --- a/src/gallium/state_trackers/egl/common/native_helper.c +++ b/src/gallium/state_trackers/egl/common/native_helper.c @@ -340,6 +340,21 @@ resource_surface_throttle(struct resource_surface *rsurf) return FALSE; } +boolean +resource_surface_flush_resource(struct resource_surface *rsurf, + struct native_display *ndpy, + enum native_attachment which) +{ + struct pipe_context *pipe = ndpy_get_copy_context(ndpy); + + if (!pipe) + return FALSE; + + pipe->flush_resource(pipe, rsurf->resources[which]); + + return TRUE; +} + boolean resource_surface_flush(struct resource_surface *rsurf, struct native_display *ndpy) diff --git a/src/gallium/state_trackers/egl/common/native_helper.h b/src/gallium/state_trackers/egl/common/native_helper.h index 4c369a7ff1a..0b53b286e2d 100644 --- a/src/gallium/state_trackers/egl/common/native_helper.h +++ b/src/gallium/state_trackers/egl/common/native_helper.h @@ -91,6 +91,11 @@ resource_surface_copy_swap(struct resource_surface *rsurf, boolean resource_surface_throttle(struct resource_surface *rsurf); +boolean +resource_surface_flush_resource(struct resource_surface *rsurf, + struct native_display *ndpy, + enum native_attachment which); + /** * Flush pending rendering using the copy context. This function saves a * marker for upcoming throttles. diff --git a/src/gallium/state_trackers/egl/wayland/native_wayland.c b/src/gallium/state_trackers/egl/wayland/native_wayland.c index cfdf4f87044..cb0ce0d1816 100644 --- a/src/gallium/state_trackers/egl/wayland/native_wayland.c +++ b/src/gallium/state_trackers/egl/wayland/native_wayland.c @@ -259,6 +259,10 @@ wayland_surface_swap_buffers(struct native_surface *nsurf) if (ret == -1) return EGL_FALSE; + (void) resource_surface_flush_resource(surface->rsurf, &display->base, + NATIVE_ATTACHMENT_BACK_LEFT); + (void) resource_surface_flush(surface->rsurf, &display->base); + surface->frame_callback = wl_surface_frame(surface->win->surface); wl_callback_add_listener(surface->frame_callback, &frame_listener, surface); wl_proxy_set_queue((struct wl_proxy *) surface->frame_callback,