From 472a34f74ff31c906cbd892dfeb2d01ec4f923d5 Mon Sep 17 00:00:00 2001 From: Eero Tamminen Date: Fri, 15 Dec 2023 21:36:31 +0200 Subject: [PATCH] gpu_sysman: fix minimum memory usage calculation Signed-off-by: Eero Tamminen --- src/gpu_sysman.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gpu_sysman.c b/src/gpu_sysman.c index 20e9b5d4e..0b4e04925 100644 --- a/src/gpu_sysman.c +++ b/src/gpu_sysman.c @@ -1169,10 +1169,10 @@ static bool gpu_mems(gpu_device_t *gpu, unsigned int cache_idx) { /* find min & max values for memory free from * (the configured number of) samples */ - uint64_t free_min = (uint64_t)0xffffffff; - uint64_t free_max = 0, mem_free; + uint64_t free_max = 0; + uint64_t free_min = mem_size; for (uint32_t j = 0; j < config.samples; j++) { - mem_free = gpu->memory[j][i].free; + uint64_t mem_free = gpu->memory[j][i].free; if (mem_free < free_min) { free_min = mem_free; } -- 2.47.2