summaryrefslogtreecommitdiff
path: root/tests/gem_bad_blit.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-04-08 11:56:57 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-04-08 12:17:31 +0100
commit95374225e865da3a30153f73e8bb536700d15459 (patch)
treeab8797a6f255a0d76e5d8e7439b8fe4a9b34ca90 /tests/gem_bad_blit.c
parentcd64e193299be4b9733a5e804cedd99e2072830f (diff)
Enable compilation on non-Intel, non-DRM systems.
A few of the tools can be performed post-mortem from a different system, so it is useful to be able to compile those tools on those foreign systems. Obviously, any program to interact with the PCI device or talk to GEM will fail on a non-Intel system. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_bad_blit.c')
-rw-r--r--tests/gem_bad_blit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/gem_bad_blit.c b/tests/gem_bad_blit.c
index 9a52529e..362b5aca 100644
--- a/tests/gem_bad_blit.c
+++ b/tests/gem_bad_blit.c
@@ -63,7 +63,7 @@ struct intel_batchbuffer *batch;
#define BAD_GTT_DEST ((256*1024*1024)) /* past end of aperture */
static void
-bad_blit(drm_intel_bo *src_bo)
+bad_blit(drm_intel_bo *src_bo, uint32_t devid)
{
uint32_t src_pitch = 512, dst_pitch = 512;
uint32_t cmd_bits = 0;
@@ -100,10 +100,11 @@ bad_blit(drm_intel_bo *src_bo)
int main(int argc, char **argv)
{
drm_intel_bo *src;
+ uint32_t devid;
int fd;
fd = drm_open_any();
- intel_get_drm_devid(fd);
+ devid = intel_get_drm_devid(fd);
bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
drm_intel_bufmgr_gem_enable_reuse(bufmgr);
@@ -111,7 +112,7 @@ int main(int argc, char **argv)
src = drm_intel_bo_alloc(bufmgr, "src", 128 * 128, 4096);
- bad_blit(src);
+ bad_blit(src, devid);
intel_batchbuffer_free(batch);
drm_intel_bufmgr_destroy(bufmgr);