#include "svga_debug.h"
-#define MAX_DMA_SIZE (4 * 1024 * 1024)
-
-
/**
* Allocate a winsys_buffer (ie. DMA, aka GMR memory).
*
struct svga_winsys_screen *sws = svgascreen->sws;
struct svga_winsys_buffer *buf;
- /* XXX this shouldn't be a hard-coded number; it should be queried
- * somehow.
- */
- if (size > MAX_DMA_SIZE) {
- return NULL;
- }
-
/* Just try */
buf = sws->buffer_create(sws, alignment, usage, size);
- if(!buf) {
-
- SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "flushing screen to find %d bytes GMR\n",
+ if (!buf) {
+ SVGA_DBG(DEBUG_DMA|DEBUG_PERF, "flushing context to find %d bytes GMR\n",
size);
/* Try flushing all pending DMAs */
unsigned offset,
unsigned size)
{
- struct svga_screen *ss = svga_screen(pipe->screen);
- struct svga_context *svga = svga_context(pipe);
struct svga_buffer *sbuf = svga_buffer(resource);
assert(sbuf->user);
assert(!sbuf->hwbuf);
/*
- * Release any uploaded user buffer.
- *
- * TODO: As an optimization, we could try to update the uploaded buffer
- * instead.
+ * We always treat the contents of user-buffers as volatile,
+ * so no particular action needed here.
*/
- pipe_resource_reference(&sbuf->uploaded.buffer, NULL);
-
- pipe_mutex_lock(ss->swc_mutex);
-
- sbuf->key.size.width = sbuf->b.b.width0 = offset + size;
-
- pipe_mutex_unlock(ss->swc_mutex);
-
- svga->dirty |= SVGA_NEW_VBUFFER | SVGA_NEW_VELEMENT;
}