summaryrefslogtreecommitdiff
path: root/tests/gem_reloc_vs_gpu.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2011-12-04 13:57:56 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2011-12-04 14:19:30 +0100
commit09cba27fdc5fbcc82471b4d7ba41944e5a4865d4 (patch)
tree34af11d08d6fd6fefd65c8ceb25a9a7c5ce0b5ab /tests/gem_reloc_vs_gpu.c
parentb9629f2d8d21a47c383c718e41910cc61c7947a6 (diff)
tests/gem_reloc_vs_gpu: fixup this mess
- fixup pitch mess noticed by Chris Wilson. - we need to diable bo reuse otherwise the kernel won't do the relocs (we might get an already gtt-bound batch from the dummy load). Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/gem_reloc_vs_gpu.c')
-rw-r--r--tests/gem_reloc_vs_gpu.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index 3bf6d428..b56c3fb0 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -56,7 +56,6 @@ drm_intel_bo *dummy_bo;
drm_intel_bo *special_bo;
uint32_t devid;
int fd;
-unsigned pitch;
int special_reloc_ofs;
int special_batch_len;
@@ -103,7 +102,7 @@ static void create_special_bo(void)
special_batch_len = len*4;
}
-static void emit_dummy_load(void)
+static void emit_dummy_load(int pitch)
{
int i;
uint32_t tile_flags = 0;
@@ -155,7 +154,8 @@ int main(int argc, char **argv)
fd = drm_open_any();
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
- drm_intel_bufmgr_gem_enable_reuse(bufmgr);
+ /* disable reuse, otherwise the test fails */
+ //drm_intel_bufmgr_gem_enable_reuse(bufmgr);
devid = intel_get_drm_devid(fd);
batch = intel_batchbuffer_alloc(bufmgr, devid);
@@ -174,7 +174,8 @@ int main(int argc, char **argv)
for (i = 0; i < NUM_TARGET_BOS; i++) {
pc_target_bo[i] = drm_intel_bo_alloc(bufmgr, "special batch", 4096, 4096);
- emit_dummy_load();
+ emit_dummy_load(pitch);
+ assert(pc_target_bo[i]->offset == 0);
drm_intel_bo_emit_reloc(special_bo, special_reloc_ofs,
pc_target_bo[i],
0,