Implement gtt size query
Change-Id: Ib49beacafc6dfb4cc810246fc1668398f9e0c13a
diff --git a/src/intel/vulkan/anv_magma.cc b/src/intel/vulkan/anv_magma.cc
index 77f598d..4cd384c 100644
--- a/src/intel/vulkan/anv_magma.cc
+++ b/src/intel/vulkan/anv_magma.cc
@@ -131,13 +131,16 @@
int anv_gem_get_context_param(int fd, int context, uint32_t param, uint64_t* value)
{
- if (param == I915_CONTEXT_PARAM_GTT_SIZE) {
- // TODO(MA-311) - query for this
- *value = 8ull * 1024ull * 1024ull;
+ magma_status_t status;
+ switch (param) {
+ case I915_CONTEXT_PARAM_GTT_SIZE:
+ status = magma_query(fd, kMsdIntelGenQueryGttSize, value);
+ if (status != MAGMA_STATUS_OK)
+ return DRET_MSG(-1, "magma_query failed: %d", status);
return 0;
+ default:
+ return DRET_MSG(-1, "anv_gem_get_context_param: unhandled param 0x%x", param);
}
- DLOG("anv_gem_get_context_param: unhandled param 0x%x", param);
- return -1;
}
int anv_gem_execbuffer(anv_device* device, drm_i915_gem_execbuffer2* execbuf,