st/egl: Flush resources before presentation
authorMartin Andersson <g02maran@gmail.com>
Thu, 26 Dec 2013 09:33:28 +0000 (10:33 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 13 Jan 2014 14:25:31 +0000 (15:25 +0100)
Fixes wayland regression on r600g due to fast clear introduced by commit
edbbfac6.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/state_trackers/egl/common/native_helper.c
src/gallium/state_trackers/egl/common/native_helper.h
src/gallium/state_trackers/egl/wayland/native_wayland.c

index 4a77a502e8703a8de7088b1b612be72521fa938d..856cbb6d675d6aba461ac8207bd8e4cb46c0321f 100644 (file)
@@ -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)
index 4c369a7ff1a06cf45b943e90135991ffd41d1249..0b53b286e2d2c13c816e5e14a83c18a1a943b92a 100644 (file)
@@ -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.
index cfdf4f870441ff61de94148e38779f908da45fad..cb0ce0d18164f417f79756c915bce35bd16c1b5e 100644 (file)
@@ -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,