pipe_mutex tex_mutex;
pipe_mutex swc_mutex; /* Protects the use of swc and dirty_buffers */
- /**
- * List of buffers with cached GMR. Ordered from the most recently used to
- * the least recently used
- */
- struct list_head cached_buffers;
-
struct svga_host_surface_cache cache;
};
if(sbuf->hw.buf) {
sws->buffer_destroy(sws, sbuf->hw.buf);
sbuf->hw.buf = NULL;
- assert(sbuf->head.prev && sbuf->head.next);
- LIST_DEL(&sbuf->head);
-#ifdef DEBUG
- sbuf->head.next = sbuf->head.prev = NULL;
-#endif
}
}
return PIPE_ERROR_OUT_OF_MEMORY;
assert(!sbuf->needs_flush);
- assert(!sbuf->head.prev && !sbuf->head.next);
- LIST_ADD(&sbuf->head, &ss->cached_buffers);
}
return PIPE_OK;
assert(sbuf->head.prev && sbuf->head.next);
LIST_DEL(&sbuf->head);
+#ifdef DEBUG
+ sbuf->head.next = sbuf->head.prev = NULL;
+#endif
sbuf->needs_flush = FALSE;
- /* XXX: do we care about cached_buffers any more ?*/
- LIST_ADD(&sbuf->head, &ss->cached_buffers);
sbuf->hw.svga = NULL;
sbuf->hw.boxes = NULL;
sws->fence_reference(sws, &fence, NULL);
}
}
- else {
- if(!(usage & PIPE_BUFFER_USAGE_DISCARD) && !sbuf->needs_flush) {
- /* We already had the hardware storage but we would have to issue
- * a download if we hadn't, so move the buffer to the begginning
- * of the LRU list.
- */
- assert(sbuf->head.prev && sbuf->head.next);
- LIST_DEL(&sbuf->head);
- LIST_ADD(&sbuf->head, &ss->cached_buffers);
- }
- }
map = sws->buffer_map(sws, sbuf->hw.buf, usage);
}
assert(sbuf->hw.svga == svga);
sbuf->needs_flush = TRUE;
- assert(sbuf->head.prev && sbuf->head.next);
- LIST_DEL(&sbuf->head);
+ assert(!sbuf->head.prev && !sbuf->head.next);
LIST_ADDTAIL(&sbuf->head, &svga->dirty_buffers);
}