Adapt for winsys interface changes.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Sun, 9 Dec 2007 18:26:26 +0000 (18:26 +0000)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Sun, 9 Dec 2007 18:26:26 +0000 (18:26 +0000)
src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c
src/mesa/drivers/x11/xm_winsys.c
src/mesa/pipe/draw/draw_vertex_fetch.c
src/mesa/pipe/i915simple/i915_texture.c
src/mesa/pipe/softpipe/sp_texture.c
src/mesa/pipe/xlib/xm_winsys.c
src/mesa/state_tracker/st_cb_fbo.c

index 1799e9b901b044c32fa3b306d2f47d77ff08db1d..86ea86a58fcfedb7a8dd4c4012e8978c535b97f0 100644 (file)
@@ -105,42 +105,48 @@ intel_buffer_reference(struct pipe_winsys *winsys,
 
 /* Grabs the hardware lock!
  */
-static void intel_buffer_data(struct pipe_winsys *winsys, 
-                             struct pipe_buffer_handle *buf,
-                             unsigned size, const void *data,
-                             unsigned usage )
+static int intel_buffer_data(struct pipe_winsys *winsys, 
+                            struct pipe_buffer_handle *buf,
+                            unsigned size, const void *data,
+                            unsigned usage )
 {
    driBOData( dri_bo(buf), size, data, 0 );
+   return 0;
 }
 
-static void intel_buffer_subdata(struct pipe_winsys *winsys, 
-                                struct pipe_buffer_handle *buf,
-                                unsigned long offset, 
-                                unsigned long size, 
-                                const void *data)
+static int intel_buffer_subdata(struct pipe_winsys *winsys, 
+                               struct pipe_buffer_handle *buf,
+                               unsigned long offset, 
+                               unsigned long size, 
+                               const void *data)
 {
    driBOSubData( dri_bo(buf), offset, size, data );
+   return 0;
 }
 
-static void intel_buffer_get_subdata(struct pipe_winsys *winsys, 
-                                    struct pipe_buffer_handle *buf,
-                                    unsigned long offset, 
-                                    unsigned long size, 
-                                    void *data)
+static int intel_buffer_get_subdata(struct pipe_winsys *winsys, 
+                                   struct pipe_buffer_handle *buf,
+                                   unsigned long offset, 
+                                   unsigned long size, 
+                                   void *data)
 {
    driBOGetSubData( dri_bo(buf), offset, size, data );
+   return 0;
 }
 
 /* Pipe has no concept of pools.  We choose the tex/region pool
  * for all buffers.
  */
 static struct pipe_buffer_handle *
-intel_buffer_create(struct pipe_winsys *winsys, unsigned flags)
+intel_buffer_create(struct pipe_winsys *winsys, 
+                    unsigned alignment, 
+                    unsigned flags, 
+                    unsigned hint )
 {
    struct _DriBufferObject *buffer;
    struct intel_pipe_winsys *iws = intel_pipe_winsys(winsys);
    driGenBuffers( iws->regionPool, 
-                 "pipe buffer", 1, &buffer, 64, 0, 0 );
+                 "pipe buffer", 1, &buffer, alignment, flags, hint );
    return pipe_bo(buffer);
 }
 
index f863cdbc15126ed70c04daaf69d553b78525e9e7..dafbe96a1ec8a5b1a07ff6076bf413a00cdc721a 100644 (file)
@@ -210,7 +210,10 @@ xm_get_name(struct pipe_winsys *pws)
 
 
 static struct pipe_buffer_handle *
-xm_buffer_create(struct pipe_winsys *pws, unsigned alignment)
+xm_buffer_create(struct pipe_winsys *pws, 
+                 unsigned alignment, 
+                 unsigned flags, 
+                 unsigned hint)
 {
    struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer);
    buffer->refcount = 1;
