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 <marek.olsak@amd.com>
This commit is contained in:
Martin Andersson
2013-12-26 10:33:28 +01:00
committed by Marek Olšák
parent 99abb87c63
commit c156d24525
3 changed files with 24 additions and 0 deletions
@@ -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)
@@ -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.
@@ -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,