intel: verify if hardware has LLC support
authorEugeni Dodonov <eugeni.dodonov@intel.com>
Wed, 1 Feb 2012 20:06:53 +0000 (18:06 -0200)
committerEugeni Dodonov <eugeni.dodonov@intel.com>
Sat, 4 Feb 2012 20:21:22 +0000 (18:21 -0200)
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 <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_context.h
src/mesa/drivers/dri/intel/intel_screen.c
src/mesa/drivers/dri/intel/intel_screen.h

index 81ba6a195eae16a6014f3ff2d0fc7e560d54d28e..377bcbc066491e20ee61e0c3742d96a229d72aa2 100644 (file)
@@ -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));
index 4d4e03085e341f94b28b004751af3a5c1e5c8674..150e55f9797a02f0fafa5b462b1495eb07fad138 100644 (file)
@@ -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;
 
index 063bbe770d9a2e7b0a65bc762a36ffbf2046c808..60781e5a272e44824355e43f6b8d3ff44ab37f10 100644 (file)
@@ -735,6 +735,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);
 
index 6c6b516f23067016aa6e6c585dcc445f9919a1a4..a6baf1601b55c5a25b25a40632836003c32a4164 100644 (file)
@@ -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;