@@ -258,7 +261,7 @@ xm_region_alloc(struct pipe_winsys *winsys,
 
    assert(region->pitch > 0);
 
-   region->buffer = winsys->buffer_create( winsys, alignment )
+   region->buffer = winsys->buffer_create( winsys, alignment, 0, 0 )
 ;
 
    /* NULL data --> just allocate the space */
index b51cff59f54490a14fa99755c49fd42290c059d8..7d983ebd2994ec01f02df55f41b803dfc06126ff 100644 (file)
@@ -80,7 +80,6 @@ fetch_attrib4(const void *ptr, enum pipe_format format, float attrib[4])
       break;
 
    case PIPE_FORMAT_A8R8G8B8_UNORM:
-   case PIPE_FORMAT_U_A8_R8_G8_B8:
    case PIPE_FORMAT_R8G8B8A8_UNORM:
       attrib[0] = (float) ((unsigned char *) ptr)[2] / 255.0f;
       attrib[1] = (float) ((unsigned char *) ptr)[1] / 255.0f;
index 1ca2815dfb988fa7d9c857949da1f0c914723ddc..59e8db8a951c0f696244fbe96603f353cd1b3b6b 100644 (file)
@@ -496,7 +496,8 @@ i915_texture_create(struct pipe_context *pipe, struct pipe_texture **pt)
       if (i915->flags.is_i945 ? i945_miptree_layout(pipe, tex) :
          i915_miptree_layout(pipe, tex)) {
         tex->buffer = pipe->winsys->buffer_create(pipe->winsys,
-                                                  PIPE_SURFACE_FLAG_TEXTURE);
+                                                  PIPE_SURFACE_FLAG_TEXTURE,
+                                                  0, 0);
 
         if (tex->buffer)
            pipe->winsys->buffer_data(pipe->winsys, tex->buffer,
index 2288c343bf1caf273e19977fb54579dec6b09b74..cfe962818458dfe6bfb0404232a655688e04a6f5 100644 (file)
@@ -382,7 +382,9 @@ softpipe_texture_create(struct pipe_context *pipe, struct pipe_texture **pt)
 
       if (softpipe_mipmap_tree_layout(pipe, spt)) {
         spt->buffer = pipe->winsys->buffer_create(pipe->winsys,
-                                                  PIPE_SURFACE_FLAG_TEXTURE);
+                                                  32,
+                                                  PIPE_SURFACE_FLAG_TEXTURE,
+                                                  0);
 
         if (spt->buffer) {
            pipe->winsys->buffer_data(pipe->winsys, spt->buffer,
index 976884ad520f565fc3264ebe72ddcafa6abdcc7e..c347d1c2a31a626113e91d2783485caeec6bc0a5 100644 (file)
@@ -155,7 +155,7 @@ xm_buffer_reference(struct pipe_winsys *pws,
    }
 }
 
-static void
+static int
 xm_buffer_data(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
                unsigned size, const void *data, unsigned usage )
 {
@@ -169,9 +169,10 @@ xm_buffer_data(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
    }
    if (data)
       memcpy(xm_buf->data, data, size);
+   return 0;
 }
 
-static void
+static int
 xm_buffer_subdata(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
                   unsigned long offset, unsigned long size, const void *data)
 {
@@ -180,9 +181,10 @@ xm_buffer_subdata(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
    assert(!xm_buf->userBuffer);
    assert(b);
    memcpy(b + offset, data, size);
+   return 0;
 }
 
-static void
+static int
 xm_buffer_get_subdata(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
                       unsigned long offset, unsigned long size, void *data)
 {
@@ -191,6 +193,7 @@ xm_buffer_get_subdata(struct pipe_winsys *pws, struct pipe_buffer_handle *buf,
    assert(!xm_buf->userBuffer);
    assert(b);
    memcpy(data, b + offset, size);
+   return 0;
 }
 
 
@@ -255,7 +258,10 @@ xm_get_name(struct pipe_winsys *pws)
 
 
 static struct pipe_buffer_handle *
-xm_buffer_create(struct pipe_winsys *pws, unsigned flags)
+xm_buffer_create(struct pipe_winsys *pws, 
+                 unsigned alignment, 
+                 unsigned flags,
+                 unsigned hints)
 {
    struct xm_buffer *buffer = CALLOC_STRUCT(xm_buffer);
    buffer->refcount = 1;
index cbda56b5c3dc859cac7aa2152ebf38ab3c2fcd2d..10396c3feb95a9cc10f393a2770e5cf96252ad07 100644 (file)
@@ -118,7 +118,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
       pipe->winsys->buffer_reference(pipe->winsys, &strb->surface->buffer,
                                     NULL);
 
-   strb->surface->buffer = pipe->winsys->buffer_create(pipe->winsys, flags);
+   strb->surface->buffer = pipe->winsys->buffer_create(pipe->winsys, 32, flags, 0);
    if (!strb->surface->buffer)
       return GL_FALSE; /* out of memory, try s/w buffer? */