From: Eugeni Dodonov Subject: [PATCH] sna: check for LLC support Date: Tue, 17 Jan 2012 16:16:37 -0200 Message-ID: <1326824197-4553-1-git-send-email-eugeni.dodonov@intel.com> References: <1326823549-18789-1-git-send-email-eugeni.dodonov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from oproxy1-pub.bluehost.com (oproxy1-pub.bluehost.com [66.147.249.253]) by gabe.freedesktop.org (Postfix) with SMTP id 5F7AD9E7C8 for ; Tue, 17 Jan 2012 10:19:23 -0800 (PST) In-Reply-To: <1326823549-18789-1-git-send-email-eugeni.dodonov@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: Eugeni Dodonov List-Id: intel-gfx@lists.freedesktop.org Instead of checking for CPU generation, use the libdrm-provided I915_PARAM_HAS_LLC instead. v2: use a define check to verify if we have I915_PARAM_HAS_LLC. Signed-off-by: Eugeni Dodonov --- src/sna/kgem.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 970e462..aa9029d 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -603,8 +603,20 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen) kgem->has_relaxed_fencing)); kgem->has_llc = false; +#ifdef I915_PARAM_HAS_LLC + if (!DBG_NO_LLC) + kgem->has_llc = gem_param(kgem, I915_PARAM_HAS_LLC); +#else + /* If I915_PARAM_HAS_LLC is not defined by the libdrm, fallback + * to previous GPU generation check and assume that GPUs superior + * to Gen6 support it. + */ + DBG(("%s: libdrm does not provides I915_PARAM_HAS_LLC, detect GPU gen instead\n", + __FUNCTION__)); if (!DBG_NO_LLC && gen >= 60) kgem->has_llc = true; +#endif + kgem->has_cpu_bo = kgem->has_llc; DBG(("%s: cpu bo enabled %d: llc? %d\n", __FUNCTION__, kgem->has_cpu_bo, kgem->has_llc)); -- 1.7.8.3