summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/nvc0_context.c
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-06-23 13:13:22 +0200
committerChristoph Bumiller <[email protected]>2011-06-24 00:15:58 +0200
commit9c5d15e929f47f517f90977f5420e11dfbd3db67 (patch)
treefb2780dcef417e25576a41f4750cfa7161b531c7 /src/gallium/drivers/nvc0/nvc0_context.c
parent1f544cc58794cffe5d5cac5a83efde91154f1b7d (diff)
nv50,nvc0: prevent pushbuf flush during ctx reloc emission
Should unify this too, but will delay that until the planned libdrm_nouveau/winsys changes which are likely to cause major changes to this bo validation code too.
Diffstat (limited to 'src/gallium/drivers/nvc0/nvc0_context.c')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_context.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_context.c b/src/gallium/drivers/nvc0/nvc0_context.c
index 2f2a3da7c44..2679b7f86aa 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.c
+++ b/src/gallium/drivers/nvc0/nvc0_context.c
@@ -169,6 +169,7 @@ nvc0_bufctx_add_resident(struct nvc0_context *nvc0, int ctx,
if (!resource->bo)
return;
+ nvc0->residents_size += sizeof(struct resident);
/* We don't need to reference the resource here, it will be referenced
* in the context/state, and bufctx will be reset when state changes.
@@ -190,6 +191,7 @@ nvc0_bufctx_del_resident(struct nvc0_context *nvc0, int ctx,
top = util_dynarray_pop_ptr(&nvc0->residents[ctx], struct resident);
if (rsd != top)
*rsd = *top;
+ nvc0->residents_size -= sizeof(struct resident);
break;
}
}
@@ -202,11 +204,15 @@ nvc0_bufctx_emit_relocs(struct nvc0_context *nvc0)
struct util_dynarray *array;
unsigned ctx, i, n;
+ n = nvc0->residents_size / sizeof(struct resident);
+ n += NVC0_SCREEN_RESIDENT_BO_COUNT;
+
+ MARK_RING(nvc0->screen->base.channel, n, n);
+
for (ctx = 0; ctx < NVC0_BUFCTX_COUNT; ++ctx) {
array = &nvc0->residents[ctx];
n = array->size / sizeof(struct resident);
- MARK_RING(nvc0->screen->base.channel, n, n);
for (i = 0; i < n; ++i) {
rsd = util_dynarray_element(array, struct resident, i);