diff options
author | Kenneth Graunke <[email protected]> | 2017-03-30 22:27:42 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2017-04-10 14:31:55 -0700 |
commit | 6368284a347d511f38109936d6a1b281e69ad782 (patch) | |
tree | 83b1429007113d5fb87c29bc8636047f0c0bc379 | |
parent | 6079f4f16e7711a02b85bcd4142ad1f24a4e0a9b (diff) |
i965: Make a screen::aperture_threshold field.
This is the threshold after which drm_intel_bufmgr_check_aperture_space
returns -ENOSPC, signalling that it thinks an execbuf is likely to fail
and we need to roll back and flush the batch.
We'll need this when we rewrite aperture space checking, shortly.
In the meantime, we can also use it in GLX_MESA_query_renderer.
Reviewed-by: Chris Wilson <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.c | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_screen.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index d009543e5d8..c973b448260 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -983,10 +983,8 @@ brw_query_renderer_integer(__DRIscreen *dri_screen, * assume that there's some fragmentation, and we start doing extra * flushing, etc. That's the big cliff apps will care about. */ - uint64_t aper_size = get_aperture_size(dri_screen->fd); - const unsigned gpu_mappable_megabytes = - (aper_size / (1024 * 1024)) * 3 / 4; + screen->aperture_threshold / (1024 * 1024); const long system_memory_pages = sysconf(_SC_PHYS_PAGES); const long system_page_size = sysconf(_SC_PAGE_SIZE); @@ -1860,6 +1858,8 @@ __DRIconfig **intelInitScreen2(__DRIscreen *dri_screen) screen->max_gtt_map_object_size = gtt_size / 4; } + screen->aperture_threshold = get_aperture_size(dri_screen->fd) * 3 / 4; + screen->hw_has_swizzling = intel_detect_swizzling(screen); screen->hw_has_timestamp = intel_detect_timestamp(screen); diff --git a/src/mesa/drivers/dri/i965/intel_screen.h b/src/mesa/drivers/dri/i965/intel_screen.h index 8c9ed1662b1..f6727d95cd7 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.h +++ b/src/mesa/drivers/dri/i965/intel_screen.h @@ -50,6 +50,9 @@ struct intel_screen uint64_t max_gtt_map_object_size; + /** Bytes of aperture usage beyond which execbuf is likely to fail. */ + uint64_t aperture_threshold; + bool no_hw; bool hw_has_swizzling; bool has_exec_fence; /**< I915_PARAM_HAS_EXEC_FENCE */ |