All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] sna: check for LLC support
@ 2012-01-17 18:05 Eugeni Dodonov
  2012-01-17 18:05 ` [PATCH 2/2] configure: check for libdrm >= 2.4.31 Eugeni Dodonov
  2012-01-17 18:16 ` [PATCH] sna: check for LLC support Eugeni Dodonov
  0 siblings, 2 replies; 5+ messages in thread
From: Eugeni Dodonov @ 2012-01-17 18:05 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eugeni Dodonov

Instead of checking for CPU generation, use the libdrm-provided
I915_PARAM_HAS_LLC instead.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
---
 src/sna/kgem.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 970e462..96c5ddd 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -603,8 +603,8 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
 	     kgem->has_relaxed_fencing));
 
 	kgem->has_llc = false;
-	if (!DBG_NO_LLC && gen >= 60)
-		kgem->has_llc = true;
+	if (!DBG_NO_LLC)
+		kgem->has_llc = gem_param(kgem, I915_PARAM_HAS_LLC);
 	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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] configure: check for libdrm >= 2.4.31
  2012-01-17 18:05 [PATCH 1/2] sna: check for LLC support Eugeni Dodonov
@ 2012-01-17 18:05 ` Eugeni Dodonov
  2012-01-17 18:16 ` [PATCH] sna: check for LLC support Eugeni Dodonov
  1 sibling, 0 replies; 5+ messages in thread
From: Eugeni Dodonov @ 2012-01-17 18:05 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eugeni Dodonov

This is requried for I915_PARAM_HAS_LLC support.

Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
---
 configure.ac |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 63beb64..604ea6d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,6 +132,7 @@ required_pixman_version=0.24
 if test "x$SNA" != "xno"; then
 	required_xorg_xserver_version=1.10
 	AC_DEFINE(USE_SNA, 1, [Enable SNA support])
+	PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= 2.4.31])
 fi
 AC_MSG_RESULT([$SNA])
 
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] sna: check for LLC support
  2012-01-17 18:05 [PATCH 1/2] sna: check for LLC support Eugeni Dodonov
  2012-01-17 18:05 ` [PATCH 2/2] configure: check for libdrm >= 2.4.31 Eugeni Dodonov
@ 2012-01-17 18:16 ` Eugeni Dodonov
  2012-01-17 18:37   ` Daniel Vetter
  2012-01-17 18:44   ` Chris Wilson
  1 sibling, 2 replies; 5+ messages in thread
From: Eugeni Dodonov @ 2012-01-17 18:16 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eugeni Dodonov

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 <eugeni.dodonov@intel.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] sna: check for LLC support
  2012-01-17 18:16 ` [PATCH] sna: check for LLC support Eugeni Dodonov
@ 2012-01-17 18:37   ` Daniel Vetter
  2012-01-17 18:44   ` Chris Wilson
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2012-01-17 18:37 UTC (permalink / raw)
  To: Eugeni Dodonov; +Cc: intel-gfx

On Tue, Jan 17, 2012 at 04:16:37PM -0200, Eugeni Dodonov wrote:
> 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 <eugeni.dodonov@intel.com>
> ---
>  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);

I still think you want the fallback to use the heuristics here in case we
have a new libdrm, but an old kernel lacking the param.
-Daniel

> +#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
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sna: check for LLC support
  2012-01-17 18:16 ` [PATCH] sna: check for LLC support Eugeni Dodonov
  2012-01-17 18:37   ` Daniel Vetter
@ 2012-01-17 18:44   ` Chris Wilson
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2012-01-17 18:44 UTC (permalink / raw)
  To: intel-gfx; +Cc: Eugeni Dodonov

On Tue, 17 Jan 2012 16:16:37 -0200, Eugeni Dodonov <eugeni.dodonov@intel.com> wrote:
> 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 <eugeni.dodonov@intel.com>

I attacked it slightly so that gem_param reported the lack of support so
that we could fallback to guessing by gen for GET_PARAM failure.
Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-17 18:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-17 18:05 [PATCH 1/2] sna: check for LLC support Eugeni Dodonov
2012-01-17 18:05 ` [PATCH 2/2] configure: check for libdrm >= 2.4.31 Eugeni Dodonov
2012-01-17 18:16 ` [PATCH] sna: check for LLC support Eugeni Dodonov
2012-01-17 18:37   ` Daniel Vetter
2012-01-17 18:44   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.