pb_buffer: inline 'base' sub-struct
authorMarek Olšák <maraeo@gmail.com>
Sun, 11 Sep 2011 15:24:24 +0000 (17:24 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sun, 11 Sep 2011 16:29:27 +0000 (18:29 +0200)
13 files changed:
src/gallium/auxiliary/pipebuffer/pb_buffer.h
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c
src/gallium/winsys/r600/drm/r600_hw_context.c
src/gallium/winsys/radeon/drm/radeon_drm_bo.c
src/gallium/winsys/svga/drm/vmw_buffer.c
src/gallium/winsys/svga/drm/vmw_context.c

index 5a13f39849fb2c4bc3d1b4e52b62bf5c4bc76073..a5ec93c255e297a088257c18fee1f337ebee9d07 100644 (file)
@@ -97,14 +97,10 @@ typedef unsigned pb_size;
  */
 struct pb_buffer 
 {
-   /* This used to be a pipe_buffer struct:
-    */
-   struct {
-      struct pipe_reference  reference;
-      unsigned               size;
-      unsigned               alignment;
-      unsigned               usage;
-   } base;
+   struct pipe_reference  reference;
+   unsigned               size;
+   unsigned               alignment;
+   unsigned               usage;
 
    /**
     * Pointer to the virtual function table.
@@ -169,7 +165,7 @@ pb_map(struct pb_buffer *buf,
    assert(buf);
    if(!buf)
       return NULL;
-   assert(pipe_is_referenced(&buf->base.reference));
+   assert(pipe_is_referenced(&buf->reference));
    return buf->vtbl->map(buf, flags, flush_ctx);
 }
 
@@ -180,7 +176,7 @@ pb_unmap(struct pb_buffer *buf)
    assert(buf);
    if(!buf)
       return;
-   assert(pipe_is_referenced(&buf->base.reference));
+   assert(pipe_is_referenced(&buf->reference));
    buf->vtbl->unmap(buf);
 }
 
@@ -196,11 +192,11 @@ pb_get_base_buffer( struct pb_buffer *buf,
       offset = 0;
       return;
    }
-   assert(pipe_is_referenced(&buf->base.reference));
+   assert(pipe_is_referenced(&buf->reference));
    assert(buf->vtbl->get_base_buffer);
    buf->vtbl->get_base_buffer(buf, base_buf, offset);
    assert(*base_buf);
-   assert(*offset < (*base_buf)->base.size);
+   assert(*offset < (*base_buf)->size);
 }
 
 
@@ -232,7 +228,7 @@ pb_destroy(struct pb_buffer *buf)
    assert(buf);
    if(!buf)
       return;
-   assert(!pipe_is_referenced(&buf->base.reference));
+   assert(!pipe_is_referenced(&buf->reference));
    buf->vtbl->destroy(buf);
 }
 
@@ -242,7 +238,7 @@ pb_reference(struct pb_buffer **dst,
 {
    struct pb_buffer *old = *dst;
 
-   if (pipe_reference(&(*dst)->base.reference, &src->base.reference))
+   if (pipe_reference(&(*dst)->reference, &src->reference))
       pb_destroy( old );
    *dst = src;
 }
index c310f28f51fd31d83dd53baf2b982ae8cb3ed553..9e0cacecac1423a1c566e926a63b5f2a5116c44a 100644 (file)
@@ -210,8 +210,8 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
       assert(!fenced_buf->fence);
       debug_printf("%10p %7u %8u %7s\n",
                    (void *) fenced_buf,
-                   fenced_buf->base.base.size,
-                   p_atomic_read(&fenced_buf->base.base.reference.count),
+                   fenced_buf->base.size,
+                   p_atomic_read(&fenced_buf->base.reference.count),
                    fenced_buf->buffer ? "gpu" : (fenced_buf->data ? "cpu" : "none"));
       curr = next;
       next = curr->next;
@@ -226,8 +226,8 @@ fenced_manager_dump_locked(struct fenced_manager *fenced_mgr)
       signaled = ops->fence_signalled(ops, fenced_buf->fence, 0);
       debug_printf("%10p %7u %8u %7s %10p %s\n",
                    (void *) fenced_buf,
-                   fenced_buf->base.base.size,
-                   p_atomic_read(&fenced_buf->base.base.reference.count),
+                   fenced_buf->base.size,
+                   p_atomic_read(&fenced_buf->base.reference.count),
                    "gpu",
                    (void *) fenced_buf->fence,
                    signaled == 0 ? "y" : "n");
@@ -244,7 +244,7 @@ static INLINE void
 fenced_buffer_destroy_locked(struct fenced_manager *fenced_mgr,
                              struct fenced_buffer *fenced_buf)
 {
-   assert(!pipe_is_referenced(&fenced_buf->base.base.reference));
+   assert(!pipe_is_referenced(&fenced_buf->base.reference));
 
    assert(!fenced_buf->fence);
    assert(fenced_buf->head.prev);
@@ -269,11 +269,11 @@ static INLINE void
 fenced_buffer_add_locked(struct fenced_manager *fenced_mgr,
                          struct fenced_buffer *fenced_buf)
 {
-   assert(pipe_is_referenced(&fenced_buf->base.base.reference));
+   assert(pipe_is_referenced(&fenced_buf->base.reference));
    assert(fenced_buf->flags & PB_USAGE_GPU_READ_WRITE);
    assert(fenced_buf->fence);
 
-   p_atomic_inc(&fenced_buf->base.base.reference.count);
+   p_atomic_inc(&fenced_buf->base.reference.count);
 
    LIST_DEL(&fenced_buf->head);
    assert(fenced_mgr->num_unfenced);
@@ -311,7 +311,7 @@ fenced_buffer_remove_locked(struct fenced_manager *fenced_mgr,
    LIST_ADDTAIL(&fenced_buf->head, &fenced_mgr->unfenced);
    ++fenced_mgr->num_unfenced;
 
-   if (p_atomic_dec_zero(&fenced_buf->base.base.reference.count)) {
+   if (p_atomic_dec_zero(&fenced_buf->base.reference.count)) {
       fenced_buffer_destroy_locked(fenced_mgr, fenced_buf);
       return TRUE;
    }
@@ -337,7 +337,7 @@ fenced_buffer_finish_locked(struct fenced_manager *fenced_mgr,
    debug_warning("waiting for GPU");
 #endif
 
-   assert(pipe_is_referenced(&fenced_buf->base.base.reference));
+   assert(pipe_is_referenced(&fenced_buf->base.reference));
    assert(fenced_buf->fence);
 
    if(fenced_buf->fence) {
@@ -353,7 +353,7 @@ fenced_buffer_finish_locked(struct fenced_manager *fenced_mgr,
 
       pipe_mutex_lock(fenced_mgr->mutex);
 
-      assert(pipe_is_referenced(&fenced_buf->base.base.reference));
+      assert(pipe_is_referenced(&fenced_buf->base.reference));
 
       /*
        * Only proceed if the fence object didn't change in the meanwhile.
@@ -662,7 +662,7 @@ fenced_buffer_destroy(struct pb_buffer *buf)
    struct fenced_buffer *fenced_buf = fenced_buffer(buf);
    struct fenced_manager *fenced_mgr = fenced_buf->mgr;
 
-   assert(!pipe_is_referenced(&fenced_buf->base.base.reference));
+   assert(!pipe_is_referenced(&fenced_buf->base.reference));
 
    pipe_mutex_lock(fenced_mgr->mutex);
 
@@ -837,7 +837,7 @@ fenced_buffer_fence(struct pb_buffer *buf,
 
    pipe_mutex_lock(fenced_mgr->mutex);
 
-   assert(pipe_is_referenced(&fenced_buf->base.base.reference));
+   assert(pipe_is_referenced(&fenced_buf->base.reference));
    assert(fenced_buf->buffer);
 
    if(fence != fenced_buf->fence) {
@@ -929,10 +929,10 @@ fenced_bufmgr_create_buffer(struct pb_manager *mgr,
    if(!fenced_buf)
       goto no_buffer;
 
-   pipe_reference_init(&fenced_buf->base.base.reference, 1);
-   fenced_buf->base.base.alignment = desc->alignment;
-   fenced_buf->base.base.usage = desc->usage;
-   fenced_buf->base.base.size = size;
+   pipe_reference_init(&fenced_buf->base.reference, 1);
+   fenced_buf->base.alignment = desc->alignment;
+   fenced_buf->base.usage = desc->usage;
+   fenced_buf->base.size = size;
    fenced_buf->size = size;
    fenced_buf->desc = *desc;
 
index 5754f4761887ebeeda0a92143f7afdfbcfbe7563..b106a1a02799f8d4282d32734c216ffa35655117 100644 (file)
@@ -135,10 +135,10 @@ pb_malloc_buffer_create(pb_size size,
    if(!buf)
       return NULL;
 
-   pipe_reference_init(&buf->base.base.reference, 1);
-   buf->base.base.usage = desc->usage;
-   buf->base.base.size = size;
-   buf->base.base.alignment = desc->alignment;
+   pipe_reference_init(&buf->base.reference, 1);
+   buf->base.usage = desc->usage;
+   buf->base.size = size;
+   buf->base.alignment = desc->alignment;
    buf->base.vtbl = &malloc_buffer_vtbl;
 
    buf->data = align_malloc(size, desc->alignment < sizeof(void*) ? sizeof(void*) : desc->alignment);
index 25accefa8d6412807397fd087ac897b47620874d..58721c068e2a8f984d89ecf56de5db8c34c91e42 100644 (file)
@@ -112,7 +112,7 @@ _pb_cache_buffer_destroy(struct pb_cache_buffer *buf)
    LIST_DEL(&buf->head);
    assert(mgr->numDelayed);
    --mgr->numDelayed;
-   assert(!pipe_is_referenced(&buf->base.base.reference));
+   assert(!pipe_is_referenced(&buf->base.reference));
    pb_reference(&buf->buffer, NULL);
    FREE(buf);
 }
@@ -153,7 +153,7 @@ pb_cache_buffer_destroy(struct pb_buffer *_buf)
    struct pb_cache_manager *mgr = buf->mgr;
 
    pipe_mutex_lock(mgr->mutex);
-   assert(!pipe_is_referenced(&buf->base.base.reference));
+   assert(!pipe_is_referenced(&buf->base.reference));
    
    _pb_cache_buffer_list_check_free(mgr);
    
@@ -227,17 +227,17 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer *buf,
                           pb_size size,
                           const struct pb_desc *desc)
 {
-   if(buf->base.base.size < size)
+   if(buf->base.size < size)
       return 0;
 
    /* be lenient with size */
-   if(buf->base.base.size >= 2*size)
+   if(buf->base.size >= 2*size)
       return 0;
    
-   if(!pb_check_alignment(desc->alignment, buf->base.base.alignment))
+   if(!pb_check_alignment(desc->alignment, buf->base.alignment))
       return 0;
    
-   if(!pb_check_usage(desc->usage, buf->base.base.usage))
+   if(!pb_check_usage(desc->usage, buf->base.usage))
       return 0;
 
    if (buf->mgr->provider->is_buffer_busy) {
@@ -313,7 +313,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
       --mgr->numDelayed;
       pipe_mutex_unlock(mgr->mutex);
       /* Increase refcount */
-      pipe_reference_init(&buf->base.base.reference, 1);
+      pipe_reference_init(&buf->base.reference, 1);
       return &buf->base;
    }
    
@@ -329,15 +329,15 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr,
       return NULL;
    }
    
-   assert(pipe_is_referenced(&buf->buffer->base.reference));
-   assert(pb_check_alignment(desc->alignment, buf->buffer->base.alignment));
-   assert(pb_check_usage(desc->usage, buf->buffer->base.usage));
-   assert(buf->buffer->base.size >= size);
+   assert(pipe_is_referenced(&buf->buffer->reference));
+   assert(pb_check_alignment(desc->alignment, buf->buffer->alignment));
+   assert(pb_check_usage(desc->usage, buf->buffer->usage));
+   assert(buf->buffer->size >= size);
    
-   pipe_reference_init(&buf->base.base.reference, 1);
-   buf->base.base.alignment = buf->buffer->base.alignment;
-   buf->base.base.usage = buf->buffer->base.usage;
-   buf->base.base.size = buf->buffer->base.size;
+   pipe_reference_init(&buf->base.reference, 1);
+   buf->base.alignment = buf->buffer->alignment;
+   buf->base.usage = buf->buffer->usage;
+   buf->base.size = buf->buffer->size;
    
    buf->base.vtbl = &pb_cache_buffer_vtbl;
    buf->mgr = mgr;
index 7604e75af8d5ef4cae1a68d929f407516141ce53..b9237359e6eeee69e589120e7201eb5353f98063 100644 (file)
@@ -162,7 +162,7 @@ pb_debug_buffer_fill(struct pb_debug_buffer *buf)
    assert(map);
    if(map) {
       fill_random_pattern(map, buf->underflow_size);
-      fill_random_pattern(map + buf->underflow_size + buf->base.base.size, 
+      fill_random_pattern(map + buf->underflow_size + buf->base.size,
                           buf->overflow_size);
       pb_unmap(buf->buffer);
    }
@@ -196,12 +196,12 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf)
                       buf->underflow_size - max_ofs);
       }
       
