Mesa (gallium-resources): st/egl: fix up for binding flags

Roland Scheidegger sroland at kemper.freedesktop.org
Tue Mar 30 15:38:18 UTC 2010


Module: Mesa
Branch: gallium-resources
Commit: 3a830bc4a3f0f60c925b9434845a6bcad9a913c5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3a830bc4a3f0f60c925b9434845a6bcad9a913c5

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Mar 23 14:00:52 2010 -0700

st/egl: fix up for binding flags

---

 src/gallium/state_trackers/egl/common/egl_g3d.c    |   10 ++++++----
 src/gallium/state_trackers/egl/x11/native_dri2.c   |    4 ++--
 src/gallium/state_trackers/egl/x11/native_ximage.c |    8 ++++----
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c
index 4d70fb9..4296c57 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d.c
@@ -775,7 +775,8 @@ egl_g3d_find_pixmap_config(_EGLDisplay *dpy, EGLNativePixmapType pix)
  */
 static struct pipe_surface *
 get_pipe_surface(struct native_display *ndpy, struct native_surface *nsurf,
-                 enum native_attachment natt)
+                 enum native_attachment natt,
+		 unsigned bind)
 {
    struct pipe_resource *textures[NUM_NATIVE_ATTACHMENTS];
    struct pipe_surface *psurf;
@@ -786,7 +787,7 @@ get_pipe_surface(struct native_display *ndpy, struct native_surface *nsurf,
       return NULL;
 
    psurf = ndpy->screen->get_tex_surface(ndpy->screen, textures[natt],
-         0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE);
+         0, 0, 0, bind);
    pipe_resource_reference(&textures[natt], NULL);
 
    return psurf;
@@ -831,12 +832,13 @@ egl_g3d_copy_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf,
          return EGL_FALSE;
    }
 
-   psurf = get_pipe_surface(gdpy->native, nsurf, NATIVE_ATTACHMENT_FRONT_LEFT);
+   psurf = get_pipe_surface(gdpy->native, nsurf, NATIVE_ATTACHMENT_FRONT_LEFT,
+			    PIPE_BIND_BLIT_DESTINATION);
    if (psurf) {
       struct pipe_surface *psrc;
 
       psrc = screen->get_tex_surface(screen, gsurf->render_texture,
-            0, 0, 0, PIPE_BUFFER_USAGE_GPU_READ);
+            0, 0, 0, PIPE_BIND_BLIT_SOURCE);
       if (psrc) {
          gdpy->pipe->surface_copy(gdpy->pipe, psurf, 0, 0,
                psrc, 0, 0, psurf->width, psurf->height);
diff --git a/src/gallium/state_trackers/egl/x11/native_dri2.c b/src/gallium/state_trackers/egl/x11/native_dri2.c
index e34d8fe..5a27c24 100644
--- a/src/gallium/state_trackers/egl/x11/native_dri2.c
+++ b/src/gallium/state_trackers/egl/x11/native_dri2.c
@@ -136,7 +136,7 @@ dri2_surface_process_drawable_buffers(struct native_surface *nsurf,
    templ.height0 = dri2surf->height;
    templ.depth0 = 1;
    templ.format = dri2surf->color_format;
-   templ.tex_usage = PIPE_BIND_RENDER_TARGET;
+   templ.bind = PIPE_BIND_RENDER_TARGET;
 
    valid_mask = 0x0;
    for (i = 0; i < num_xbufs; i++) {
@@ -277,7 +277,7 @@ dri2_surface_update_buffers(struct native_surface *nsurf, uint buffer_mask)
       templ.height0 = dri2surf->height;
       templ.depth0 = 1;
       templ.format = dri2surf->color_format;
-      templ.tex_usage = PIPE_BIND_RENDER_TARGET;
+      templ.bind = PIPE_BIND_RENDER_TARGET;
 
       for (att = 0; att < NUM_NATIVE_ATTACHMENTS; att++) {
          if (native_attachment_mask_test(buffer_mask, att)) {
diff --git a/src/gallium/state_trackers/egl/x11/native_ximage.c b/src/gallium/state_trackers/egl/x11/native_ximage.c
index 49d0f0f..6621f04 100644
--- a/src/gallium/state_trackers/egl/x11/native_ximage.c
+++ b/src/gallium/state_trackers/egl/x11/native_ximage.c
@@ -138,17 +138,17 @@ ximage_surface_alloc_buffer(struct native_surface *nsurf,
    templ.width0 = xsurf->width;
    templ.height0 = xsurf->height;
    templ.depth0 = 1;
-   templ.tex_usage = PIPE_BIND_RENDER_TARGET;
+   templ.bind = PIPE_BIND_RENDER_TARGET;
 
    if (xsurf->type != XIMAGE_SURFACE_TYPE_PBUFFER) {
       switch (which) {
       case NATIVE_ATTACHMENT_FRONT_LEFT:
       case NATIVE_ATTACHMENT_FRONT_RIGHT:
-         templ.tex_usage |= PIPE_BIND_SCANOUT;
+         templ.bind |= PIPE_BIND_SCANOUT;
          break;
       case NATIVE_ATTACHMENT_BACK_LEFT:
       case NATIVE_ATTACHMENT_BACK_RIGHT:
-         templ.tex_usage |= PIPE_BIND_DISPLAY_TARGET;
+         templ.bind |= PIPE_BIND_DISPLAY_TARGET;
          break;
       default:
          break;
@@ -273,7 +273,7 @@ ximage_surface_draw_buffer(struct native_surface *nsurf,
       pipe_surface_reference(&xsurf->draw_surface, NULL);
 
       psurf = screen->get_tex_surface(screen,
-            xbuf->texture, 0, 0, 0, PIPE_BUFFER_USAGE_CPU_READ);
+            xbuf->texture, 0, 0, 0, PIPE_BIND_DISPLAY_TARGET);
       if (!psurf)
          return FALSE;
 




More information about the mesa-commit mailing list