summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_texture.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-04-21 23:26:52 +0200
committerMarek Olšák <[email protected]>2013-04-23 20:26:20 +0200
commitb69207642079fe8ba33c594750415e8d9c66a06f (patch)
treef71b6cfd90363297b7f15c0acd55508267fc7a5a /src/gallium/drivers/r600/r600_texture.c
parent1ba46bbb4c99caa7e297f2ec6717e962765275cb (diff)
r600g: initialize CMASK and HTILE with the GPU using streamout
This fixes a crash when a resource cannot be mapped to the CPU's address space because it's too big. This puts a global pipe_context in r600_screen, which is guarded by a mutex, so that we can use pipe_context when there isn't one around. Hopefully our multi-context support is solid. Reviewed-by: Alex Deucher <[email protected]> NOTE: This is a candidate for the 9.1 branch.
Diffstat (limited to 'src/gallium/drivers/r600/r600_texture.c')
-rw-r--r--src/gallium/drivers/r600/r600_texture.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gallium/drivers/r600/r600_texture.c b/src/gallium/drivers/r600/r600_texture.c
index 98cb1189763..3a1f2fea831 100644
--- a/src/gallium/drivers/r600/r600_texture.c
+++ b/src/gallium/drivers/r600/r600_texture.c
@@ -480,10 +480,7 @@ r600_texture_create_object(struct pipe_screen *screen,
*/
R600_ERR("r600: failed to create bo for htile buffers\n");
} else {
- void *ptr;
- ptr = rscreen->ws->buffer_map(rtex->htile->cs_buf, NULL, PIPE_TRANSFER_WRITE);
- memset(ptr, 0x0, htile_size);
- rscreen->ws->buffer_unmap(rtex->htile->cs_buf);
+ r600_screen_clear_buffer(rscreen, &rtex->htile->b.b, 0, htile_size, 0);
}
}
@@ -505,9 +502,8 @@ r600_texture_create_object(struct pipe_screen *screen,
if (rtex->cmask_size) {
/* Initialize the cmask to 0xCC (= compressed state). */
- char *ptr = rscreen->ws->buffer_map(resource->cs_buf, NULL, PIPE_TRANSFER_WRITE);
- memset(ptr + rtex->cmask_offset, 0xCC, rtex->cmask_size);
- rscreen->ws->buffer_unmap(resource->cs_buf);
+ r600_screen_clear_buffer(rscreen, &rtex->resource.b.b,
+ rtex->cmask_offset, rtex->cmask_size, 0xCC);
}
if (rscreen->debug_flags & DBG_VM) {