summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-11-11 10:57:55 -0800
committerIan Romanick <[email protected]>2013-11-15 13:39:39 -0800
commit1e51d3a668a3032c028a3a35e04088c7e362adfb (patch)
tree230333ff505c471913ace69adbd86e8b3f82a62a /src/mesa/drivers/dri
parente5839c2397a0f99b9d5035b5989019feb48b856b (diff)
i965: Use drm_intel_get_aperture_sizes instead of hard-coded 2GiB
Systems with little physical memory installed will report less than 2GiB, and some systems may (hypothetically?) have a larger address space for the GPU. My IVB still reports 1534. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Cc: "10.0" <[email protected]> (cherry picked from commit cb6182bdfa7c8a5a773ec21112886f742df99840)
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 6bcfe2c3115..10ebfb10b8e 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -824,10 +824,14 @@ brw_query_renderer_integer(__DRIscreen *psp, int param, int *value)
/* Once a batch uses more than 75% of the maximum mappable size, we
* assume that there's some fragmentation, and we start doing extra
* flushing, etc. That's the big cliff apps will care about.
- *
- * Can only map 2G onto the GPU through the GTT.
*/
- const unsigned gpu_mappable_megabytes = 2 * 1024 * 3 / 4;
+ size_t aper_size;
+ size_t mappable_size;
+
+ drm_intel_get_aperture_sizes(psp->fd, &mappable_size, &aper_size);
+
+ const unsigned gpu_mappable_megabytes =
+ (aper_size / (1024 * 1024)) * 3 / 4;
const long system_memory_pages = sysconf(_SC_PHYS_PAGES);
const long system_page_size = sysconf(_SC_PAGE_SIZE);