* [PATCH] drm/i915: add a LLC feature flag in device description
@ 2011-12-13 0:05 Eugeni Dodonov
2011-12-13 0:19 ` Chris Wilson
0 siblings, 1 reply; 9+ messages in thread
From: Eugeni Dodonov @ 2011-12-13 0:05 UTC (permalink / raw)
To: intel-gfx; +Cc: Eugeni Dodonov
LLC is not SNB-specific, so we should check for it in a more generic way.
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
---
drivers/gpu/drm/i915/i915_drv.c | 2 ++
drivers/gpu/drm/i915/i915_drv.h | 2 ++
drivers/gpu/drm/i915/i915_gem.c | 4 ++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e9c2cfe..b7ac903 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -214,6 +214,7 @@ static const struct intel_device_info intel_sandybridge_d_info = {
.need_gfx_hws = 1, .has_hotplug = 1,
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct intel_device_info intel_sandybridge_m_info = {
@@ -222,6 +223,7 @@ static const struct intel_device_info intel_sandybridge_m_info = {
.has_fbc = 1,
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct intel_device_info intel_ivybridge_d_info = {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 06a37f4..24969eb 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -247,6 +247,7 @@ struct intel_device_info {
u8 supports_tv:1;
u8 has_bsd_ring:1;
u8 has_blt_ring:1;
+ u8 has_llc:1;
};
enum no_fbc_reason {
@@ -960,6 +961,7 @@ struct drm_i915_file_private {
#define HAS_BSD(dev) (INTEL_INFO(dev)->has_bsd_ring)
#define HAS_BLT(dev) (INTEL_INFO(dev)->has_blt_ring)
+#define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc)
#define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws)
#define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d18b07a..2c0fa78 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3613,8 +3613,8 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
obj->base.write_domain = I915_GEM_DOMAIN_CPU;
obj->base.read_domains = I915_GEM_DOMAIN_CPU;
- if (IS_GEN6(dev)) {
- /* On Gen6, we can have the GPU use the LLC (the CPU
+ if (HAS_LLC(dev)) {
+ /* On some devices, we can have the GPU use the LLC (the CPU
* cache) for about a 10% performance improvement
* compared to uncached. Graphics requests other than
* display scanout are coherent with the CPU in
--
1.7.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 0:05 [PATCH] drm/i915: add a LLC feature flag in device description Eugeni Dodonov
@ 2011-12-13 0:19 ` Chris Wilson
2011-12-13 13:05 ` Eugeni Dodonov
0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2011-12-13 0:19 UTC (permalink / raw)
To: intel-gfx; +Cc: Eugeni Dodonov
On Mon, 12 Dec 2011 22:05:21 -0200, Eugeni Dodonov <eugeni.dodonov@intel.com> wrote:
> LLC is not SNB-specific, so we should check for it in a more generic way.
Also add it to debugfs i915_capabilities for completeness. It would also
be useful to inform userspace that the default is now LLC through a
GET_PARAM, not to mention the ability for userspace to query and set the
cache_level on bo.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 0:19 ` Chris Wilson
@ 2011-12-13 13:05 ` Eugeni Dodonov
2011-12-13 13:24 ` Chris Wilson
2011-12-13 16:09 ` Daniel Vetter
0 siblings, 2 replies; 9+ messages in thread
From: Eugeni Dodonov @ 2011-12-13 13:05 UTC (permalink / raw)
To: intel-gfx; +Cc: Eugeni Dodonov
From: Eugeni Dodonov <eugeni.dodonov@intel.com>
LLC is not SNB-specific, so we should check for it in a more generic way.
v2: export LLC support status via debugfs and DRM GETPARAM.
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 1 +
drivers/gpu/drm/i915/i915_dma.c | 3 +++
drivers/gpu/drm/i915/i915_drv.c | 2 ++
drivers/gpu/drm/i915/i915_drv.h | 2 ++
drivers/gpu/drm/i915/i915_gem.c | 4 ++--
include/drm/i915_drm.h | 1 +
6 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 4f40f1c..070dbd9 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -82,6 +82,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
B(supports_tv);
B(has_bsd_ring);
B(has_blt_ring);
+ B(has_llc);
#undef B
return 0;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index a9533c5..938ad57 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -781,6 +781,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_HAS_RELAXED_DELTA:
value = 1;
break;
+ case I915_PARAM_HAS_LLC:
+ value = HAS_LLC(dev);
+ break;
default:
DRM_DEBUG_DRIVER("Unknown parameter %d\n",
param->param);
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index e9c2cfe..b7ac903 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -214,6 +214,7 @@ static const struct intel_device_info intel_sandybridge_d_info = {
.need_gfx_hws = 1, .has_hotplug = 1,
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct intel_device_info intel_sandybridge_m_info = {
@@ -222,6 +223,7 @@ static const struct intel_device_info intel_sandybridge_m_info = {
.has_fbc = 1,
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct intel_device_info intel_ivybridge_d_info = {
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 06a37f4..24969eb 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -247,6 +247,7 @@ struct intel_device_info {
u8 supports_tv:1;
u8 has_bsd_ring:1;
u8 has_blt_ring:1;
+ u8 has_llc:1;
};
enum no_fbc_reason {
@@ -960,6 +961,7 @@ struct drm_i915_file_private {
#define HAS_BSD(dev) (INTEL_INFO(dev)->has_bsd_ring)
#define HAS_BLT(dev) (INTEL_INFO(dev)->has_blt_ring)
+#define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc)
#define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws)
#define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index d18b07a..2c0fa78 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3613,8 +3613,8 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
obj->base.write_domain = I915_GEM_DOMAIN_CPU;
obj->base.read_domains = I915_GEM_DOMAIN_CPU;
- if (IS_GEN6(dev)) {
- /* On Gen6, we can have the GPU use the LLC (the CPU
+ if (HAS_LLC(dev)) {
+ /* On some devices, we can have the GPU use the LLC (the CPU
* cache) for about a 10% performance improvement
* compared to uncached. Graphics requests other than
* display scanout are coherent with the CPU in
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 28c0d11..b34e630 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -291,6 +291,7 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_HAS_COHERENT_RINGS 13
#define I915_PARAM_HAS_EXEC_CONSTANTS 14
#define I915_PARAM_HAS_RELAXED_DELTA 15
+#define I915_PARAM_HAS_LLC 16
typedef struct drm_i915_getparam {
int param;
--
1.7.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 13:05 ` Eugeni Dodonov
@ 2011-12-13 13:24 ` Chris Wilson
2011-12-13 16:09 ` Daniel Vetter
1 sibling, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2011-12-13 13:24 UTC (permalink / raw)
To: Eugeni Dodonov, intel-gfx; +Cc: Eugeni Dodonov
On Tue, 13 Dec 2011 11:05:15 -0200, Eugeni Dodonov <eugeni@dodonov.net> wrote:
> From: Eugeni Dodonov <eugeni.dodonov@intel.com>
>
> LLC is not SNB-specific, so we should check for it in a more generic way.
>
> v2: export LLC support status via debugfs and DRM GETPARAM.
>
> Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
--
Chris Wilson, Intel Open Source Technology Centre
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 13:05 ` Eugeni Dodonov
2011-12-13 13:24 ` Chris Wilson
@ 2011-12-13 16:09 ` Daniel Vetter
2011-12-13 17:20 ` Eric Anholt
1 sibling, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2011-12-13 16:09 UTC (permalink / raw)
To: Eugeni Dodonov; +Cc: intel-gfx, Eugeni Dodonov
On Tue, Dec 13, 2011 at 11:05:15AM -0200, Eugeni Dodonov wrote:
> From: Eugeni Dodonov <eugeni.dodonov@intel.com>
>
> LLC is not SNB-specific, so we should check for it in a more generic way.
>
> v2: export LLC support status via debugfs and DRM GETPARAM.
>
> Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Nice patch and would get an r-b from me safe for the new GETPARAM. I
really think we need to export this on a per-bo basis (and with the caveat
that the kernel is free to change the caching on every ioctl that uses
it). I.e. without forcing userspace to check the caching bits before any
bo access I fear that we won't be able to change the kernel's behaviour in
this area, which surely results in backwards-compat hell when the first
w/a that needs such changes comes around. Hence in its current from
Nacked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
So please drop the GETPARAM. For the per-bo get_cache_flags ioctl there's
already a patch by Ben floating around.
-Daniel
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 16:09 ` Daniel Vetter
@ 2011-12-13 17:20 ` Eric Anholt
2011-12-13 17:57 ` Daniel Vetter
0 siblings, 1 reply; 9+ messages in thread
From: Eric Anholt @ 2011-12-13 17:20 UTC (permalink / raw)
To: Daniel Vetter, Eugeni Dodonov; +Cc: intel-gfx, Eugeni Dodonov
[-- Attachment #1.1: Type: text/plain, Size: 1467 bytes --]
On Tue, 13 Dec 2011 17:09:37 +0100, Daniel Vetter <daniel@ffwll.ch> wrote:
> On Tue, Dec 13, 2011 at 11:05:15AM -0200, Eugeni Dodonov wrote:
> > From: Eugeni Dodonov <eugeni.dodonov@intel.com>
> >
> > LLC is not SNB-specific, so we should check for it in a more generic way.
> >
> > v2: export LLC support status via debugfs and DRM GETPARAM.
> >
> > Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
>
> Nice patch and would get an r-b from me safe for the new GETPARAM. I
> really think we need to export this on a per-bo basis (and with the caveat
> that the kernel is free to change the caching on every ioctl that uses
> it). I.e. without forcing userspace to check the caching bits before any
> bo access I fear that we won't be able to change the kernel's behaviour in
> this area, which surely results in backwards-compat hell when the first
> w/a that needs such changes comes around. Hence in its current from
>
> Nacked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>
> So please drop the GETPARAM. For the per-bo get_cache_flags ioctl there's
> already a patch by Ben floating around.
The way the getparam would be useful is that right now we're taking some
different paths for performance reasons in Mesa on gen6, assuming that
LLC is present. Knowing whether or not we expect BOs in general to be
LLC for performance would be nice for that -- without that, I'll just
make assumptions based on chipset generation.
[-- Attachment #1.2: Type: application/pgp-signature, Size: 197 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 17:20 ` Eric Anholt
@ 2011-12-13 17:57 ` Daniel Vetter
2011-12-13 21:05 ` Eugeni Dodonov
0 siblings, 1 reply; 9+ messages in thread
From: Daniel Vetter @ 2011-12-13 17:57 UTC (permalink / raw)
To: Eric Anholt; +Cc: intel-gfx, Eugeni Dodonov
On Tue, Dec 13, 2011 at 09:20:40AM -0800, Eric Anholt wrote:
> On Tue, 13 Dec 2011 17:09:37 +0100, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Tue, Dec 13, 2011 at 11:05:15AM -0200, Eugeni Dodonov wrote:
> > > From: Eugeni Dodonov <eugeni.dodonov@intel.com>
> > >
> > > LLC is not SNB-specific, so we should check for it in a more generic way.
> > >
> > > v2: export LLC support status via debugfs and DRM GETPARAM.
> > >
> > > Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
> >
> > Nice patch and would get an r-b from me safe for the new GETPARAM. I
> > really think we need to export this on a per-bo basis (and with the caveat
> > that the kernel is free to change the caching on every ioctl that uses
> > it). I.e. without forcing userspace to check the caching bits before any
> > bo access I fear that we won't be able to change the kernel's behaviour in
> > this area, which surely results in backwards-compat hell when the first
> > w/a that needs such changes comes around. Hence in its current from
> >
> > Nacked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >
> > So please drop the GETPARAM. For the per-bo get_cache_flags ioctl there's
> > already a patch by Ben floating around.
>
> The way the getparam would be useful is that right now we're taking some
> different paths for performance reasons in Mesa on gen6, assuming that
> LLC is present. Knowing whether or not we expect BOs in general to be
> LLC for performance would be nice for that -- without that, I'll just
> make assumptions based on chipset generation.
Ok, I'll reconsider: In the mesa example (and any other use-case for llc
accelarated up/download) we don't depend upon llc for correctness and
we're using the caching on a newly created buffer, so the per-bo ioctls
aren't much use. So I think the backwards-compat mess is manageable if
people promise to use the HAS_LLC getparam only for such optimizations ...
I still think we want to full get/set_cache_level in additions to this.
But for this patch:
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
--
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 17:57 ` Daniel Vetter
@ 2011-12-13 21:05 ` Eugeni Dodonov
2012-01-16 21:55 ` Daniel Vetter
0 siblings, 1 reply; 9+ messages in thread
From: Eugeni Dodonov @ 2011-12-13 21:05 UTC (permalink / raw)
To: intel-gfx; +Cc: Eugeni Dodonov
From: Eugeni Dodonov <eugeni.dodonov@intel.com>
LLC is not SNB-specific, so we should check for it in a more generic way.
v2: export LLC support status via debugfs and DRM GETPARAM.
v3: rebase on newer kernel version which says that IVB supports LLC as
well.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 1 +
drivers/gpu/drm/i915/i915_dma.c | 3 +++
drivers/gpu/drm/i915/i915_drv.c | 4 ++++
drivers/gpu/drm/i915/i915_drv.h | 2 ++
drivers/gpu/drm/i915/i915_gem.c | 4 ++--
include/drm/i915_drm.h | 1 +
6 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index d09a6e0..cb8a153 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -82,6 +82,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
B(supports_tv);
B(has_bsd_ring);
B(has_blt_ring);
+ B(has_llc);
#undef B
return 0;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index a9533c5..938ad57 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -781,6 +781,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
case I915_PARAM_HAS_RELAXED_DELTA:
value = 1;
break;
+ case I915_PARAM_HAS_LLC:
+ value = HAS_LLC(dev);
+ break;
default:
DRM_DEBUG_DRIVER("Unknown parameter %d\n",
param->param);
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 15bfa91..19fb7a4 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -214,6 +214,7 @@ static const struct intel_device_info intel_sandybridge_d_info = {
.need_gfx_hws = 1, .has_hotplug = 1,
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct intel_device_info intel_sandybridge_m_info = {
@@ -222,6 +223,7 @@ static const struct intel_device_info intel_sandybridge_m_info = {
.has_fbc = 1,
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct intel_device_info intel_ivybridge_d_info = {
@@ -229,6 +231,7 @@ static const struct intel_device_info intel_ivybridge_d_info = {
.need_gfx_hws = 1, .has_hotplug = 1,
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct intel_device_info intel_ivybridge_m_info = {
@@ -237,6 +240,7 @@ static const struct intel_device_info intel_ivybridge_m_info = {
.has_fbc = 0, /* FBC is not enabled on Ivybridge mobile yet */
.has_bsd_ring = 1,
.has_blt_ring = 1,
+ .has_llc = 1,
};
static const struct pci_device_id pciidlist[] = { /* aka */
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 4a9c1b9..abbbf32 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -250,6 +250,7 @@ struct intel_device_info {
u8 supports_tv:1;
u8 has_bsd_ring:1;
u8 has_blt_ring:1;
+ u8 has_llc:1;
};
enum no_fbc_reason {
@@ -961,6 +962,7 @@ struct drm_i915_file_private {
#define HAS_BSD(dev) (INTEL_INFO(dev)->has_bsd_ring)
#define HAS_BLT(dev) (INTEL_INFO(dev)->has_blt_ring)
+#define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc)
#define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws)
#define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 60ff1b6..fb69337 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3620,8 +3620,8 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
obj->base.write_domain = I915_GEM_DOMAIN_CPU;
obj->base.read_domains = I915_GEM_DOMAIN_CPU;
- if (IS_GEN6(dev) || IS_GEN7(dev)) {
- /* On Gen6, we can have the GPU use the LLC (the CPU
+ if (HAS_LLC(dev)) {
+ /* On some devices, we can have the GPU use the LLC (the CPU
* cache) for about a 10% performance improvement
* compared to uncached. Graphics requests other than
* display scanout are coherent with the CPU in
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index 28c0d11..b34e630 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -291,6 +291,7 @@ typedef struct drm_i915_irq_wait {
#define I915_PARAM_HAS_COHERENT_RINGS 13
#define I915_PARAM_HAS_EXEC_CONSTANTS 14
#define I915_PARAM_HAS_RELAXED_DELTA 15
+#define I915_PARAM_HAS_LLC 16
typedef struct drm_i915_getparam {
int param;
--
1.7.7.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH] drm/i915: add a LLC feature flag in device description
2011-12-13 21:05 ` Eugeni Dodonov
@ 2012-01-16 21:55 ` Daniel Vetter
0 siblings, 0 replies; 9+ messages in thread
From: Daniel Vetter @ 2012-01-16 21:55 UTC (permalink / raw)
To: Eugeni Dodonov; +Cc: intel-gfx, Eugeni Dodonov
On Tue, Dec 13, 2011 at 07:05:41PM -0200, Eugeni Dodonov wrote:
> From: Eugeni Dodonov <eugeni.dodonov@intel.com>
>
> LLC is not SNB-specific, so we should check for it in a more generic way.
>
> v2: export LLC support status via debugfs and DRM GETPARAM.
>
> v3: rebase on newer kernel version which says that IVB supports LLC as
> well.
>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
The patch now conflicts with gen7 sol reset stuff. Care to rebase? Also
can you create a quick libdrm helper to check for llc support that returns
true for gen6&gen7 in the absence of this ioctl?
-Daniel
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 1 +
> drivers/gpu/drm/i915/i915_dma.c | 3 +++
> drivers/gpu/drm/i915/i915_drv.c | 4 ++++
> drivers/gpu/drm/i915/i915_drv.h | 2 ++
> drivers/gpu/drm/i915/i915_gem.c | 4 ++--
> include/drm/i915_drm.h | 1 +
> 6 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index d09a6e0..cb8a153 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -82,6 +82,7 @@ static int i915_capabilities(struct seq_file *m, void *data)
> B(supports_tv);
> B(has_bsd_ring);
> B(has_blt_ring);
> + B(has_llc);
> #undef B
>
> return 0;
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index a9533c5..938ad57 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -781,6 +781,9 @@ static int i915_getparam(struct drm_device *dev, void *data,
> case I915_PARAM_HAS_RELAXED_DELTA:
> value = 1;
> break;
> + case I915_PARAM_HAS_LLC:
> + value = HAS_LLC(dev);
> + break;
> default:
> DRM_DEBUG_DRIVER("Unknown parameter %d\n",
> param->param);
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 15bfa91..19fb7a4 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -214,6 +214,7 @@ static const struct intel_device_info intel_sandybridge_d_info = {
> .need_gfx_hws = 1, .has_hotplug = 1,
> .has_bsd_ring = 1,
> .has_blt_ring = 1,
> + .has_llc = 1,
> };
>
> static const struct intel_device_info intel_sandybridge_m_info = {
> @@ -222,6 +223,7 @@ static const struct intel_device_info intel_sandybridge_m_info = {
> .has_fbc = 1,
> .has_bsd_ring = 1,
> .has_blt_ring = 1,
> + .has_llc = 1,
> };
>
> static const struct intel_device_info intel_ivybridge_d_info = {
> @@ -229,6 +231,7 @@ static const struct intel_device_info intel_ivybridge_d_info = {
> .need_gfx_hws = 1, .has_hotplug = 1,
> .has_bsd_ring = 1,
> .has_blt_ring = 1,
> + .has_llc = 1,
> };
>
> static const struct intel_device_info intel_ivybridge_m_info = {
> @@ -237,6 +240,7 @@ static const struct intel_device_info intel_ivybridge_m_info = {
> .has_fbc = 0, /* FBC is not enabled on Ivybridge mobile yet */
> .has_bsd_ring = 1,
> .has_blt_ring = 1,
> + .has_llc = 1,
> };
>
> static const struct pci_device_id pciidlist[] = { /* aka */
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 4a9c1b9..abbbf32 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -250,6 +250,7 @@ struct intel_device_info {
> u8 supports_tv:1;
> u8 has_bsd_ring:1;
> u8 has_blt_ring:1;
> + u8 has_llc:1;
> };
>
> enum no_fbc_reason {
> @@ -961,6 +962,7 @@ struct drm_i915_file_private {
>
> #define HAS_BSD(dev) (INTEL_INFO(dev)->has_bsd_ring)
> #define HAS_BLT(dev) (INTEL_INFO(dev)->has_blt_ring)
> +#define HAS_LLC(dev) (INTEL_INFO(dev)->has_llc)
> #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws)
>
> #define HAS_OVERLAY(dev) (INTEL_INFO(dev)->has_overlay)
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 60ff1b6..fb69337 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3620,8 +3620,8 @@ struct drm_i915_gem_object *i915_gem_alloc_object(struct drm_device *dev,
> obj->base.write_domain = I915_GEM_DOMAIN_CPU;
> obj->base.read_domains = I915_GEM_DOMAIN_CPU;
>
> - if (IS_GEN6(dev) || IS_GEN7(dev)) {
> - /* On Gen6, we can have the GPU use the LLC (the CPU
> + if (HAS_LLC(dev)) {
> + /* On some devices, we can have the GPU use the LLC (the CPU
> * cache) for about a 10% performance improvement
> * compared to uncached. Graphics requests other than
> * display scanout are coherent with the CPU in
> diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
> index 28c0d11..b34e630 100644
> --- a/include/drm/i915_drm.h
> +++ b/include/drm/i915_drm.h
> @@ -291,6 +291,7 @@ typedef struct drm_i915_irq_wait {
> #define I915_PARAM_HAS_COHERENT_RINGS 13
> #define I915_PARAM_HAS_EXEC_CONSTANTS 14
> #define I915_PARAM_HAS_RELAXED_DELTA 15
> +#define I915_PARAM_HAS_LLC 16
>
> typedef struct drm_i915_getparam {
> int param;
> --
> 1.7.7.4
>
> _______________________________________________
> 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] 9+ messages in thread
end of thread, other threads:[~2012-01-16 21:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13 0:05 [PATCH] drm/i915: add a LLC feature flag in device description Eugeni Dodonov
2011-12-13 0:19 ` Chris Wilson
2011-12-13 13:05 ` Eugeni Dodonov
2011-12-13 13:24 ` Chris Wilson
2011-12-13 16:09 ` Daniel Vetter
2011-12-13 17:20 ` Eric Anholt
2011-12-13 17:57 ` Daniel Vetter
2011-12-13 21:05 ` Eugeni Dodonov
2012-01-16 21:55 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox