summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2021-11-17 16:48:28 -0500
committerEric Engestrom <eric@engestrom.ch>2021-12-01 18:55:46 +0000
commitc2682955ff5456c88496fca7178331e473575469 (patch)
tree526fa13b756bf36531094720773f92f80e779519
parent5d130ac3ff51789075feea2a266f88b1028f24eb (diff)
zink: fix memory availability reporting
this shouldn't report the budgeted available memory, it should return the total memory, as that's what this api expects Fixes: ff4ba3d4a77 ("zink: support PIPE_CAP_QUERY_MEMORY_INFO") Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13849> (cherry picked from commit 72a88c77def2948e291427c963e2f4337bc059d4)
-rw-r--r--.pick_status.json2
-rw-r--r--src/gallium/drivers/zink/zink_screen.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/.pick_status.json b/.pick_status.json
index 022691f7eb7..288ce2751c4 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -2596,7 +2596,7 @@
"description": "zink: fix memory availability reporting",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "ff4ba3d4a77320d1522c3a807661511b4cc075ab"
},
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index c13f7608d90..42fc4ac4942 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -1706,11 +1706,11 @@ zink_query_memory_info(struct pipe_screen *pscreen, struct pipe_memory_info *inf
if (mem.memoryProperties.memoryHeaps[i].flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) {
/* VRAM */
info->total_device_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
- info->avail_device_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
+ info->avail_device_memory += (mem.memoryProperties.memoryHeaps[i].size - budget.heapUsage[i]) / 1024;
} else {
/* GART */
info->total_staging_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
- info->avail_staging_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
+ info->avail_staging_memory += (mem.memoryProperties.memoryHeaps[i].size - budget.heapUsage[i]) / 1024;
}
}
/* evictions not yet supported in vulkan */