static void
store_test(int fd, int ring, int count)
{
	gem_require_ring(fd, ring);
	store_dword_loop(fd, ring, count, 1);
	store_dword_loop(fd, ring, count, 2);
	if (!igt_run_in_simulation()) {
		store_dword_loop(fd, ring, count, 3);
		store_dword_loop(fd, ring, count, 5);
		store_dword_loop(fd, ring, count, 7);
		store_dword_loop(fd, ring, count, 11);
		store_dword_loop(fd, ring, count, 13);
		store_dword_loop(fd, ring, count, 17);
		store_dword_loop(fd, ring, count, 19);
	}
}
int main(int argc, char **argv)
{
	int fd;
	int devid;

	if (argc != 1) {
		fprintf(stderr, "usage: %s\n", argv[0]);
		exit(-1);
	}

	fd = drm_open_any();
	devid = intel_get_drm_devid(fd);
	if (!HAS_BLT_RING(devid)) {
		fprintf(stderr, "inter ring check needs gen6+\n");
		return 77;
	}


	bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
	if (!bufmgr) {
		fprintf(stderr, "failed to init libdrm\n");
		exit(-1);
	}
	drm_intel_bufmgr_gem_enable_reuse(bufmgr);

	batch = intel_batchbuffer_alloc(bufmgr, devid);
	if (!batch) {
		fprintf(stderr, "failed to create batch buffer\n");
		exit(-1);
	}

	target_buffer = drm_intel_bo_alloc(bufmgr, "target bo", 4096, 4096);
	if (!target_buffer) {
		fprintf(stderr, "failed to alloc target buffer\n");
		exit(-1);
	}

	store_dword_loop(I915_EXEC_RENDER);

	drm_intel_bo_unreference(target_buffer);
	intel_batchbuffer_free(batch);
	drm_intel_bufmgr_destroy(bufmgr);

	close(fd);

	return 0;
}