Skip to content

Commit 5eb3e5a

Browse files
ickledanvet
authored andcommitted
drm/i915: Declare the swizzling unknown for L-shaped configurations
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. Note that this is a new attempt for the previously merged one, reverted in commit d82c0ba Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Tue Jul 14 12:29:27 2015 +0200 Revert "drm/i915: Declare the swizzling unknown for L-shaped configurations" This is cc: stable since we need it to fix up troubles with wc cpu mmaps that userspace recently started to use widely. 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 [danvet: Add note about previous (failed attempt).] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent d0e30ad commit 5eb3e5a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/i915/i915_gem_tiling.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,10 @@ i915_gem_get_tiling(struct drm_device *dev, void *data,
464464
}
465465

466466
/* Hide bit 17 from the user -- see comment in i915_gem_set_tiling */
467-
args->phys_swizzle_mode = args->swizzle_mode;
467+
if (dev_priv->quirks & QUIRK_PIN_SWIZZLED_PAGES)
468+
args->phys_swizzle_mode = I915_BIT_6_SWIZZLE_UNKNOWN;
469+
else
470+
args->phys_swizzle_mode = args->swizzle_mode;
468471
if (args->swizzle_mode == I915_BIT_6_SWIZZLE_9_17)
469472
args->swizzle_mode = I915_BIT_6_SWIZZLE_9;
470473
if (args->swizzle_mode == I915_BIT_6_SWIZZLE_9_10_17)

0 commit comments

Comments
 (0)