summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2009-08-24 00:47:34 -0400
committerAlex Deucher <[email protected]>2009-08-24 00:47:34 -0400
commitf758a8bf2e155725507bfe75add1fa81ccb569ae (patch)
treed34ac83b7e09e1fc3b75960ce20cad2ab1bfb73c /src/mesa/drivers
parent436fb34369f29f4036c5403dcef68353c5ca10e1 (diff)
r600: switch to common cs functions
needed for dri2. Pulled from Dave's WIP patch.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r600/r600_cmdbuf.c10
-rw-r--r--src/mesa/drivers/dri/r600/r600_cmdbuf.h35
2 files changed, 14 insertions, 31 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
index 10ea7668963..a330d5b151c 100644
--- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c
+++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
@@ -74,11 +74,11 @@ static struct radeon_cs * r600_cs_create(struct radeon_cs_manager *csm,
return cs;
}
-int r600_cs_write_reloc(struct radeon_cs *cs,
- struct radeon_bo *bo,
- uint32_t read_domain,
- uint32_t write_domain,
- uint32_t flags)
+static int r600_cs_write_reloc(struct radeon_cs *cs,
+ struct radeon_bo *bo,
+ uint32_t read_domain,
+ uint32_t write_domain,
+ uint32_t flags)
{
struct r600_cs_reloc_legacy *relocs;
int i;
diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.h b/src/mesa/drivers/dri/r600/r600_cmdbuf.h
index 06eddf2eeef..eba43d37b6b 100644
--- a/src/mesa/drivers/dri/r600/r600_cmdbuf.h
+++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.h
@@ -134,40 +134,23 @@ struct r600_cs_reloc_legacy {
uint32_t *reloc_indices;
};
-extern int r600_cs_write_reloc(struct radeon_cs *cs,
- struct radeon_bo *bo,
- uint32_t read_domain,
- uint32_t write_domain,
- uint32_t flags);
-
-static inline void r600_cs_write_dword(struct radeon_cs *cs, uint32_t dword)
-{
- cs->packets[cs->cdw++] = dword;
- if (cs->section) {
- cs->section_cdw++;
- }
-}
-
struct radeon_cs_manager * r600_radeon_cs_manager_legacy_ctor(struct radeon_context *ctx);
/**
* Write one dword to the command buffer.
*/
-#define R600_OUT_BATCH(data) \
- do { \
- r600_cs_write_dword(b_l_rmesa->cmdbuf.cs, data);\
- } while(0)
+#define R600_OUT_BATCH(data) \
+do { \
+ radeon_cs_write_dword(b_l_rmesa->cmdbuf.cs, data); \
+} while(0)
/**
* Write n dwords from ptr to the command buffer.
*/
-#define R600_OUT_BATCH_TABLE(ptr,n) \
- do { \
- int _i; \
- for (_i=0; _i < n; _i++) {\
- r600_cs_write_dword(b_l_rmesa->cmdbuf.cs, ptr[_i]);\
- }\
- } while(0)
+#define R600_OUT_BATCH_TABLE(ptr,n) \
+do { \
+ radeon_cs_write_table(b_l_rmesa->cmdbuf.cs, ptr, n); \
+} while(0)
/**
* Write a relocated dword to the command buffer.
@@ -178,7 +161,7 @@ struct radeon_cs_manager * r600_radeon_cs_manager_legacy_ctor(struct radeon_cont
fprintf(stderr, "(%s:%s:%d) offset : %d\n", \
__FILE__, __FUNCTION__, __LINE__, offset); \
} \
- r600_cs_write_reloc(b_l_rmesa->cmdbuf.cs, \
+ radeon_cs_write_reloc(b_l_rmesa->cmdbuf.cs, \
bo, rd, wd, flags); \
} while(0)