Merge commit 'origin/gallium-0.1'
authorJosé Fonseca <jfonseca@vmware.com>
Mon, 23 Feb 2009 17:21:36 +0000 (17:21 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Mon, 23 Feb 2009 17:21:36 +0000 (17:21 +0000)
Conflicts:
src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
src/gallium/auxiliary/util/u_tile.c

1  2 
scons/gallium.py
scons/generic.py
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c
src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.h
src/gallium/auxiliary/pipebuffer/pb_bufmgr_fenced.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c
src/gallium/auxiliary/util/u_tile.c

Simple merge
Simple merge
@@@ -63,11 -71,15 +63,15 @@@ struct fenced_buffer_lis
  {
     pipe_mutex mutex;
     
 -   struct pipe_winsys *winsys;
 +   struct pb_fence_ops *ops;
     
     size_t numDelayed;
-    
     struct list_head delayed;
+    
+ #ifdef DEBUG
+    size_t numUnfenced;
+    struct list_head unfenced;
+ #endif
  };
  
  
@@@ -454,12 -443,16 +480,16 @@@ fenced_buffer_list_create(struct pb_fen
     if (!fenced_list)
        return NULL;
  
 -   fenced_list->winsys = winsys;
 +   fenced_list->ops = ops;
  
     LIST_INITHEAD(&fenced_list->delayed);
     fenced_list->numDelayed = 0;
     
+ #ifdef DEBUG
+    LIST_INITHEAD(&fenced_list->unfenced);
+    fenced_list->numUnfenced = 0;
+ #endif
     pipe_mutex_init(fenced_list->mutex);
  
     return fenced_list;
@@@ -476,6 -469,52 +506,52 @@@ fenced_buffer_list_check_free(struct fe
  }
  
  
 -   struct pipe_winsys *winsys = fenced_list->winsys;
+ #ifdef DEBUG
+ void
+ fenced_buffer_list_dump(struct fenced_buffer_list *fenced_list)
+ {
 -      signaled = winsys->fence_signalled(winsys, fenced_buf->fence, 0);
++   struct pb_fence_ops *ops = fenced_list->ops;
+    struct list_head *curr, *next;
+    struct fenced_buffer *fenced_buf;
+    struct pipe_fence_handle *prev_fence = NULL;
+    pipe_mutex_lock(fenced_list->mutex);
+    debug_printf("%10s %7s %10s %s\n",
+                 "buffer", "refcount", "fence", "signalled");
+    
+    curr = fenced_list->unfenced.next;
+    next = curr->next;
+    while(curr != &fenced_list->unfenced) {
+       fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head);
+       assert(!fenced_buf->fence);
+       debug_printf("%10p %7u\n",
+                    fenced_buf,
+                    fenced_buf->base.base.refcount);
+       curr = next; 
+       next = curr->next;
+    }
+    
+    curr = fenced_list->delayed.next;
+    next = curr->next;
+    while(curr != &fenced_list->delayed) {
+       int signaled;
+       fenced_buf = LIST_ENTRY(struct fenced_buffer, curr, head);
++      signaled = ops->fence_signalled(ops, fenced_buf->fence, 0);
+       debug_printf("%10p %7u %10p %s\n",
+                    fenced_buf,
+                    fenced_buf->base.base.refcount,
+                    fenced_buf->fence,
+                    signaled == 0 ? "y" : "n");
+       curr = next; 
+       next = curr->next;
+    }
+    
+    pipe_mutex_unlock(fenced_list->mutex);
+ }
+ #endif
  void
  fenced_buffer_list_destroy(struct fenced_buffer_list *fenced_list)
  {
        pipe_mutex_lock(fenced_list->mutex);
     }
  
+ #ifdef DEBUG
+    //assert(!fenced_list->numUnfenced);
+ #endif
+       
     pipe_mutex_unlock(fenced_list->mutex);
     
 +   fenced_list->ops->destroy(fenced_list->ops);
 +   
     FREE(fenced_list);
  }
  
@@@ -1050,10 -1073,10 +1072,10 @@@ pipe_put_tile_rgba(struct pipe_transfe
        /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/
        break;
     default:
-       assert(0);
 -      debug_printf("%s: unsupported format %s\n", __FUNCTION__, pf_name(ps->format));
++      debug_printf("%s: unsupported format %s\n", __FUNCTION__, pf_name(pt->format));
     }
  
 -   pipe_put_tile_raw(ps, x, y, w, h, packed, 0);
 +   pipe_put_tile_raw(pt, x, y, w, h, packed, 0);
  
     FREE(packed);
  }