drm/i915: add a LLC feature flag in device description
Subsystems (2)
PATCH 1/1 drm/i915: add a LLC feature flag in device description
LLC is not SNB-specific, so we should check for it in a more generic way.
--- 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(-)
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -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 = {
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -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)
drivers/gpu/drm/i915/i915_gem.c +2 -2
@@ -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
Signature · 1 line
1.7.7.4
Quoted 1 line · Eugeni Dodonov
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
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
PATCH 1/1 drm/i915: add a LLC feature flag in device description
From: Eugeni Dodonov <[email protected]>
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.
--- 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(-)
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
@@ -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 Breturn 0 ;
drivers/gpu/drm/i915/i915_dma.c +3 -0
@@ -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);
drivers/gpu/drm/i915/i915_drv.c +2 -0
@@ -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 = {
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -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)
drivers/gpu/drm/i915/i915_gem.c +2 -2
@@ -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
include/drm/i915_drm.h +1 -0
@@ -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;
Signature · 1 line
1.7.7.4
Quoted 7 lines · Eugeni Dodonov
From: Eugeni Dodonov <[email protected]>
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 <[email protected]>
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 7 lines · Eugeni Dodonov
From: Eugeni Dodonov <[email protected]>
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 <[email protected]>
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
So please drop the GETPARAM. For the per-bo get_cache_flags ioctl there's already a patch by Ben floating around.
-Daniel
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
Quoted 17 lines · Daniel Vetter
Quoted 7 lines · Eugeni Dodonov
From: Eugeni Dodonov <[email protected]>
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 <[email protected]>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
Quoted 4 lines
Nacked-by Daniel Vetter <[email protected]>So please drop the GETPARAM. For the per-bo
get_cache_flagsioctl 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.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
Reviewed-byQuoted 20 lines · Eric Anholt
Quoted 19 lines · Daniel Vetter
Quoted 7 lines · Eugeni Dodonov
From: Eugeni Dodonov <[email protected]>
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 <[email protected]>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 <[email protected]>
Quoted 8 lines
Quoted 2 lines
So please drop the GETPARAM. For the per-bo
get_cache_flagsioctl 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:
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48
PATCH 1/1 drm/i915: add a LLC feature flag in device description
From: Eugeni Dodonov <[email protected]>
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.
--- 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(-)
drivers/gpu/drm/i915/i915_debugfs.c +1 -0
@@ -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 Breturn 0 ;
drivers/gpu/drm/i915/i915_dma.c +3 -0
@@ -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);
drivers/gpu/drm/i915/i915_drv.c +4 -0
@@ -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 */
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -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)
drivers/gpu/drm/i915/i915_gem.c +2 -2
@@ -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
include/drm/i915_drm.h +1 -0
@@ -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;
Signature · 1 line
1.7.7.4
Quoted 4 lines · Eugeni Dodonov
From: Eugeni Dodonov <[email protected]>
LLC is not SNB-specific, so we should check for it in a more generic way.
Quoted 8 lines
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 <[email protected]>Reviewed-by Daniel Vetter <[email protected]>Signed-off-by Eugeni Dodonov <[email protected]>
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
Quoted 125 lines
--- 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(-)drivers/gpu/drm/i915/i915_debugfs.c +1
-0@@ -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 Breturn 0 ;drivers/gpu/drm/i915/i915_dma.c +3
-0@@ -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);drivers/gpu/drm/i915/i915_drv.c +4
-0@@ -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 */ drivers/gpu/drm/i915/i915_drv.h +2
-0@@ -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)drivers/gpu/drm/i915/i915_gem.c +2
-2@@ -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 include/drm/i915_drm.h +1
-0@@ -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;Signature · 6 lines
1.7.7.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Mail: [email protected] Mobile: +41 (0)79 365 57 48