Skip to content

Commit

Permalink
drm/i915/selftests: Magic numbers for old Y-tiling
Browse files Browse the repository at this point in the history
i915g has a slightly different tiling layout, and so requires a
different reference swizzle pattern.

Testcase: igt/drv_selftests/live_objects #gdg
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180707100405.817-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Jul 9, 2018
1 parent 890fd18 commit e147913
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/gpu/drm/i915/selftests/i915_gem_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,16 @@ static u64 tiled_offset(const struct tile *tile, u64 v)
v += y * tile->width;
v += div64_u64_rem(x, tile->width, &x) << tile->size;
v += x;
} else {
} else if (tile->width == 128) {
const unsigned int ytile_span = 16;
const unsigned int ytile_height = 32 * ytile_span;
const unsigned int ytile_height = 512;

v += y * ytile_span;
v += div64_u64_rem(x, ytile_span, &x) * ytile_height;
v += x;
} else {
const unsigned int ytile_span = 32;
const unsigned int ytile_height = 256;

v += y * ytile_span;
v += div64_u64_rem(x, ytile_span, &x) * ytile_height;
Expand Down

0 comments on commit e147913

Please sign in to comment.