Mesa (staging/21.2): zink: simplify else clause for mem info gathering
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Aug 5 16:27:37 UTC 2021
Module: Mesa
Branch: staging/21.2
Commit: 260d1ecf1e072f6e8645bb2143bfcfd6f6afdbdb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=260d1ecf1e072f6e8645bb2143bfcfd6f6afdbdb
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Wed Aug 4 12:05:04 2021 -0400
zink: simplify else clause for mem info gathering
it doesn't matter if this is host-visible, it just has to not be device-local
Fixes: 73f6bff07f1 ("zink: fix mem info query to be more permissive")
Reviewed-by: Hoe Hao Cheng <haochengho12907 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12199>
(cherry picked from commit c886ce2991a5b6fec054810d0c891d599986593c)
---
.pick_status.json | 2 +-
src/gallium/drivers/zink/zink_screen.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/.pick_status.json b/.pick_status.json
index 474dc00a473..0083a0772d3 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -175,7 +175,7 @@
"description": "zink: simplify else clause for mem info gathering",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"main_sha": null,
"because_sha": "73f6bff07f1f3a5aa31e906cd69eeef58d95104c"
},
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index c9d8941cfa7..8d1a4ed3953 100644
--- a/src/gallium/drivers/zink/zink_screen.c
+++ b/src/gallium/drivers/zink/zink_screen.c
@@ -1647,7 +1647,7 @@ zink_query_memory_info(struct pipe_screen *pscreen, struct pipe_memory_info *inf
/* VRAM */
info->total_device_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
info->avail_device_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
- } else if (mem.memoryProperties.memoryHeaps[i].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+ } else {
/* GART */
info->total_staging_memory += mem.memoryProperties.memoryHeaps[i].size / 1024;
info->avail_staging_memory += (budget.heapBudget[i] - budget.heapUsage[i]) / 1024;
@@ -1661,7 +1661,7 @@ zink_query_memory_info(struct pipe_screen *pscreen, struct pipe_memory_info *inf
info->total_device_memory += screen->info.mem_props.memoryHeaps[i].size / 1024;
/* free real estate! */
info->avail_device_memory += info->total_device_memory;
- } else if (screen->info.mem_props.memoryHeaps[i].flags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) {
+ } else {
/* GART */
info->total_staging_memory += screen->info.mem_props.memoryHeaps[i].size / 1024;
/* free real estate! */
More information about the mesa-commit
mailing list