public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/i915: Declare the swizzling unknown for L-shaped configurations
       [not found] <b648b003580b997e7ca198b232c26e9a18cb5a56>
@ 2015-06-29 13:01 ` Chris Wilson
  2015-06-30  0:48   ` shuang.he
  2015-07-09  7:37   ` Daniel Vetter
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2015-06-29 13:01 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson, Daniel Vetter, stable

The old style of memory interleaving swizzled upto the end of the
first even bank of memory, and then used the remainder as unswizzled on
the unpaired bank - i.e. swizzling is not constant for all memory. This
causes problems when we try to migrate memory and so the kernel prevents
migration at all when we detect L-shaped inconsistent swizzling.
However, this issue also extends to userspace who try to manually detile
into memory as the swizzling for an individual page is unknown (it
depends on its physical address only known to the kernel), userspace
cannot correctly swizzle objects.

v2: Mark the global swizzling as unknown rather than adjust the value
reported to userspace.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91105
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/i915/i915_gem_tiling.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
index d16585f788ea..a0d98f0abc71 100644
--- a/drivers/gpu/drm/i915/i915_gem_tiling.c
+++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
@@ -183,8 +183,18 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
 		if (IS_GEN4(dev)) {
 			uint32_t ddc2 = I915_READ(DCC2);
 
-			if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE))
+			if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE)) {
+				/* Since the swizzling may vary within an
+				 * object, we have no idea what the swizzling
+				 * is for any page in particular. Thus we
+				 * cannot migrate tiled pages using the GPU,
+				 * nor can we tell userspace what the exact
+				 * swizzling is for any object.
+				 */
 				dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES;
+				swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
+				swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
+			}
 		}
 
 		if (dcc == 0xffffffff) {
-- 
2.1.4

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

* Re: [PATCH v2] drm/i915: Declare the swizzling unknown for L-shaped configurations
  2015-06-29 13:01 ` [PATCH v2] drm/i915: Declare the swizzling unknown for L-shaped configurations Chris Wilson
@ 2015-06-30  0:48   ` shuang.he
  2015-07-09  7:37   ` Daniel Vetter
  1 sibling, 0 replies; 3+ messages in thread
From: shuang.he @ 2015-06-30  0:48 UTC (permalink / raw)
  To: shuang.he, lei.a.liu, intel-gfx, chris

Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
Task id: 6664
-------------------------------------Summary-------------------------------------
Platform          Delta          drm-intel-nightly          Series Applied
ILK                 -1              302/302              301/302
SNB                                  312/316              312/316
IVB                                  343/343              343/343
BYT                 -3              287/287              284/287
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*ILK  igt@gem_reloc_vs_gpu@forked-interruptible-thrashing      PASS(1)      DMESG_WARN(1)
(dmesg patch applied)drm:i915_hangcheck_elapsed[i915]]*ERROR*Hangcheck_timer_elapsed...bsd_ring_idle@Hangcheck timer elapsed... bsd ring idle
*BYT  igt@gem_partial_pwrite_pread@reads      PASS(1)      FAIL(1)
*BYT  igt@gem_partial_pwrite_pread@reads-display      PASS(1)      FAIL(1)
*BYT  igt@gem_partial_pwrite_pread@reads-uncached      PASS(1)      FAIL(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH v2] drm/i915: Declare the swizzling unknown for L-shaped configurations
  2015-06-29 13:01 ` [PATCH v2] drm/i915: Declare the swizzling unknown for L-shaped configurations Chris Wilson
  2015-06-30  0:48   ` shuang.he
@ 2015-07-09  7:37   ` Daniel Vetter
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2015-07-09  7:37 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, intel-gfx, stable

On Mon, Jun 29, 2015 at 02:01:19PM +0100, Chris Wilson wrote:
> The old style of memory interleaving swizzled upto the end of the
> first even bank of memory, and then used the remainder as unswizzled on
> the unpaired bank - i.e. swizzling is not constant for all memory. This
> causes problems when we try to migrate memory and so the kernel prevents
> migration at all when we detect L-shaped inconsistent swizzling.
> However, this issue also extends to userspace who try to manually detile
> into memory as the swizzling for an individual page is unknown (it
> depends on its physical address only known to the kernel), userspace
> cannot correctly swizzle objects.
> 
> v2: Mark the global swizzling as unknown rather than adjust the value
> reported to userspace.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91105
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Cc: stable@vger.kernel.org

Applied to -fixes, thanks.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_gem_tiling.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c
> index d16585f788ea..a0d98f0abc71 100644
> --- a/drivers/gpu/drm/i915/i915_gem_tiling.c
> +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c
> @@ -183,8 +183,18 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
>  		if (IS_GEN4(dev)) {
>  			uint32_t ddc2 = I915_READ(DCC2);
>  
> -			if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE))
> +			if (!(ddc2 & DCC2_MODIFIED_ENHANCED_DISABLE)) {
> +				/* Since the swizzling may vary within an
> +				 * object, we have no idea what the swizzling
> +				 * is for any page in particular. Thus we
> +				 * cannot migrate tiled pages using the GPU,
> +				 * nor can we tell userspace what the exact
> +				 * swizzling is for any object.
> +				 */
>  				dev_priv->quirks |= QUIRK_PIN_SWIZZLED_PAGES;
> +				swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
> +				swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
> +			}
>  		}
>  
>  		if (dcc == 0xffffffff) {
> -- 
> 2.1.4
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2015-07-09  7:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <b648b003580b997e7ca198b232c26e9a18cb5a56>
2015-06-29 13:01 ` [PATCH v2] drm/i915: Declare the swizzling unknown for L-shaped configurations Chris Wilson
2015-06-30  0:48   ` shuang.he
2015-07-09  7:37   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox