summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2010-12-04 04:36:02 +0100
committerMarek Olšák <[email protected]>2010-12-05 05:47:10 +0100
commit6947e5254889b99bfba7104d15e9526a7bc1cdfa (patch)
tree05227949ee9464928136b0abccdbda628c69a6ce /src/gallium/drivers/r300
parentc1365606c5b89872af4a0931e20f5cb78875eea6 (diff)
r300g: cleanup winsys
Diffstat (limited to 'src/gallium/drivers/r300')
-rw-r--r--src/gallium/drivers/r300/r300_blit.c2
-rw-r--r--src/gallium/drivers/r300/r300_cs.h8
-rw-r--r--src/gallium/drivers/r300/r300_defines.h4
-rw-r--r--src/gallium/drivers/r300/r300_render.c4
-rw-r--r--src/gallium/drivers/r300/r300_winsys.h5
5 files changed, 12 insertions, 11 deletions
diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c
index c02a6924f52..9fc4910984b 100644
--- a/src/gallium/drivers/r300/r300_blit.c
+++ b/src/gallium/drivers/r300/r300_blit.c
@@ -230,7 +230,7 @@ static void r300_clear(struct pipe_context* pipe,
r300_get_num_cs_end_dwords(r300);
/* Reserve CS space. */
- if (dwords > (r300->cs->ndw - r300->cs->cdw)) {
+ if (dwords > (R300_MAX_CMDBUF_DWORDS - r300->cs->cdw)) {
r300->context.flush(&r300->context, 0, NULL);
}
diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h
index ea29fc565b2..67fb0096a8c 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -51,7 +51,7 @@
int cs_count = 0; (void) cs_count; (void) cs_winsys;
#define BEGIN_CS(size) do { \
- assert(size <= (cs_copy->ndw - cs_copy->cdw)); \
+ assert(size <= (R300_MAX_CMDBUF_DWORDS - cs_copy->cdw)); \
CS_DEBUG(cs_count = size;) \
} while (0)
@@ -72,7 +72,7 @@
*/
#define OUT_CS(value) do { \
- cs_copy->ptr[cs_copy->cdw++] = (value); \
+ cs_copy->buf[cs_copy->cdw++] = (value); \
CS_DEBUG(cs_count--;) \
} while (0)
@@ -96,7 +96,7 @@
OUT_CS(CP_PACKET3(op, count))
#define OUT_CS_TABLE(values, count) do { \
- memcpy(cs_copy->ptr + cs_copy->cdw, values, count * 4); \
+ memcpy(cs_copy->buf + cs_copy->cdw, values, count * 4); \
cs_copy->cdw += count; \
CS_DEBUG(cs_count -= count;) \
} while (0)
@@ -136,7 +136,7 @@
#define WRITE_CS_TABLE(values, count) do { \
CS_DEBUG(assert(cs_count == 0);) \
- memcpy(cs_copy->ptr + cs_copy->cdw, (values), (count) * 4); \
+ memcpy(cs_copy->buf + cs_copy->cdw, (values), (count) * 4); \
cs_copy->cdw += (count); \
} while (0)
diff --git a/src/gallium/drivers/r300/r300_defines.h b/src/gallium/drivers/r300/r300_defines.h
index 896aeef395d..2d111f9158d 100644
--- a/src/gallium/drivers/r300/r300_defines.h
+++ b/src/gallium/drivers/r300/r300_defines.h
@@ -43,8 +43,8 @@ enum r300_buffer_tiling {
};
enum r300_buffer_domain { /* bitfield */
- R300_DOMAIN_GTT = 1,
- R300_DOMAIN_VRAM = 2
+ R300_DOMAIN_GTT = 2,
+ R300_DOMAIN_VRAM = 4
};
#endif
diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c
index e8542db4ca3..6a301d8ec50 100644
--- a/src/gallium/drivers/r300/r300_render.c
+++ b/src/gallium/drivers/r300/r300_render.c
@@ -205,7 +205,7 @@ static boolean r300_reserve_cs_dwords(struct r300_context *r300,
cs_dwords += r300_get_num_cs_end_dwords(r300);
/* Reserve requested CS space. */
- if (cs_dwords > (r300->cs->ndw - r300->cs->cdw)) {
+ if (cs_dwords > (R300_MAX_CMDBUF_DWORDS - r300->cs->cdw)) {
r300->context.flush(&r300->context, 0, NULL);
flushed = TRUE;
}
@@ -959,7 +959,7 @@ static void r300_render_draw_elements(struct vbuf_render* render,
end_cs_dwords = r300_get_num_cs_end_dwords(r300);
while (count) {
- free_dwords = r300->cs->ndw - r300->cs->cdw;
+ free_dwords = R300_MAX_CMDBUF_DWORDS - r300->cs->cdw;
short_count = MIN2(count, (free_dwords - end_cs_dwords - 6) * 2);
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index c45888dbf38..0dd330d101f 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -33,6 +33,8 @@
#include "r300_defines.h"
+#define R300_MAX_CMDBUF_DWORDS (16 * 1024)
+
struct winsys_handle;
struct r300_winsys_screen;
@@ -40,9 +42,8 @@ struct r300_winsys_buffer; /* for map/unmap etc. */
struct r300_winsys_cs_buffer; /* for write_reloc etc. */
struct r300_winsys_cs {
- uint32_t *ptr; /* Pointer to the beginning of the CS. */
unsigned cdw; /* Number of used dwords. */
- unsigned ndw; /* Size of the CS in dwords. */
+ uint32_t *buf; /* The command buffer. */
};
enum r300_value_id {