The variable name states megabytes, while we calculate the amount in kilobytes. Correct this by dividing with the correct amount.
Cc: "10.0 10.1" <mesa-sta...@lists.freedesktop.org> Cc: Ian Romanick <ian.d.roman...@intel.com> Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> --- src/mesa/drivers/dri/i915/intel_screen.c | 2 +- src/mesa/drivers/dri/i965/intel_screen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 296df16..884fdb5 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -744,7 +744,7 @@ i915_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value) * (uint64_t) system_page_size; const unsigned system_memory_megabytes = - (unsigned) (system_memory_bytes / 1024); + (unsigned) (system_memory_bytes / (1024 * 1024)); value[0] = MIN2(system_memory_megabytes, gpu_mappable_megabytes); return 0; diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index b5b0294..07e6dea 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -846,7 +846,7 @@ brw_query_renderer_integer(__DRIscreen *psp, int param, unsigned int *value) * (uint64_t) system_page_size; const unsigned system_memory_megabytes = - (unsigned) (system_memory_bytes / 1024); + (unsigned) (system_memory_bytes / (1024 * 1024)); value[0] = MIN2(system_memory_megabytes, gpu_mappable_megabytes); return 0; -- 1.9.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev