summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_shader.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-09-16 20:22:09 +1000
committerDave Airlie <airlied@redhat.com>2010-09-17 10:57:49 +1000
commitf70f79f6f6027bdf2f7de09bb39e12a24420f338 (patch)
tree8ee84c9ddd557fddc10ee11837108eb23768235d /src/gallium/drivers/r600/r600_shader.c
parentec9d838aa56d2c4bc5649d7c26ac61abb6c4b9bb (diff)
r600g: attempt to abstract kernel bos from pipe driver.
introduce an abstraction layer between kernel bos and the winsys BOs. this is to allow plugging in pb manager with minimal disruption to pipe driver.
Diffstat (limited to 'src/gallium/drivers/r600/r600_shader.c')
-rw-r--r--src/gallium/drivers/r600/r600_shader.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index ad19238697..10f6d016a3 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -157,18 +157,19 @@ static int r600_pipe_shader(struct pipe_context *ctx, struct r600_context_state
struct r600_context *rctx = r600_context(ctx);
struct r600_shader *rshader = &rpshader->shader;
int r;
+ void *data;
/* copy new shader */
- radeon_bo_decref(rscreen->rw, rpshader->bo);
+ radeon_ws_bo_reference(rscreen->rw, &rpshader->bo, NULL);
rpshader->bo = NULL;
- rpshader->bo = radeon_bo(rscreen->rw, 0, rshader->bc.ndw * 4,
- 4096, NULL);
+ rpshader->bo = radeon_ws_bo(rscreen->rw, rshader->bc.ndw * 4,
+ 4096);
if (rpshader->bo == NULL) {
return -ENOMEM;
}
- radeon_bo_map(rscreen->rw, rpshader->bo);
- memcpy(rpshader->bo->data, rshader->bc.bytecode, rshader->bc.ndw * 4);
- radeon_bo_unmap(rscreen->rw, rpshader->bo);
+ data = radeon_ws_bo_map(rscreen->rw, rpshader->bo);
+ memcpy(data, rshader->bc.bytecode, rshader->bc.ndw * 4);
+ radeon_ws_bo_unmap(rscreen->rw, rpshader->bo);
/* build state */
rshader->flat_shade = rctx->flat_shade;
switch (rshader->processor_type) {