intel: add a command buffer scratch bo
It is owned by intel_dev so that all command buffers can share it. Will be
used for workarounds.
diff --git a/icd/intel/dev.c b/icd/intel/dev.c
index 407c531..3613f54 100644
--- a/icd/intel/dev.c
+++ b/icd/intel/dev.c
@@ -98,6 +98,13 @@
return XGL_ERROR_UNKNOWN;
}
+ dev->cmd_scratch_bo = intel_winsys_alloc_buffer(dev->winsys,
+ "command buffer scratch", 4096, INTEL_DOMAIN_INSTRUCTION);
+ if (!dev->cmd_scratch_bo) {
+ intel_dev_destroy(dev);
+ return XGL_ERROR_OUT_OF_GPU_MEMORY;
+ }
+
ret = dev_create_queues(dev, info->pRequestedQueues,
info->queueRecordCount);
if (ret != XGL_SUCCESS) {
@@ -137,6 +144,9 @@
intel_queue_destroy(dev->queues[i]);
}
+ if (dev->cmd_scratch_bo)
+ intel_bo_unreference(dev->cmd_scratch_bo);
+
if (dev->winsys)
intel_winsys_destroy(dev->winsys);