summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/intel/intel_screen.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2012-03-06 11:05:20 -0800
committerEric Anholt <eric@anholt.net>2012-03-20 15:47:48 -0700
commitd09fce51f0cf91c9c07f69063fe2180cc319d8df (patch)
tree0bb755f97913dcb4823a9717f45b78db4aa39c83 /src/mesa/drivers/dri/intel/intel_screen.c
parent447aff5b027dfab3f52d31c0b61030007d139693 (diff)
downloadexternal_mesa3d-d09fce51f0cf91c9c07f69063fe2180cc319d8df.zip
external_mesa3d-d09fce51f0cf91c9c07f69063fe2180cc319d8df.tar.gz
external_mesa3d-d09fce51f0cf91c9c07f69063fe2180cc319d8df.tar.bz2
i965: Change the hiz-override env var to a driconf option.
The force-enable option is dropped, now that the hardware we were concerned about has HiZ on by default. Now, instead of doing INTEL_HIZ=0 to test disabling hiz, you can set hiz=false. v2: Disable separate stencil on gen6 when HIZ is turned off. (previously, this had to be done manually in addition). Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_screen.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_screen.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index 48762d0..229eeb1 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -57,6 +57,10 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_DESC(en, "Enable texture tiling")
DRI_CONF_OPT_END
+ DRI_CONF_OPT_BEGIN(hiz, bool, true)
+ DRI_CONF_DESC(en, "Enable Hierarchical Z on gen6+")
+ DRI_CONF_OPT_END
+
DRI_CONF_OPT_BEGIN(early_z, bool, false)
DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).")
DRI_CONF_OPT_END
@@ -86,7 +90,7 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_SECTION_END
DRI_CONF_END;
-const GLuint __driNConfigOptions = 13;
+const GLuint __driNConfigOptions = 14;
#include "intel_batchbuffer.h"
#include "intel_buffers.h"
@@ -620,29 +624,6 @@ intel_init_bufmgr(struct intel_screen *intelScreen)
}
/**
- * Override intel_screen.hw_has_hiz with environment variable INTEL_HIZ.
- *
- * Valid values for INTEL_HIZ are "0" and "1". If an invalid valid value is
- * encountered, a warning is emitted and INTEL_HIZ is ignored.
- */
-static void
-intel_override_hiz(struct intel_screen *intel)
-{
- const char *s = getenv("INTEL_HIZ");
- if (!s) {
- return;
- } else if (!strncmp("0", s, 2)) {
- intel->hw_has_hiz = false;
- } else if (!strncmp("1", s, 2)) {
- intel->hw_has_hiz = true;
- } else {
- fprintf(stderr,
- "warning: env variable INTEL_HIZ=\"%s\" has invalid value "
- "and is ignored", s);
- }
-}
-
-/**
* Override intel_screen.hw_has_separate_stencil with environment variable
* INTEL_SEPARATE_STENCIL.
*
@@ -761,7 +742,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
intelScreen->hw_has_separate_stencil = intelScreen->gen >= 6;
intelScreen->hw_must_use_separate_stencil = intelScreen->gen >= 7;
- intelScreen->hw_has_hiz = intelScreen->gen >= 6;
intelScreen->dri2_has_hiz = INTEL_DRI2_HAS_HIZ_UNKNOWN;
#if defined(I915_PARAM_HAS_LLC)
@@ -772,7 +752,6 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
intelScreen->hw_has_llc = intelScreen->gen >= 6;
#endif
- intel_override_hiz(intelScreen);
intel_override_separate_stencil(intelScreen);
api_mask = (1 << __DRI_API_OPENGL);