From a784d86508a4b609d12ca07986d43005ff2686ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 26 Apr 2012 12:07:54 +0200 Subject: [PATCH] r300g: use u_default_transfer_inline_write --- src/gallium/drivers/r300/r300_resource.c | 2 +- src/gallium/drivers/r300/r300_screen_buffer.c | 30 +------------------ src/gallium/drivers/r300/r300_texture.c | 2 +- 3 files changed, 3 insertions(+), 31 deletions(-) diff --git a/src/gallium/drivers/r300/r300_resource.c b/src/gallium/drivers/r300/r300_resource.c index 6593474b1f0..823bc0fa775 100644 --- a/src/gallium/drivers/r300/r300_resource.c +++ b/src/gallium/drivers/r300/r300_resource.c @@ -45,7 +45,7 @@ void r300_init_resource_functions(struct r300_context *r300) r300->context.transfer_flush_region = u_default_transfer_flush_region; r300->context.transfer_unmap = u_transfer_unmap_vtbl; r300->context.transfer_destroy = u_transfer_destroy_vtbl; - r300->context.transfer_inline_write = u_transfer_inline_write_vtbl; + r300->context.transfer_inline_write = u_default_transfer_inline_write; r300->context.create_surface = r300_create_surface; r300->context.surface_destroy = r300_surface_destroy; } diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c index bb2c7c14bd8..a3b09500d4b 100644 --- a/src/gallium/drivers/r300/r300_screen_buffer.c +++ b/src/gallium/drivers/r300/r300_screen_buffer.c @@ -140,34 +140,6 @@ static void r300_buffer_transfer_unmap( struct pipe_context *pipe, } } -static void r300_buffer_transfer_inline_write(struct pipe_context *pipe, - struct pipe_resource *resource, - unsigned level, - unsigned usage, - const struct pipe_box *box, - const void *data, - unsigned stride, - unsigned layer_stride) -{ - struct r300_context *r300 = r300_context(pipe); - struct radeon_winsys *rws = r300->screen->rws; - struct r300_resource *rbuf = r300_resource(resource); - uint8_t *map = NULL; - - if (rbuf->constant_buffer) { - memcpy(rbuf->constant_buffer + box->x, data, box->width); - return; - } - assert(rbuf->b.b.user_ptr == NULL); - - map = rws->buffer_map(rbuf->cs_buf, r300->cs, - PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE | usage); - - memcpy(map + box->x, data, box->width); - - rws->buffer_unmap(rbuf->cs_buf); -} - static const struct u_resource_vtbl r300_buffer_vtbl = { NULL, /* get_handle */ @@ -177,7 +149,7 @@ static const struct u_resource_vtbl r300_buffer_vtbl = r300_buffer_transfer_map, /* transfer_map */ NULL, /* transfer_flush_region */ r300_buffer_transfer_unmap, /* transfer_unmap */ - r300_buffer_transfer_inline_write /* transfer_inline_write */ + NULL /* transfer_inline_write */ }; struct pipe_resource *r300_buffer_create(struct pipe_screen *screen, diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 8c5ee058b9e..c9af04fac5d 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -863,7 +863,7 @@ static const struct u_resource_vtbl r300_texture_vtbl = r300_texture_transfer_map, /* transfer_map */ NULL, /* transfer_flush_region */ r300_texture_transfer_unmap, /* transfer_unmap */ - u_default_transfer_inline_write /* transfer_inline_write */ + NULL /* transfer_inline_write */ }; /* The common texture constructor. */ -- 2.30.2