summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_transfer.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-02-12 15:39:51 +1000
committerDave Airlie <airlied@redhat.com>2010-03-15 18:36:47 +1000
commit68e58a96e80865878e6881dc4d34fcc3ec24eb19 (patch)
treec99162561838bd949ba789d4a6f26286549f8560 /src/gallium/drivers/r300/r300_transfer.c
parenta899c5a76ee056e237b19d97afaadd84bca9649f (diff)
r300g: rebuild screen/winsys interface
This creates a cleaner winsys and drop the simple screen stuff. It makes r300g use pb_bufmgr structs. It also tries to avoid overheads from mapping too often. v5: clean warnings v6: break out of cache check on first buffer - since most likely the first busy one implies all after it are busy. v7: cleanup a bit v8-merged: drop cman for now to just get all the interface changes in first. rework to changes that happened upstream Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r300/r300_transfer.c')
-rw-r--r--src/gallium/drivers/r300/r300_transfer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_transfer.c b/src/gallium/drivers/r300/r300_transfer.c
index 495e3dee76..987a040698 100644
--- a/src/gallium/drivers/r300/r300_transfer.c
+++ b/src/gallium/drivers/r300/r300_transfer.c
@@ -26,6 +26,8 @@
#include "r300_texture.h"
#include "r300_screen.h"
+#include "r300_winsys.h"
+
#include "util/u_memory.h"
#include "util/u_format.h"
@@ -225,6 +227,7 @@ static void r300_tex_transfer_destroy(struct pipe_context *ctx,
static void* r300_transfer_map(struct pipe_context *ctx,
struct pipe_transfer *transfer)
{
+ struct r300_winsys_screen *rws = (struct r300_winsys_screen *)ctx->winsys;
struct r300_transfer *r300transfer = r300_transfer(transfer);
struct r300_texture *tex = (struct r300_texture*)transfer->texture;
char *map;
@@ -233,12 +236,12 @@ static void* r300_transfer_map(struct pipe_context *ctx,
if (r300transfer->detiled_texture) {
/* The detiled texture is of the same size as the region being mapped
* (no offset needed). */
- return pipe_buffer_map(ctx->screen,
+ return rws->buffer_map(rws,
r300transfer->detiled_texture->buffer,
pipe_transfer_buffer_flags(transfer));
} else {
/* Tiling is disabled. */
- map = pipe_buffer_map(ctx->screen, tex->buffer,
+ map = rws->buffer_map(rws, tex->buffer,
pipe_transfer_buffer_flags(transfer));
if (!map) {
@@ -254,13 +257,14 @@ static void* r300_transfer_map(struct pipe_context *ctx,
static void r300_transfer_unmap(struct pipe_context *ctx,
struct pipe_transfer *transfer)
{
+ struct r300_winsys_screen *rws = (struct r300_winsys_screen *)ctx->winsys;
struct r300_transfer *r300transfer = r300_transfer(transfer);
struct r300_texture *tex = (struct r300_texture*)transfer->texture;
if (r300transfer->detiled_texture) {
- pipe_buffer_unmap(ctx->screen, r300transfer->detiled_texture->buffer);
+ rws->buffer_unmap(rws, r300transfer->detiled_texture->buffer);
} else {
- pipe_buffer_unmap(ctx->screen, tex->buffer);
+ rws->buffer_unmap(rws, tex->buffer);
}
}