-      overflow = !check_random_pattern(map + buf->underflow_size + buf->base.base.size, 
+      overflow = !check_random_pattern(map + buf->underflow_size + buf->base.size,
                                        buf->overflow_size, 
                                        &min_ofs, &max_ofs);
       if(overflow) {
          debug_printf("buffer overflow (size %u plus offset %u to %u%s bytes) detected\n",
-                      buf->base.base.size,
+                      buf->base.size,
                       min_ofs,
                       max_ofs,
                       max_ofs == buf->overflow_size - 1 ? "+" : "");
@@ -216,7 +216,7 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf)
       if(underflow)
          fill_random_pattern(map, buf->underflow_size);
       if(overflow)
-         fill_random_pattern(map + buf->underflow_size + buf->base.base.size, 
+         fill_random_pattern(map + buf->underflow_size + buf->base.size,
                              buf->overflow_size);
 
       pb_unmap(buf->buffer);
@@ -230,7 +230,7 @@ pb_debug_buffer_destroy(struct pb_buffer *_buf)
    struct pb_debug_buffer *buf = pb_debug_buffer(_buf);
    struct pb_debug_manager *mgr = buf->mgr;
    
-   assert(!pipe_is_referenced(&buf->base.base.reference));
+   assert(!pipe_is_referenced(&buf->base.reference));
    
    pb_debug_buffer_check(buf);
 
@@ -352,7 +352,7 @@ pb_debug_manager_dump(struct pb_debug_manager *mgr)
       buf = LIST_ENTRY(struct pb_debug_buffer, curr, head);
 
       debug_printf("buffer = %p\n", (void *) buf);
-      debug_printf("    .size = 0x%x\n", buf->base.base.size);
+      debug_printf("    .size = 0x%x\n", buf->base.size);
       debug_backtrace_dump(buf->create_backtrace, PB_DEBUG_CREATE_BACKTRACE);
       
       curr = next; 
@@ -400,21 +400,21 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr,
       return NULL;
    }
    
-   assert(pipe_is_referenced(&buf->buffer->base.reference));
-   assert(pb_check_alignment(real_desc.alignment, buf->buffer->base.alignment));
-   assert(pb_check_usage(real_desc.usage, buf->buffer->base.usage));
-   assert(buf->buffer->base.size >= real_size);
+   assert(pipe_is_referenced(&buf->buffer->reference));
+   assert(pb_check_alignment(real_desc.alignment, buf->buffer->alignment));
+   assert(pb_check_usage(real_desc.usage, buf->buffer->usage));
+   assert(buf->buffer->size >= real_size);
    
-   pipe_reference_init(&buf->base.base.reference, 1);
-   buf->base.base.alignment = desc->alignment;
-   buf->base.base.usage = desc->usage;
-   buf->base.base.size = size;
+   pipe_reference_init(&buf->base.reference, 1);
+   buf->base.alignment = desc->alignment;
+   buf->base.usage = desc->usage;
+   buf->base.size = size;
    
    buf->base.vtbl = &pb_debug_buffer_vtbl;
    buf->mgr = mgr;
 
    buf->underflow_size = mgr->underflow_size;
-   buf->overflow_size = buf->buffer->base.size - buf->underflow_size - size;
+   buf->overflow_size = buf->buffer->size - buf->underflow_size - size;
    
    debug_backtrace_capture(buf->create_backtrace, 1, PB_DEBUG_CREATE_BACKTRACE);
 
index 88da786216a738d8227d7b84823937016892a13b..fe96e5c9d49ceae43014ff912b28ece8a32867f7 100644 (file)
@@ -97,7 +97,7 @@ mm_buffer_destroy(struct pb_buffer *buf)
    struct mm_buffer *mm_buf = mm_buffer(buf);
    struct mm_pb_manager *mm = mm_buf->mgr;
    
-   assert(!pipe_is_referenced(&mm_buf->base.base.reference));
+   assert(!pipe_is_referenced(&mm_buf->base.reference));
    
    pipe_mutex_lock(mm->mutex);
    u_mmFreeMem(mm_buf->block);
@@ -192,10 +192,10 @@ mm_bufmgr_create_buffer(struct pb_manager *mgr,
       return NULL;
    }
 
-   pipe_reference_init(&mm_buf->base.base.reference, 1);
-   mm_buf->base.base.alignment = desc->alignment;
-   mm_buf->base.base.usage = desc->usage;
-   mm_buf->base.base.size = size;
+   pipe_reference_init(&mm_buf->base.reference, 1);
+   mm_buf->base.alignment = desc->alignment;
+   mm_buf->base.usage = desc->usage;
+   mm_buf->base.size = size;
    
    mm_buf->base.vtbl = &mm_buffer_vtbl;
    
index 694a092f3c2fdfb50606f012c0b69915df009b5d..e44bc9b17e4ef53bd9d22ccf066ec063bc4debe0 100644 (file)
@@ -244,10 +244,10 @@ pb_ondemand_manager_create_buffer(struct pb_manager *_mgr,
    if(!buf)
       return NULL;
 
-   pipe_reference_init(&buf->base.base.reference, 1);
-   buf->base.base.alignment = desc->alignment;
-   buf->base.base.usage = desc->usage;
-   buf->base.base.size = size;
+   pipe_reference_init(&buf->base.reference, 1);
+   buf->base.alignment = desc->alignment;
+   buf->base.usage = desc->usage;
+   buf->base.size = size;
    buf->base.vtbl = &pb_ondemand_buffer_vtbl;
    
    buf->mgr = mgr;
index 2f7c7389ff4128098412bf002e91c29ceef13853..a8e9a34d5194596ee5d60233ad1bccaa9cb80461 100644 (file)
@@ -108,7 +108,7 @@ pool_buffer_destroy(struct pb_buffer *buf)
    struct pool_buffer *pool_buf = pool_buffer(buf);
    struct pool_pb_manager *pool = pool_buf->mgr;
    
-   assert(!pipe_is_referenced(&pool_buf->base.base.reference));
+   assert(!pipe_is_referenced(&pool_buf->base.reference));
 
    pipe_mutex_lock(pool->mutex);
    LIST_ADD(&pool_buf->head, &pool->free);
@@ -218,10 +218,10 @@ pool_bufmgr_create_buffer(struct pb_manager *mgr,
    pipe_mutex_unlock(pool->mutex);
    
    pool_buf = LIST_ENTRY(struct pool_buffer, item, head);
-   assert(!pipe_is_referenced(&pool_buf->base.base.reference));
-   pipe_reference_init(&pool_buf->base.base.reference, 1);
-   pool_buf->base.base.alignment = desc->alignment;
-   pool_buf->base.base.usage = desc->usage;
+   assert(!pipe_is_referenced(&pool_buf->base.reference));
+   pipe_reference_init(&pool_buf->base.reference, 1);
+   pool_buf->base.alignment = desc->alignment;
+   pool_buf->base.usage = desc->usage;
    
    return SUPER(pool_buf);
 }
@@ -297,10 +297,10 @@ pool_bufmgr_create(struct pb_manager *provider,
 
    pool_buf = pool->bufs;
    for (i = 0; i < numBufs; ++i) {
-      pipe_reference_init(&pool_buf->base.base.reference, 0);
-      pool_buf->base.base.alignment = 0;
-      pool_buf->base.base.usage = 0;
-      pool_buf->base.base.size = bufSize;
+      pipe_reference_init(&pool_buf->base.reference, 0);
+      pool_buf->base.alignment = 0;
+      pool_buf->base.usage = 0;
+      pool_buf->base.size = bufSize;
       pool_buf->base.vtbl = &pool_buffer_vtbl;
       pool_buf->mgr = pool;
       pool_buf->start = i * bufSize;
index 176f9aa38aa421dd3de022cf59d6fd2c0bd469f3..bd84b622b627455294d04e1292a9e50696a86613 100644 (file)
@@ -201,7 +201,7 @@ pb_slab_buffer_destroy(struct pb_buffer *_buf)
 
    pipe_mutex_lock(mgr->mutex);
    
-   assert(!pipe_is_referenced(&buf->base.base.reference));
+   assert(!pipe_is_referenced(&buf->base.reference));
    
    buf->mapCount = 0;
 
@@ -326,7 +326,7 @@ pb_slab_create(struct pb_slab_manager *mgr)
    }
    pb_unmap(slab->bo);
 
-   numBuffers = slab->bo->base.size / mgr->bufSize;
+   numBuffers = slab->bo->size / mgr->bufSize;
 
    slab->buffers = CALLOC(numBuffers, sizeof(*slab->buffers));
    if (!slab->buffers) {
@@ -342,10 +342,10 @@ pb_slab_create(struct pb_slab_manager *mgr)
 
    buf = slab->buffers;
    for (i=0; i < numBuffers; ++i) {
-      pipe_reference_init(&buf->base.base.reference, 0);
-      buf->base.base.size = mgr->bufSize;
-      buf->base.base.alignment = 0;
-      buf->base.base.usage = 0;
+      pipe_reference_init(&buf->base.reference, 0);
+      buf->base.size = mgr->bufSize;
+      buf->base.alignment = 0;
+      buf->base.usage = 0;
       buf->base.vtbl = &pb_slab_buffer_vtbl;
       buf->slab = slab;
       buf->start = i* mgr->bufSize;
@@ -421,9 +421,9 @@ pb_slab_manager_create_buffer(struct pb_manager *_mgr,
    pipe_mutex_unlock(mgr->mutex);
    buf = LIST_ENTRY(struct pb_slab_buffer, list, head);
    
-   pipe_reference_init(&buf->base.base.reference, 1);
-   buf->base.base.alignment = desc->alignment;
-   buf->base.base.usage = desc->usage;
+   pipe_reference_init(&buf->base.reference, 1);
+   buf->base.alignment = desc->alignment;
+   buf->base.usage = desc->usage;
    
    return &buf->base;
 }
index 6c5b4b8953ab58d688aac9b37cdf8b2c89f6463e..5d415ae6348ad72959a80b59d21f99aa1e709420 100644 (file)
@@ -982,7 +982,7 @@ void r600_context_bo_flush(struct r600_context *ctx, unsigned flush_flags,
        } else {
                ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_SURFACE_SYNC, 3, ctx->predicate_drawing);
                ctx->pm4[ctx->pm4_cdwords++] = flush_flags;
-               ctx->pm4[ctx->pm4_cdwords++] = (bo->buf->base.size + 255) >> 8;
+               ctx->pm4[ctx->pm4_cdwords++] = (bo->buf->size + 255) >> 8;
                ctx->pm4[ctx->pm4_cdwords++] = 0x00000000;
                ctx->pm4[ctx->pm4_cdwords++] = 0x0000000A;
                ctx->pm4[ctx->pm4_cdwords++] = PKT3(PKT3_NOP, 0, ctx->predicate_drawing);
index b45efe5f49ce3c09facee8e288dfebc7a135b0da..1dc6eeb4cb058df9dcac7aca408b20fb439b0199 100644 (file)
@@ -356,10 +356,10 @@ static struct pb_buffer *radeon_bomgr_create_bo(struct pb_manager *_mgr,
     if (!bo)
        return NULL;
 
-    pipe_reference_init(&bo->base.base.reference, 1);
-    bo->base.base.alignment = desc->alignment;
-    bo->base.base.usage = desc->usage;
-    bo->base.base.size = size;
+    pipe_reference_init(&bo->base.reference, 1);
+    bo->base.alignment = desc->alignment;
+    bo->base.usage = desc->usage;
+    bo->base.size = size;
     bo->base.vtbl = &radeon_bo_vtbl;
     bo->mgr = mgr;
     bo->rws = mgr->rws;
@@ -592,10 +592,10 @@ static struct pb_buffer *radeon_winsys_bo_from_handle(struct radeon_winsys *rws,
     bo->name = whandle->handle;
 
     /* Initialize it. */
-    pipe_reference_init(&bo->base.base.reference, 1);
-    bo->base.base.alignment = 0;
-    bo->base.base.usage = PB_USAGE_GPU_WRITE | PB_USAGE_GPU_READ;
-    bo->base.base.size = bo->size;
+    pipe_reference_init(&bo->base.reference, 1);
+    bo->base.alignment = 0;
+    bo->base.usage = PB_USAGE_GPU_WRITE | PB_USAGE_GPU_READ;
+    bo->base.size = bo->size;
     bo->base.vtbl = &radeon_bo_vtbl;
     bo->mgr = mgr;
     bo->rws = mgr->rws;
@@ -609,7 +609,7 @@ done:
     if (stride)
         *stride = whandle->stride;
     if (size)
-        *size = bo->base.base.size;
+        *size = bo->base.size;
 
     return (struct pb_buffer*)bo;
 
index 80d5dfc3ed49f107bc07c059a02012c614b61989..69f0787c49df2980ef6ee9e3e52e1c58b779de3e 100644 (file)
@@ -193,10 +193,10 @@ vmw_gmr_bufmgr_create_buffer(struct pb_manager *_mgr,
    if(!buf)
       goto error1;
 
-   pipe_reference_init(&buf->base.base.reference, 1);
-   buf->base.base.alignment = desc->alignment;
-   buf->base.base.usage = desc->usage;
-   buf->base.base.size = size;
+   pipe_reference_init(&buf->base.reference, 1);
+   buf->base.alignment = desc->alignment;
+   buf->base.usage = desc->usage;
+   buf->base.size = size;
    buf->base.vtbl = &vmw_gmr_buffer_vtbl;
    buf->mgr = mgr;
 
index f2124c1bf6508a2c877a9906d63d2aea0ab704d7..633ef385a69f274dc08cc4bafbac1404b15491f3 100644 (file)
@@ -319,7 +319,7 @@ vmw_swc_region_relocation(struct svga_winsys_context *swc,
     * SVGA virtual device it's not a performance issue since flushing commands
     * to the FIFO won't cause flushing in the host.
     */
-   vswc->seen_regions += reloc->buffer->base.size;
+   vswc->seen_regions += reloc->buffer->size;
    if(vswc->seen_regions >= VMW_GMR_POOL_SIZE/3)
       vswc->preemptive_flush = TRUE;
 }