summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2010-06-02 05:50:58 +0200
committerMarek Olšák <maraeo@gmail.com>2010-06-02 06:01:22 +0200
commit37f3454eb3afa1297126a8d77a563d734c292a37 (patch)
treeecef6b95adaf132fef15fd23caa7daed86a018f7 /src/gallium/drivers/r300
parentae3063066cb209efd07413f125bb86108906b033 (diff)
r300g: let the driver determine the GEM domain for buffer_create
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_defines.h5
-rw-r--r--src/gallium/drivers/r300/r300_screen_buffer.c2
-rw-r--r--src/gallium/drivers/r300/r300_texture.c4
-rw-r--r--src/gallium/drivers/r300/r300_winsys.h3
4 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/drivers/r300/r300_defines.h b/src/gallium/drivers/r300/r300_defines.h
index 4b1c370726..83c9ec7e39 100644
--- a/src/gallium/drivers/r300/r300_defines.h
+++ b/src/gallium/drivers/r300/r300_defines.h
@@ -45,4 +45,9 @@ enum r300_buffer_tiling {
R300_BUFFER_SQUARETILED
};
+enum r300_buffer_domain { /* bitfield */
+ R300_DOMAIN_GTT = 1,
+ R300_DOMAIN_VRAM = 2
+};
+
#endif
diff --git a/src/gallium/drivers/r300/r300_screen_buffer.c b/src/gallium/drivers/r300/r300_screen_buffer.c
index 3e2b5afe6f..de89f51f3e 100644
--- a/src/gallium/drivers/r300/r300_screen_buffer.c
+++ b/src/gallium/drivers/r300/r300_screen_buffer.c
@@ -125,7 +125,7 @@ r300_winsys_buffer_create(struct r300_screen *r300screen,
struct r300_winsys_screen *rws = r300screen->rws;
struct r300_winsys_buffer *buf;
- buf = rws->buffer_create(rws, alignment, usage, size);
+ buf = rws->buffer_create(rws, alignment, usage, R300_DOMAIN_GTT, size);
return buf;
}
diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c
index a4b5d34ce1..8572334f91 100644
--- a/src/gallium/drivers/r300/r300_texture.c
+++ b/src/gallium/drivers/r300/r300_texture.c
@@ -959,9 +959,9 @@ struct pipe_resource* r300_texture_create(struct pipe_screen* screen,
base->width0, base->height0, base->depth0, base->last_level,
util_format_short_name(base->format));
- tex->buffer = rws->buffer_create(rws, 2048,
- base->bind,
+ tex->buffer = rws->buffer_create(rws, 2048, base->bind, R300_DOMAIN_VRAM,
tex->size);
+
rws->buffer_set_tiling(rws, tex->buffer,
tex->pitch[0] * util_format_get_blocksize(tex->b.b.format),
tex->microtile,
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index f7cbbde410..d59a45a00a 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -74,8 +74,9 @@ struct r300_winsys_screen {
struct r300_winsys_buffer *(*buffer_create)(struct r300_winsys_screen *ws,
unsigned alignment,
unsigned usage,
+ enum r300_buffer_domain domain,
unsigned size);
-
+
/**
* Map the entire data store of a buffer object into the client's address.
* flags is bitmask of R300_WINSYS_BUFFER_USAGE_CPU_READ/WRITE flags.