swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)
[mesa.git] / src / gallium / state_trackers / egl / common / native_helper.c
index cca1e1c62954ec2da7b40f095b3ca7cb88edc36f..4a77a502e8703a8de7088b1b612be72521fa938d 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.9
  *
  * Copyright (C) 2010 LunarG Inc.
  * Copyright (C) 2011 VMware Inc. All rights reserved.
@@ -245,7 +244,7 @@ resource_surface_present(struct resource_surface *rsurf,
       return TRUE;
 
    rsurf->screen->flush_frontbuffer(rsurf->screen,
-         pres, 0, 0, winsys_drawable_handle);
+         pres, 0, 0, winsys_drawable_handle, NULL);
 
    return TRUE;
 }
@@ -352,7 +351,7 @@ resource_surface_flush(struct resource_surface *rsurf,
    if (!pipe)
       return FALSE;
 
-   pipe->flush(pipe, &fence);
+   pipe->flush(pipe, &fence, 0);
    if (fence == NULL)
       return FALSE;
 
@@ -393,12 +392,16 @@ native_display_copy_to_pixmap(struct native_display *ndpy,
    dst = tmp[natt];
 
    if (dst && dst->format == src->format) {
+      struct native_present_control ctrl;
       struct pipe_box src_box;
 
       u_box_origin_2d(src->width0, src->height0, &src_box);
       pipe->resource_copy_region(pipe, dst, 0, 0, 0, 0, src, 0, &src_box);
-      pipe->flush(pipe, NULL);
-      nsurf->present(nsurf, natt, FALSE, 0);
+      pipe->flush(pipe, NULL, 0);
+
+      memset(&ctrl, 0, sizeof(ctrl));
+      ctrl.natt = natt;
+      nsurf->present(nsurf, &ctrl);
    }
 
    if (dst)
@@ -424,6 +427,7 @@ drm_display_import_native_buffer(struct native_display *ndpy,
 
          memset(&wsh, 0, sizeof(wsh));
          wsh.handle = nbuf->u.drm.name;
+         wsh.type = DRM_API_HANDLE_TYPE_SHARED;
          wsh.stride = nbuf->u.drm.stride;
 
          res = screen->resource_from_handle(screen, &nbuf->u.drm.templ, &wsh);