#define INTEL_BATCH_CLIPRECTS 0x2
#undef INTEL_RUN_SYNC
+#undef INTEL_MAP_BATCHBUFFER
struct intel_drm_batchbuffer
{
"gallium3d_batchbuffer",
batch->actual_size,
4096);
+
+#ifdef INTEL_MAP_BATCHBUFFER
drm_intel_bo_map(batch->bo, TRUE);
batch->base.map = batch->bo->virtual;
+#endif
memset(batch->base.map, 0, batch->actual_size);
batch->base.ptr = batch->base.map;
struct intel_drm_winsys *idws = intel_drm_winsys(iws);
struct intel_drm_batchbuffer *batch = CALLOC_STRUCT(intel_drm_batchbuffer);
+ batch->actual_size = idws->max_batch_size;
+
+#ifdef INTEL_MAP_BATCHBUFFER
batch->base.map = NULL;
+#else
+ batch->base.map = MALLOC(batch->actual_size);
+#endif
batch->base.ptr = NULL;
batch->base.size = 0;
batch->base.iws = iws;
- batch->actual_size = idws->max_batch_size;
-
intel_drm_batchbuffer_reset(batch);
return &batch->base;
used = batch->base.ptr - batch->base.map;
+#ifdef INTEL_MAP_BATCHBUFFER
drm_intel_bo_unmap(batch->bo);
+#else
+ drm_intel_bo_subdata(batch->bo, 0, used, batch->base.map);
+#endif
/* Do the sending to HW */
ret = drm_intel_bo_exec(batch->bo, used, NULL, 0, 0);
if (batch->bo)
drm_intel_bo_unreference(batch->bo);
- free(batch);
+#ifndef INTEL_MAP_BATCHBUFFER
+ FREE(batch->base.map);
+#endif
+ FREE(batch);
}
void intel_drm_winsys_init_batchbuffer_functions(struct intel_drm_winsys *idws)