From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f177.google.com ([209.85.212.177]:33746 "EHLO mail-wi0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757AbbGIHeY (ORCPT ); Thu, 9 Jul 2015 03:34:24 -0400 Received: by wiwl6 with SMTP id l6so9931457wiw.0 for ; Thu, 09 Jul 2015 00:34:23 -0700 (PDT) Date: Thu, 9 Jul 2015 09:37:08 +0200 From: Daniel Vetter To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org, Daniel Vetter , stable@vger.kernel.org Subject: Re: [PATCH v2] drm/i915: Declare the swizzling unknown for L-shaped configurations Message-ID: <20150709073708.GC21858@phenom.ffwll.local> References: <1435582879-32012-1-git-send-email-chris@chris-wilson.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435582879-32012-1-git-send-email-chris@chris-wilson.co.uk> Sender: stable-owner@vger.kernel.org List-ID: 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 > Cc: Daniel Vetter > 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