Mesa (master): r300g: Add CS table writing.
Corbin Simpson
csimpson at kemper.freedesktop.org
Mon Apr 26 07:26:05 UTC 2010
Module: Mesa
Branch: master
Commit: c53142c3f46735f91b2f11308d08fa7e17edbf91
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c53142c3f46735f91b2f11308d08fa7e17edbf91
Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date: Mon Apr 26 00:08:46 2010 -0700
r300g: Add CS table writing.
---
src/gallium/drivers/r300/r300_cs.h | 7 +++++++
src/gallium/drivers/r300/r300_winsys.h | 4 ++++
src/gallium/winsys/radeon/drm/radeon_r300.c | 8 ++++++++
3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h
index 456b2ec..96f2825 100644
--- a/src/gallium/drivers/r300/r300_cs.h
+++ b/src/gallium/drivers/r300/r300_cs.h
@@ -104,6 +104,13 @@
cs_count--; \
} while (0)
+#define OUT_CS_TABLE(values, count) do { \
+ if (VERY_VERBOSE_REGISTERS) \
+ DBG(cs_context_copy, DBG_CS, "r300: writing table of %d dwords\n", count); \
+ cs_winsys->write_cs_table(cs_winsys, values, count); \
+ cs_count -= count; \
+} while (0)
+
#define OUT_CS_BUF_RELOC(bo, offset, rd, wd, flags) do { \
DBG(cs_context_copy, DBG_CS, "r300: writing relocation for buffer %p, offset %d, " \
"domains (%d, %d, %d)\n", \
diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h
index fa00a0c..60c4d18 100644
--- a/src/gallium/drivers/r300/r300_winsys.h
+++ b/src/gallium/drivers/r300/r300_winsys.h
@@ -119,6 +119,10 @@ struct r300_winsys_screen {
/* Write a dword to the command buffer. */
void (*write_cs_dword)(struct r300_winsys_screen* winsys, uint32_t dword);
+ /* Write a table of dwords to the command buffer. */
+ void (*write_cs_table)(struct r300_winsys_screen* winsys,
+ void *dwords, unsigned count);
+
/* Write a relocated dword to the command buffer. */
void (*write_cs_reloc)(struct r300_winsys_screen *winsys,
struct r300_winsys_buffer *buf,
diff --git a/src/gallium/winsys/radeon/drm/radeon_r300.c b/src/gallium/winsys/radeon/drm/radeon_r300.c
index 90675ad..cab41db 100644
--- a/src/gallium/winsys/radeon/drm/radeon_r300.c
+++ b/src/gallium/winsys/radeon/drm/radeon_r300.c
@@ -201,6 +201,13 @@ static void radeon_write_cs_dword(struct r300_winsys_screen *rws,
radeon_cs_write_dword(ws->cs, dword);
}
+static void radeon_write_cs_table(struct r300_winsys_screen *rws,
+ void *table, unsigned count)
+{
+ struct radeon_libdrm_winsys *ws = radeon_winsys_screen(rws);
+ radeon_cs_write_table(ws->cs, table, count);
+}
+
static void radeon_write_cs_reloc(struct r300_winsys_screen *rws,
struct r300_winsys_buffer *buf,
uint32_t rd,
@@ -322,6 +329,7 @@ radeon_setup_winsys(int fd, struct radeon_libdrm_winsys* ws)
ws->base.check_cs = radeon_check_cs;
ws->base.begin_cs = radeon_begin_cs;
ws->base.write_cs_dword = radeon_write_cs_dword;
+ ws->base.write_cs_table = radeon_write_cs_table;
ws->base.write_cs_reloc = radeon_write_cs_reloc;
ws->base.end_cs = radeon_end_cs;
ws->base.flush_cs = radeon_flush_cs;
More information about the mesa-commit
mailing list