intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8
@ 2016-12-13 19:57 Paulo Zanoni
  2016-12-13 19:57 ` [RFC 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage Paulo Zanoni
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Paulo Zanoni @ 2016-12-13 19:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: dhinakaran.pandiyan, Paulo Zanoni

BSpec got updated and this workaround is now listed as standard
required programming for all subsequent projects.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index efc0e74..b1c8897 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv,
 		return -ENODEV;
 
 	/* See the comment at the drm_mm_init() call for more about this check.
-	 * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete)
+	 * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
 	 */
-	if (start < 4096 && (IS_GEN8(dev_priv) ||
-			     IS_KBL_REVID(dev_priv, 0, KBL_REVID_A0)))
+	if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
 		start = 4096;
 
 	mutex_lock(&dev_priv->mm.stolen_lock);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [RFC 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage
  2016-12-13 19:57 [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
@ 2016-12-13 19:57 ` Paulo Zanoni
  2016-12-13 20:38   ` Chris Wilson
  2016-12-13 20:01 ` [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
  2016-12-13 20:52 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
  2 siblings, 1 reply; 8+ messages in thread
From: Paulo Zanoni @ 2016-12-13 19:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: dhinakaran.pandiyan, stable, Paulo Zanoni

Reserve the first page of stolen memory right after initializing the
mm allocator. This means that we won't inherit the FB in case the BIOS
decides to put it at the start of stolen. IMHO, avoiding constant
screen flickering is more important than BIOS framebuffer inheritance.

TODO: the goal is to ask everybody with screen flickering problems to
test this patch. Hopefully we'll be able to add a bunch of Bugzilla
tags here before merging it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94605
Cc: stable@vger.kernel.org
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h        |  3 +++
 drivers/gpu/drm/i915/i915_gem_stolen.c | 30 +++++++++++++-----------------
 2 files changed, 16 insertions(+), 17 deletions(-)


Time to spam bugzilla again with links to patchwork. The tester on
fd.o bug 94605 suggests this may be the fix we've been looking for.


diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0e11ed7..0868a88 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1531,6 +1531,9 @@ struct i915_gem_mm {
 	/** LRU list of objects with fence regs on them. */
 	struct list_head fence_list;
 
+	/** First page of stolen, for platforms where it's reserved. */
+	struct drm_mm_node first_page;
+
 	/**
 	 * Are we in a non-interruptible section of code like
 	 * modesetting?
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index b1c8897..9b3ae58 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -54,12 +54,6 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv,
 	if (!drm_mm_initialized(&dev_priv->mm.stolen))
 		return -ENODEV;
 
-	/* See the comment at the drm_mm_init() call for more about this check.
-	 * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
-	 */
-	if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
-		start = 4096;
-
 	mutex_lock(&dev_priv->mm.stolen_lock);
 	ret = drm_mm_insert_node_in_range(&dev_priv->mm.stolen, node, size,
 					  alignment, start, end,
@@ -286,6 +280,9 @@ void i915_gem_cleanup_stolen(struct drm_device *dev)
 	if (!drm_mm_initialized(&dev_priv->mm.stolen))
 		return;
 
+	if (drm_mm_node_allocated(&dev_priv->mm.first_page))
+		drm_mm_remove_node(&dev_priv->mm.first_page);
+
 	drm_mm_takedown(&dev_priv->mm.stolen);
 }
 
@@ -491,19 +488,18 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
 
 	ggtt->stolen_usable_size = ggtt->stolen_size - reserved_total;
 
-	/*
-	 * Basic memrange allocator for stolen space.
-	 *
-	 * TODO: Notice that some platforms require us to not use the first page
-	 * of the stolen memory but their BIOSes may still put the framebuffer
-	 * on the first page. So we don't reserve this page for now because of
-	 * that. Our current solution is to just prevent new nodes from being
-	 * inserted on the first page - see the check we have at
-	 * i915_gem_stolen_insert_node_in_range(). We may want to fix the fbcon
-	 * problem later.
-	 */
+	/* Basic memrange allocator for stolen space. */
 	drm_mm_init(&dev_priv->mm.stolen, 0, ggtt->stolen_usable_size);
 
+	/* WaSkipStolenMemoryFirstPage:bdw+ */
+	if (INTEL_GEN(dev_priv) >= 8) {
+		dev_priv->mm.first_page.start = 0;
+		dev_priv->mm.first_page.size = 4096;
+		if (drm_mm_reserve_node(&dev_priv->mm.stolen,
+					&dev_priv->mm.first_page))
+			DRM_DEBUG_KMS("Failed to reserve the first page of stolen memory.\n");
+	}
+
 	return 0;
 }
 
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8
  2016-12-13 19:57 [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
  2016-12-13 19:57 ` [RFC 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage Paulo Zanoni
@ 2016-12-13 20:01 ` Paulo Zanoni
  2016-12-14 12:52   ` Paulo Zanoni
  2016-12-13 20:52 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
  2 siblings, 1 reply; 8+ messages in thread
From: Paulo Zanoni @ 2016-12-13 20:01 UTC (permalink / raw)
  To: intel-gfx; +Cc: dhinakaran.pandiyan

Em Ter, 2016-12-13 às 17:57 -0200, Paulo Zanoni escreveu:
> BSpec got updated and this workaround is now listed as standard
> required programming for all subsequent projects.
> 

Cc: stable@vger.kernel.org
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c
> b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index efc0e74..b1c8897 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range(struct
> drm_i915_private *dev_priv,
>  		return -ENODEV;
>  
>  	/* See the comment at the drm_mm_init() call for more about
> this check.
> -	 * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete)
> +	 * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
>  	 */
> -	if (start < 4096 && (IS_GEN8(dev_priv) ||
> -			     IS_KBL_REVID(dev_priv, 0,
> KBL_REVID_A0)))
> +	if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
>  		start = 4096;
>  
>  	mutex_lock(&dev_priv->mm.stolen_lock);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [RFC 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage
  2016-12-13 19:57 ` [RFC 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage Paulo Zanoni
@ 2016-12-13 20:38   ` Chris Wilson
  0 siblings, 0 replies; 8+ messages in thread
From: Chris Wilson @ 2016-12-13 20:38 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx, dhinakaran.pandiyan, stable

On Tue, Dec 13, 2016 at 05:57:26PM -0200, Paulo Zanoni wrote:
> Reserve the first page of stolen memory right after initializing the
> mm allocator. This means that we won't inherit the FB in case the BIOS
> decides to put it at the start of stolen. IMHO, avoiding constant
> screen flickering is more important than BIOS framebuffer inheritance.
> 
> TODO: the goal is to ask everybody with screen flickering problems to
> test this patch. Hopefully we'll be able to add a bunch of Bugzilla
> tags here before merging it.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94605
> Cc: stable@vger.kernel.org
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h        |  3 +++
>  drivers/gpu/drm/i915/i915_gem_stolen.c | 30 +++++++++++++-----------------
>  2 files changed, 16 insertions(+), 17 deletions(-)
> 
> 
> Time to spam bugzilla again with links to patchwork. The tester on
> fd.o bug 94605 suggests this may be the fix we've been looking for.
> 
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 0e11ed7..0868a88 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1531,6 +1531,9 @@ struct i915_gem_mm {
>  	/** LRU list of objects with fence regs on them. */
>  	struct list_head fence_list;
>  
> +	/** First page of stolen, for platforms where it's reserved. */
> +	struct drm_mm_node first_page;


> +
>  	/**
>  	 * Are we in a non-interruptible section of code like
>  	 * modesetting?
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index b1c8897..9b3ae58 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -54,12 +54,6 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv,
>  	if (!drm_mm_initialized(&dev_priv->mm.stolen))
>  		return -ENODEV;
>  
> -	/* See the comment at the drm_mm_init() call for more about this check.
> -	 * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
> -	 */
> -	if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
> -		start = 4096;
> -
>  	mutex_lock(&dev_priv->mm.stolen_lock);
>  	ret = drm_mm_insert_node_in_range(&dev_priv->mm.stolen, node, size,
>  					  alignment, start, end,
> @@ -286,6 +280,9 @@ void i915_gem_cleanup_stolen(struct drm_device *dev)
>  	if (!drm_mm_initialized(&dev_priv->mm.stolen))
>  		return;
>  
> +	if (drm_mm_node_allocated(&dev_priv->mm.first_page))
> +		drm_mm_remove_node(&dev_priv->mm.first_page);
> +
>  	drm_mm_takedown(&dev_priv->mm.stolen);
>  }
>  
> @@ -491,19 +488,18 @@ int i915_gem_init_stolen(struct drm_i915_private *dev_priv)
>  
>  	ggtt->stolen_usable_size = ggtt->stolen_size - reserved_total;
>  
> -	/*
> -	 * Basic memrange allocator for stolen space.
> -	 *
> -	 * TODO: Notice that some platforms require us to not use the first page
> -	 * of the stolen memory but their BIOSes may still put the framebuffer
> -	 * on the first page. So we don't reserve this page for now because of
> -	 * that. Our current solution is to just prevent new nodes from being
> -	 * inserted on the first page - see the check we have at
> -	 * i915_gem_stolen_insert_node_in_range(). We may want to fix the fbcon
> -	 * problem later.
> -	 */
> +	/* Basic memrange allocator for stolen space. */
>  	drm_mm_init(&dev_priv->mm.stolen, 0, ggtt->stolen_usable_size);
>  
> +	/* WaSkipStolenMemoryFirstPage:bdw+ */
> +	if (INTEL_GEN(dev_priv) >= 8) {
> +		dev_priv->mm.first_page.start = 0;
> +		dev_priv->mm.first_page.size = 4096;
> +		if (drm_mm_reserve_node(&dev_priv->mm.stolen,
> +					&dev_priv->mm.first_page))
> +			DRM_DEBUG_KMS("Failed to reserve the first page of stolen memory.\n");
> +	}

If you are saying that the first page can never be used, then just don't
put into the range allocator.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8
  2016-12-13 19:57 [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
  2016-12-13 19:57 ` [RFC 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage Paulo Zanoni
  2016-12-13 20:01 ` [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
@ 2016-12-13 20:52 ` Patchwork
  2 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2016-12-13 20:52 UTC (permalink / raw)
  To: Paulo Zanoni; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8
URL   : https://patchwork.freedesktop.org/series/16757/
State : failure

== Summary ==

Series 16757v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/16757/revisions/1/mbox/

Test drv_module_reload:
        Subgroup basic-reload-final:
                pass       -> FAIL       (fi-ilk-650)
        Subgroup basic-reload-inject:
                pass       -> INCOMPLETE (fi-kbl-7500u)
                pass       -> DMESG-FAIL (fi-ilk-650)
Test gem_basic:
        Subgroup bad-close:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup create-close:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup create-fd-close:
                pass       -> SKIP       (fi-ilk-650)
Test gem_busy:
        Subgroup basic-busy-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-hang-default:
                pass       -> SKIP       (fi-ilk-650)
Test gem_close_race:
        Subgroup basic-process:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-threads:
                pass       -> SKIP       (fi-ilk-650)
Test gem_cpu_reloc:
        Subgroup basic:
                pass       -> SKIP       (fi-ilk-650)
Test gem_cs_tlb:
        Subgroup basic-default:
                pass       -> SKIP       (fi-ilk-650)
Test gem_exec_basic:
        Subgroup basic-bsd:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-render:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup gtt-bsd:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup gtt-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup gtt-render:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup readonly-bsd:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup readonly-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup readonly-render:
                pass       -> SKIP       (fi-ilk-650)
Test gem_exec_create:
        Subgroup basic:
                pass       -> SKIP       (fi-ilk-650)
Test gem_exec_flush:
        Subgroup basic-batch-kernel-default-uc:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-batch-kernel-default-wb:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-uc-pro-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-uc-prw-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-uc-ro-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-uc-rw-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-uc-set-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-wb-pro-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-wb-prw-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-wb-ro-before-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-wb-ro-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-wb-rw-before-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-wb-rw-default:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-wb-set-default:
                pass       -> SKIP       (fi-ilk-650)
Test gem_exec_gttfill:
        Subgroup basic:
                pass       -> SKIP       (fi-ilk-650)
Test gem_exec_nop:
        Subgroup basic-parallel:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-series:
                pass       -> SKIP       (fi-ilk-650)
Test gem_exec_parallel:
        Subgroup basic:
                pass       -> SKIP       (fi-ilk-650)
Test gem_exec_reloc:
        Subgroup basic-cpu:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-gtt:
                pass       -> SKIP       (fi-ilk-650)
        Subgroup basic-noreloc:
WARNING: Long output truncated

57b72b4a6d7b787aedeb7b776ab35c3b2d7f58e9 drm-tip: 2016y-12m-13d-17h-59m-26s UTC integration manifest
918caed drm/i915: fully apply WaSkipStolenMemoryFirstPage
8eae126 drm/i915: skip the first 4k of stolen memory on everything >= gen8

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3281/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8
  2016-12-13 20:01 ` [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
@ 2016-12-14 12:52   ` Paulo Zanoni
  0 siblings, 0 replies; 8+ messages in thread
From: Paulo Zanoni @ 2016-12-14 12:52 UTC (permalink / raw)
  To: intel-gfx; +Cc: dhinakaran.pandiyan

Em Ter, 2016-12-13 às 18:01 -0200, Paulo Zanoni escreveu:
> Em Ter, 2016-12-13 às 17:57 -0200, Paulo Zanoni escreveu:
> > 
> > BSpec got updated and this workaround is now listed as standard
> > required programming for all subsequent projects.
> > 

Ok, so I got confirmation from the bug reporter that this patch is the
patch that actually fixes his screen flickering bugs. I suppose we're
initializing some ring on the first page and that's what really messes
up things (last time I checked, we did initialize a ring there on my
machine).

The corruption caused by random bugs flipping in the very first pixel
line of the frontbuffer is probably not very noticeable, so we probably
won't get bug reports for patch 2 specifically.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94605
Tested-by: Dominik Klementowski <dominik232@gmail.com>

> 
> Cc: stable@vger.kernel.org
> > 
> > Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c
> > b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > index efc0e74..b1c8897 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> > @@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range(struct
> > drm_i915_private *dev_priv,
> >  		return -ENODEV;
> >  
> >  	/* See the comment at the drm_mm_init() call for more
> > about
> > this check.
> > -	 * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete)
> > +	 * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
> >  	 */
> > -	if (start < 4096 && (IS_GEN8(dev_priv) ||
> > -			     IS_KBL_REVID(dev_priv, 0,
> > KBL_REVID_A0)))
> > +	if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
> >  		start = 4096;
> >  
> >  	mutex_lock(&dev_priv->mm.stolen_lock);
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8
@ 2016-12-14 14:55 Paulo Zanoni
  2016-12-20 12:57 ` Paulo Zanoni
  0 siblings, 1 reply; 8+ messages in thread
From: Paulo Zanoni @ 2016-12-14 14:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: Paulo Zanoni, stable

BSpec got updated and this workaround is now listed as standard
required programming for all subsequent projects. This is confirmed to
fix Skylake screen flickering issues (probably caused by the fact that
we initialized a ring in the first page of stolen, but I didn't 100%
confirm this theory).

v2: this is the patch that fixes the screen flickering, document it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94605
Cc: stable@vger.kernel.org
Tested-by: Dominik Klementowski <dominik232@gmail.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index efc0e74..b1c8897 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range(struct drm_i915_private *dev_priv,
 		return -ENODEV;
 
 	/* See the comment at the drm_mm_init() call for more about this check.
-	 * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete)
+	 * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
 	 */
-	if (start < 4096 && (IS_GEN8(dev_priv) ||
-			     IS_KBL_REVID(dev_priv, 0, KBL_REVID_A0)))
+	if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
 		start = 4096;
 
 	mutex_lock(&dev_priv->mm.stolen_lock);
-- 
2.7.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8
  2016-12-14 14:55 [PATCH 1/2] " Paulo Zanoni
@ 2016-12-20 12:57 ` Paulo Zanoni
  0 siblings, 0 replies; 8+ messages in thread
From: Paulo Zanoni @ 2016-12-20 12:57 UTC (permalink / raw)
  To: intel-gfx

Em Qua, 2016-12-14 às 12:55 -0200, Paulo Zanoni escreveu:
> BSpec got updated and this workaround is now listed as standard
> required programming for all subsequent projects. This is confirmed
> to
> fix Skylake screen flickering issues (probably caused by the fact
> that
> we initialized a ring in the first page of stolen, but I didn't 100%
> confirm this theory).
> 
> v2: this is the patch that fixes the screen flickering, document it.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94605
> Cc: stable@vger.kernel.org
> Tested-by: Dominik Klementowski <dominik232@gmail.com>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

Daniel gave me the missing R-B for this patch on IRC, so I pushed both
patches.

Thanks everybody for the reviews.

> ---
>  drivers/gpu/drm/i915/i915_gem_stolen.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c
> b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index efc0e74..b1c8897 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -55,10 +55,9 @@ int i915_gem_stolen_insert_node_in_range(struct
> drm_i915_private *dev_priv,
>  		return -ENODEV;
>  
>  	/* See the comment at the drm_mm_init() call for more about
> this check.
> -	 * WaSkipStolenMemoryFirstPage:bdw,chv,kbl (incomplete)
> +	 * WaSkipStolenMemoryFirstPage:bdw+ (incomplete)
>  	 */
> -	if (start < 4096 && (IS_GEN8(dev_priv) ||
> -			     IS_KBL_REVID(dev_priv, 0,
> KBL_REVID_A0)))
> +	if (start < 4096 && INTEL_GEN(dev_priv) >= 8)
>  		start = 4096;
>  
>  	mutex_lock(&dev_priv->mm.stolen_lock);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2016-12-20 12:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-13 19:57 [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
2016-12-13 19:57 ` [RFC 2/2] drm/i915: fully apply WaSkipStolenMemoryFirstPage Paulo Zanoni
2016-12-13 20:38   ` Chris Wilson
2016-12-13 20:01 ` [PATCH 1/2] drm/i915: skip the first 4k of stolen memory on everything >= gen8 Paulo Zanoni
2016-12-14 12:52   ` Paulo Zanoni
2016-12-13 20:52 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-12-14 14:55 [PATCH 1/2] " Paulo Zanoni
2016-12-20 12:57 ` Paulo Zanoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).