summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-08-26 12:17:44 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-08-26 12:17:44 -0400
commit490f640cd58d215281076ae6e0e70649db6b0ed5 (patch)
tree1f11913dd20369517957f8033f7afc26e169523f
parentf33853e56d841472f41db9c3c83276c3028a7375 (diff)
r600: make reloc_chunk size dynamic
-rw-r--r--src/mesa/drivers/dri/r600/r600_cmdbuf.c12
-rw-r--r--src/mesa/drivers/dri/r600/r700_render.c3
2 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
index 050d7bc6d0..1734b0a89f 100644
--- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c
+++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c
@@ -324,7 +324,7 @@ static int r600_cs_emit(struct radeon_cs *cs)
struct drm_radeon_cs_chunk cs_chunk[2];
uint32_t length_dw_reloc_chunk;
uint64_t chunk_ptrs[2];
- uint32_t reloc_chunk[256];
+ uint32_t *reloc_chunk;
int r;
int retry = 0;
@@ -333,8 +333,11 @@ static int r600_cs_emit(struct radeon_cs *cs)
csm->pending_count = 1;
- r = r600_cs_process_relocs(cs, &(reloc_chunk[0]), &length_dw_reloc_chunk);
+ reloc_chunk = (uint32_t*)calloc(1, cs->crelocs * 4 * 4);
+
+ r = r600_cs_process_relocs(cs, reloc_chunk, &length_dw_reloc_chunk);
if (r) {
+ free(reloc_chunk);
return 0;
}
@@ -346,7 +349,7 @@ static int r600_cs_emit(struct radeon_cs *cs)
/* reloc chaunk */
cs_chunk[1].chunk_id = RADEON_CHUNK_ID_RELOCS;
cs_chunk[1].length_dw = length_dw_reloc_chunk;
- cs_chunk[1].chunk_data = (unsigned long)&(reloc_chunk[0]);
+ cs_chunk[1].chunk_data = (unsigned long)reloc_chunk;
chunk_ptrs[0] = (uint64_t)(unsigned long)&(cs_chunk[0]);
chunk_ptrs[1] = (uint64_t)(unsigned long)&(cs_chunk[1]);
@@ -364,6 +367,7 @@ static int r600_cs_emit(struct radeon_cs *cs)
} while (r == -EAGAIN && retry < 1000);
if (r) {
+ free(reloc_chunk);
return r;
}
@@ -375,6 +379,8 @@ static int r600_cs_emit(struct radeon_cs *cs)
cs->csm->vram_write_used = 0;
cs->csm->gart_write_used = 0;
+ free(reloc_chunk);
+
return 0;
}
diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c
index d64e921bda..0b3ceb01ba 100644
--- a/src/mesa/drivers/dri/r600/r700_render.c
+++ b/src/mesa/drivers/dri/r600/r700_render.c
@@ -143,8 +143,7 @@ GLboolean r700SyncSurf(context_t *context,
R600_OUT_BATCH_RELOC(0,
pbo,
0,
- read_domain, write_domain, 0); // ???
-
+ read_domain, write_domain, 0);
END_BATCH();
COMMIT_BATCH();