summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-03-19 11:49:08 -0700
committerPaul Berry <[email protected]>2013-03-21 13:24:43 -0700
commiteea30dff43a5c9478e9e6056d0a8086b50a0bcb5 (patch)
tree04e0d97ea7b9c4608c7fcf259481b76dfaf4d875 /src/mesa/drivers/dri/intel
parent12dc4be8a66c92ce04637abc54ed85ac7ff9aa13 (diff)
i965: Add a driconf option to disable flush throttling.
Normally when submitting the first batch buffer after a flush, we check whether the GPU has completed processing of the first batch buffer of the previous frame. If it hasn't, we wait for it to finish before submitting any more batches. This prevents GPU-heavy and CPU-light applications from racing too far ahead of the current frame, but at the expense of possibly lower frame rates. Sometimes when benchmarking we want to disable this mechanism. This patch adds the driconf option "disable_throttling" to disable the throttling mechanism. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/intel')
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.c8
-rw-r--r--src/mesa/drivers/dri/intel/intel_context.h1
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c3
3 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c
index 2df70b75b47..bf4045eb3b6 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -440,7 +440,8 @@ intel_prepare_render(struct intel_context *intel)
* so we just us the first batch we emitted after the last swap.
*/
if (intel->need_throttle && intel->first_post_swapbuffers_batch) {
- drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
+ if (!intel->disable_throttling)
+ drm_intel_bo_wait_rendering(intel->first_post_swapbuffers_batch);
drm_intel_bo_unreference(intel->first_post_swapbuffers_batch);
intel->first_post_swapbuffers_batch = NULL;
intel->need_throttle = false;
@@ -841,6 +842,11 @@ intelInitContext(struct intel_context *intel,
intel->always_flush_cache = 1;
}
+ if (driQueryOptionb(&intel->optionCache, "disable_throttling")) {
+ fprintf(stderr, "disabling flush throttling\n");
+ intel->disable_throttling = 1;
+ }
+
return true;
}
diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h
index 2df15d4f3df..59cf1979f0e 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -285,6 +285,7 @@ struct intel_context
bool no_rast;
bool always_flush_batch;
bool always_flush_cache;
+ bool disable_throttling;
/* State for intelvb.c and inteltris.c.
*/
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 32e92594c08..3ca10c8e534 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -80,6 +80,7 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_NO_RAST(false)
DRI_CONF_ALWAYS_FLUSH_BATCH(false)
DRI_CONF_ALWAYS_FLUSH_CACHE(false)
+ DRI_CONF_DISABLE_THROTTLING(false)
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(false)
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS(false)
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED(false)
@@ -94,7 +95,7 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_SECTION_END
DRI_CONF_END;
-const GLuint __driNConfigOptions = 16;
+const GLuint __driNConfigOptions = 17;
#include "intel_batchbuffer.h"
#include "intel_buffers.h"