diff mbox

[CI] drm/i915: Disable snooping (userptr, set-cache-level) on gen4

Message ID 20170906192424.26970-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Sept. 6, 2017, 7:24 p.m. UTC
The original gen4 has an issue where writes (both render and blt) into
snoopable pages are lost. We've previously worked around this in
userspace (ddx, igt) by simply not requesting snoopable buffers, but upon
rediscovering this problem for a third time, make the kernel reject such
requests with -ENODEV.

This disables snooping on userspace buffers for i965g and i965gm (original
gen4) machines.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_pci.c          | 2 ++
 drivers/gpu/drm/i915/intel_device_info.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Vetter Sept. 8, 2017, 7:11 a.m. UTC | #1
On Wed, Sep 06, 2017 at 08:24:24PM +0100, Chris Wilson wrote:
> The original gen4 has an issue where writes (both render and blt) into
> snoopable pages are lost. We've previously worked around this in
> userspace (ddx, igt) by simply not requesting snoopable buffers, but upon
> rediscovering this problem for a third time, make the kernel reject such
> requests with -ENODEV.
> 
> This disables snooping on userspace buffers for i965g and i965gm (original
> gen4) machines.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Cc: stable@vger.kernel.org

(even if greg ignores it ...)
-Daniel
> ---
>  drivers/gpu/drm/i915/i915_pci.c          | 2 ++
>  drivers/gpu/drm/i915/intel_device_info.c | 2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 881b5d6708aa..e95baf3c4314 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -168,6 +168,7 @@ static const struct intel_device_info intel_i965g_info __initconst = {
>  	.platform = INTEL_I965G,
>  	.has_overlay = 1,
>  	.hws_needs_physical = 1,
> +	.has_snoop = false,
>  };
>  
>  static const struct intel_device_info intel_i965gm_info __initconst = {
> @@ -177,6 +178,7 @@ static const struct intel_device_info intel_i965gm_info __initconst = {
>  	.has_overlay = 1,
>  	.supports_tv = 1,
>  	.hws_needs_physical = 1,
> +	.has_snoop = false,
>  };
>  
>  static const struct intel_device_info intel_g45_info __initconst = {
> diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
> index b17f7045c8f8..43831b09b47a 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.c
> +++ b/drivers/gpu/drm/i915/intel_device_info.c
> @@ -412,8 +412,6 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
>  	else if (INTEL_INFO(dev_priv)->gen >= 9)
>  		gen9_sseu_info_init(dev_priv);
>  
> -	WARN_ON(info->has_snoop != !info->has_llc);
> -
>  	DRM_DEBUG_DRIVER("slice mask: %04x\n", info->sseu.slice_mask);
>  	DRM_DEBUG_DRIVER("slice total: %u\n", hweight8(info->sseu.slice_mask));
>  	DRM_DEBUG_DRIVER("subslice total: %u\n",
> -- 
> 2.14.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 881b5d6708aa..e95baf3c4314 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -168,6 +168,7 @@  static const struct intel_device_info intel_i965g_info __initconst = {
 	.platform = INTEL_I965G,
 	.has_overlay = 1,
 	.hws_needs_physical = 1,
+	.has_snoop = false,
 };
 
 static const struct intel_device_info intel_i965gm_info __initconst = {
@@ -177,6 +178,7 @@  static const struct intel_device_info intel_i965gm_info __initconst = {
 	.has_overlay = 1,
 	.supports_tv = 1,
 	.hws_needs_physical = 1,
+	.has_snoop = false,
 };
 
 static const struct intel_device_info intel_g45_info __initconst = {
diff --git a/drivers/gpu/drm/i915/intel_device_info.c b/drivers/gpu/drm/i915/intel_device_info.c
index b17f7045c8f8..43831b09b47a 100644
--- a/drivers/gpu/drm/i915/intel_device_info.c
+++ b/drivers/gpu/drm/i915/intel_device_info.c
@@ -412,8 +412,6 @@  void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
 	else if (INTEL_INFO(dev_priv)->gen >= 9)
 		gen9_sseu_info_init(dev_priv);
 
-	WARN_ON(info->has_snoop != !info->has_llc);
-
 	DRM_DEBUG_DRIVER("slice mask: %04x\n", info->sseu.slice_mask);
 	DRM_DEBUG_DRIVER("slice total: %u\n", hweight8(info->sseu.slice_mask));
 	DRM_DEBUG_DRIVER("subslice total: %u\n",