summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2009-01-29 21:43:15 -0500
committerZack Rusin <[email protected]>2009-01-29 21:43:15 -0500
commitb3028acd98e2b7fd09344f9005c5b20bba91262c (patch)
tree78fcf2c5088b69e2fd4f31bea305a36581080e56 /src/gallium/drivers/nv50
parent444e98de31c5456008a4b3568373db02ddc5385f (diff)
gallium: give the screen priority when it comes to buffer allocations
allows the driver to overwrite buffer allocation, first step on the way to making winsys interface internal to the drivers. state trackers and the code above it will go through the screen
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c4
-rw-r--r--src/gallium/drivers/nv50/nv50_program.c6
-rw-r--r--src/gallium/drivers/nv50/nv50_query.c8
-rw-r--r--src/gallium/drivers/nv50/nv50_screen.c6
-rw-r--r--src/gallium/drivers/nv50/nv50_surface.c4
-rw-r--r--src/gallium/drivers/nv50/nv50_vbo.c2
6 files changed, 15 insertions, 15 deletions
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 7770fcc3f2a..3965dad5ade 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -88,14 +88,14 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
size = align(size, 64);
size *= align(pt->height[l], 8) * pt->block.size;
- lvl->image[i] = ws->buffer_create(ws, 256, 0, size);
+ lvl->image[i] = ws->_buffer_create(ws, 256, 0, size);
lvl->image_offset[i] = mt->total_size;
mt->total_size += size;
}
}
- mt->buffer = ws->buffer_create(ws, 256, usage, mt->total_size);
+ mt->buffer = ws->_buffer_create(ws, 256, usage, mt->total_size);
if (!mt->buffer) {
FREE(mt);
return NULL;
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 7686f746eb2..73867cf6757 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -1581,11 +1581,11 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p)
}
if (p->param_nr) {
- float *map = ws->buffer_map(ws, nv50->constbuf[p->type],
+ float *map = ws->_buffer_map(ws, nv50->constbuf[p->type],
PIPE_BUFFER_USAGE_CPU_READ);
nv50_program_upload_data(nv50, map, p->data->start,
p->param_nr);
- ws->buffer_unmap(ws, nv50->constbuf[p->type]);
+ ws->_buffer_unmap(ws, nv50->constbuf[p->type]);
}
if (p->immd_nr) {
@@ -1606,7 +1606,7 @@ nv50_program_validate_code(struct nv50_context *nv50, struct nv50_program *p)
boolean upload = FALSE;
if (!p->buffer) {
- p->buffer = ws->buffer_create(ws, 0x100, 0, p->exec_size * 4);
+ p->buffer = ws->_buffer_create(ws, 0x100, 0, p->exec_size * 4);
upload = TRUE;
}
diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c
index b923c820eba..b0fb346ba1a 100644
--- a/src/gallium/drivers/nv50/nv50_query.c
+++ b/src/gallium/drivers/nv50/nv50_query.c
@@ -47,7 +47,7 @@ nv50_query_create(struct pipe_context *pipe, unsigned type)
assert (q->type == PIPE_QUERY_OCCLUSION_COUNTER);
q->type = type;
- q->buffer = ws->buffer_create(ws, 256, 0, 16);
+ q->buffer = ws->_buffer_create(ws, 256, 0, 16);
if (!q->buffer) {
FREE(q);
return NULL;
@@ -62,7 +62,7 @@ nv50_query_destroy(struct pipe_context *pipe, struct pipe_query *pq)
struct nv50_query *q = nv50_query(pq);
if (q) {
- pipe_buffer_reference(pipe, &q->buffer, NULL);
+ pipe_buffer_reference(pipe->screen, &q->buffer, NULL);
FREE(q);
}
}
@@ -107,11 +107,11 @@ nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq,
*/
if (!q->ready) {
- uint32_t *map = ws->buffer_map(ws, q->buffer,
+ uint32_t *map = ws->_buffer_map(ws, q->buffer,
PIPE_BUFFER_USAGE_CPU_READ);
q->result = map[1];
q->ready = TRUE;
- ws->buffer_unmap(ws, q->buffer);
+ ws->_buffer_unmap(ws, q->buffer);
}
*result = q->result;
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index ef46233f839..3abacfc8d54 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -242,7 +242,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
so_data (so, 8);
/* Shared constant buffer */
- screen->constbuf = ws->buffer_create(ws, 0, 0, 128 * 4 * 4);
+ screen->constbuf = ws->_buffer_create(ws, 0, 0, 128 * 4 * 4);
if (nvws->res_init(&screen->vp_data_heap, 0, 128)) {
NOUVEAU_ERR("Error initialising constant buffer\n");
nv50_screen_destroy(&screen->pipe);
@@ -261,7 +261,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
* blocks. At some point we *may* want to go the NVIDIA way of doing
* things?
*/
- screen->tic = ws->buffer_create(ws, 0, 0, 32 * 8 * 4);
+ screen->tic = ws->_buffer_create(ws, 0, 0, 32 * 8 * 4);
so_method(so, screen->tesla, 0x1280, 3);
so_reloc (so, screen->tic, 0, NOUVEAU_BO_VRAM |
NOUVEAU_BO_RD | NOUVEAU_BO_HIGH, 0, 0);
@@ -275,7 +275,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_winsys *nvws)
NOUVEAU_BO_RD | NOUVEAU_BO_LOW, 0, 0);
so_data (so, 0x00000800);
- screen->tsc = ws->buffer_create(ws, 0, 0, 32 * 8 * 4);
+ screen->tsc = ws->_buffer_create(ws, 0, 0, 32 * 8 * 4);
so_method(so, screen->tesla, 0x1280, 3);
so_reloc (so, screen->tsc, 0, NOUVEAU_BO_VRAM |
NOUVEAU_BO_RD | NOUVEAU_BO_HIGH, 0, 0);
diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
index 3f45a2fe186..743eb6e2578 100644
--- a/src/gallium/drivers/nv50/nv50_surface.c
+++ b/src/gallium/drivers/nv50/nv50_surface.c
@@ -65,7 +65,7 @@ nv50_surface_map(struct pipe_screen *screen, struct pipe_surface *ps,
{
struct pipe_winsys *ws = screen->winsys;
- return ws->buffer_map(ws, ps->buffer, flags);
+ return ws->_buffer_map(ws, ps->buffer, flags);
}
static void
@@ -73,7 +73,7 @@ nv50_surface_unmap(struct pipe_screen *pscreen, struct pipe_surface *ps)
{
struct pipe_winsys *ws = pscreen->winsys;
- ws->buffer_unmap(ws, ps->buffer);
+ ws->_buffer_unmap(ws, ps->buffer);
}
void
diff --git a/src/gallium/drivers/nv50/nv50_vbo.c b/src/gallium/drivers/nv50/nv50_vbo.c
index c482a4c241e..86471c00e03 100644
--- a/src/gallium/drivers/nv50/nv50_vbo.c
+++ b/src/gallium/drivers/nv50/nv50_vbo.c
@@ -153,7 +153,7 @@ nv50_draw_elements(struct pipe_context *pipe,
{
struct nv50_context *nv50 = nv50_context(pipe);
struct pipe_winsys *ws = pipe->winsys;
- void *map = ws->buffer_map(ws, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ);
+ void *map = ws->_buffer_map(ws, indexBuffer, PIPE_BUFFER_USAGE_CPU_READ);
nv50_state_validate(nv50);