Module: Mesa
Branch: 8.0
Commit: 7fe667a18dc864f4aa90417f16d791a898937c48
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=7fe667a18dc864f4aa90417f16d791a898937c48

Author: Eugeni Dodonov <eugeni.dodo...@intel.com>
Date:   Wed Feb  1 18:06:53 2012 -0200

intel: verify if hardware has LLC support

Rely on libdrm HAS_LLC parameter to verify if hardware supports it. In
case the libdrm version does not supports this check, fallback to older
way of detecting it which assumed that GPUs newer than GEN6 have it.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodo...@intel.com>
(cherry picked from commit 7def293204977c41ea35198af147f743a31b1889)

---

 src/mesa/drivers/dri/intel/intel_context.c |    1 +
 src/mesa/drivers/dri/intel/intel_context.h |    1 +
 src/mesa/drivers/dri/intel/intel_screen.c  |    8 ++++++++
 src/mesa/drivers/dri/intel/intel_screen.h  |    2 ++
 4 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_context.c 
b/src/mesa/drivers/dri/intel/intel_context.c
index ffd9536..d4bb8c7 100644
--- a/src/mesa/drivers/dri/intel/intel_context.c
+++ b/src/mesa/drivers/dri/intel/intel_context.c
@@ -628,6 +628,7 @@ intelInitContext(struct intel_context *intel,
    intel->has_separate_stencil = intel->intelScreen->hw_has_separate_stencil;
    intel->must_use_separate_stencil = 
intel->intelScreen->hw_must_use_separate_stencil;
    intel->has_hiz = intel->intelScreen->hw_has_hiz;
+   intel->has_llc = intel->intelScreen->hw_has_llc;
 
    memset(&ctx->TextureFormatSupported,
          0, sizeof(ctx->TextureFormatSupported));
diff --git a/src/mesa/drivers/dri/intel/intel_context.h 
b/src/mesa/drivers/dri/intel/intel_context.h
index 4d4e030..150e55f 100644
--- a/src/mesa/drivers/dri/intel/intel_context.h
+++ b/src/mesa/drivers/dri/intel/intel_context.h
@@ -213,6 +213,7 @@ struct intel_context
    bool has_separate_stencil;
    bool must_use_separate_stencil;
    bool has_hiz;
+   bool has_llc;
 
    int urb_size;
 
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c 
b/src/mesa/drivers/dri/intel/intel_screen.c
index 6990265..e6b749a 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -723,6 +723,14 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp)
    intelScreen->hw_has_hiz = intelScreen->gen >= 6;
    intelScreen->dri2_has_hiz = INTEL_DRI2_HAS_HIZ_UNKNOWN;
 
+#if defined(I915_PARAM_HAS_LLC)
+   intelScreen->hw_has_llc =
+      intel_get_boolean(intelScreen->driScrnPriv,
+              I915_PARAM_HAS_LLC);
+#else
+   intelScreen->hw_has_llc = intelScreen->gen >= 6;
+#endif
+
    intel_override_hiz(intelScreen);
    intel_override_separate_stencil(intelScreen);
 
diff --git a/src/mesa/drivers/dri/intel/intel_screen.h 
b/src/mesa/drivers/dri/intel/intel_screen.h
index 6c6b516..a6baf16 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.h
+++ b/src/mesa/drivers/dri/intel/intel_screen.h
@@ -116,6 +116,8 @@ struct intel_screen
 
    bool kernel_has_gen7_sol_reset;
 
+   bool hw_has_llc;
+
    bool no_vbo;
    dri_bufmgr *bufmgr;
    struct _mesa_HashTable *named_regions;

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to