export INTEL_RESOURCE_STREAMER={0,1} To switch on/off resource streamer.
Signed-off-by: Abdiel Janulgue <[email protected]>
---
src/mesa/drivers/dri/i965/brw_context.h | 1 +
src/mesa/drivers/dri/i965/intel_context.c | 24 ++++++++++++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_context.h
b/src/mesa/drivers/dri/i965/brw_context.h
index c6e6655..1151163 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1059,6 +1059,7 @@ struct brw_context
bool has_negative_rhw_bug;
bool has_aa_line_parameters;
bool has_pln;
+ bool has_resource_streamer;
/**
* Some versions of Gen hardware don't do centroid interpolation correctly
diff --git a/src/mesa/drivers/dri/i965/intel_context.c
b/src/mesa/drivers/dri/i965/intel_context.c
index 4f96989..884acda 100644
--- a/src/mesa/drivers/dri/i965/intel_context.c
+++ b/src/mesa/drivers/dri/i965/intel_context.c
@@ -433,6 +433,29 @@ validate_context_version(struct intel_screen *screen,
return true;
}
+/**
+ * Toggles brw_context.has_resource_streamer with environment variable
+ * INTEL_RESOURCE_STREAMER.
+ */
+static void
+intel_resource_streamer(struct brw_context *brw)
+{
+ const char *s = getenv("INTEL_RESOURCE_STREAMER");
+ if (!s) {
+ brw->has_resource_streamer = false;
+ return;
+ } else if (!strncmp("0", s, 2)) {
+ brw->has_resource_streamer = false;
+ } else if (!strncmp("1", s, 2)) {
+ brw->has_resource_streamer = true;
+ } else {
+ brw->has_resource_streamer = false;
+ fprintf(stderr,
+ "warning: env variable INTEL_RESOURCE_STREAMER=\"%s\" has "
+ "invalid value and is ignored", s);
+ }
+}
+
bool
intelInitContext(struct brw_context *brw,
int api,
@@ -500,6 +523,7 @@ intelInitContext(struct brw_context *brw,
if (IS_HASWELL(devID)) {
brw->is_haswell = true;
+ intel_resource_streamer(brw);
} else if (IS_BAYTRAIL(devID)) {
brw->is_baytrail = true;
brw->gt = 1;
--
1.7.9.5
_______________________________________________
mesa-dev mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-dev