summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2014-02-22 03:04:02 +0000
committerCarl Worth <[email protected]>2014-03-11 11:49:51 -0700
commit6a81f2bc9b024c33fbcb15ea2215dd407dea8c9c (patch)
tree28e34a824058667636d1102f8d3ef84b3b0d3888 /src/mesa/drivers
parenta02c50ef4e9fa1d2bbb5d8ef05ef67b9d74ed075 (diff)
dri/i9*5: correctly calculate the amount of system memory
The variable name states megabytes, while we calculate the amount in kilobytes. Correct this by dividing with the correct amount. Signed-off-by: Emil Velikov <[email protected]> Cc: "10.0 10.1" <[email protected]> Reviewed-by: Ian Romanick <[email protected]> (cherry picked from commit fc25956badb8e1932cc19d8c97b4be16e92dfc65)
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i915/intel_screen.c2
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c2
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 3c46a2696ab..fbafe5b32fc 100644
--- a/src/mesa/drivers/dri/i915/intel_screen.c
+++ b/src/mesa/drivers/dri/i915/intel_screen.c
@@ -741,7 +741,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 6bbd6ddbe46..b16ca90c510 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -843,7 +843,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;