Skip to content

Commit c582810

Browse files
icklejlahtine-intel
authored andcommitted
drm/i915: Mark up GTT sizes as u64
Since we use a 64b virtual GTT irrespective of the system, we want to ensure that the GTT computations remains 64b even on 32b systems, including treatment of huge virtual pages. No code generation changes on 64b: Reported-by: Sergii Romantsov <sergii.romantsov@globallogic.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108282 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: stable@vger.kernel.org Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181025091823.20571-1-chris@chris-wilson.co.uk (cherry picked from commit 9125963) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
1 parent 6503493 commit c582810

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

drivers/gpu/drm/i915/i915_gem_gtt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1757,7 +1757,7 @@ static void gen6_dump_ppgtt(struct i915_hw_ppgtt *base, struct seq_file *m)
17571757
if (i == 4)
17581758
continue;
17591759

1760-
seq_printf(m, "\t\t(%03d, %04d) %08lx: ",
1760+
seq_printf(m, "\t\t(%03d, %04d) %08llx: ",
17611761
pde, pte,
17621762
(pde * GEN6_PTES + pte) * I915_GTT_PAGE_SIZE);
17631763
for (i = 0; i < 4; i++) {

drivers/gpu/drm/i915/i915_gem_gtt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
#include "i915_selftest.h"
4343
#include "i915_timeline.h"
4444

45-
#define I915_GTT_PAGE_SIZE_4K BIT(12)
46-
#define I915_GTT_PAGE_SIZE_64K BIT(16)
47-
#define I915_GTT_PAGE_SIZE_2M BIT(21)
45+
#define I915_GTT_PAGE_SIZE_4K BIT_ULL(12)
46+
#define I915_GTT_PAGE_SIZE_64K BIT_ULL(16)
47+
#define I915_GTT_PAGE_SIZE_2M BIT_ULL(21)
4848

4949
#define I915_GTT_PAGE_SIZE I915_GTT_PAGE_SIZE_4K
5050
#define I915_GTT_MAX_PAGE_SIZE I915_GTT_PAGE_SIZE_2M

drivers/gpu/drm/i915/selftests/huge_pages.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static int igt_mock_ppgtt_misaligned_dma(void *arg)
551551
err = igt_check_page_sizes(vma);
552552

553553
if (vma->page_sizes.gtt != I915_GTT_PAGE_SIZE_4K) {
554-
pr_err("page_sizes.gtt=%u, expected %lu\n",
554+
pr_err("page_sizes.gtt=%u, expected %llu\n",
555555
vma->page_sizes.gtt, I915_GTT_PAGE_SIZE_4K);
556556
err = -EINVAL;
557557
}

drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,7 +1337,7 @@ static int igt_gtt_reserve(void *arg)
13371337
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
13381338
if (vma->node.start != total ||
13391339
vma->node.size != 2*I915_GTT_PAGE_SIZE) {
1340-
pr_err("i915_gem_gtt_reserve (pass 1) placement failed, found (%llx + %llx), expected (%llx + %lx)\n",
1340+
pr_err("i915_gem_gtt_reserve (pass 1) placement failed, found (%llx + %llx), expected (%llx + %llx)\n",
13411341
vma->node.start, vma->node.size,
13421342
total, 2*I915_GTT_PAGE_SIZE);
13431343
err = -EINVAL;
@@ -1386,7 +1386,7 @@ static int igt_gtt_reserve(void *arg)
13861386
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
13871387
if (vma->node.start != total ||
13881388
vma->node.size != 2*I915_GTT_PAGE_SIZE) {
1389-
pr_err("i915_gem_gtt_reserve (pass 2) placement failed, found (%llx + %llx), expected (%llx + %lx)\n",
1389+
pr_err("i915_gem_gtt_reserve (pass 2) placement failed, found (%llx + %llx), expected (%llx + %llx)\n",
13901390
vma->node.start, vma->node.size,
13911391
total, 2*I915_GTT_PAGE_SIZE);
13921392
err = -EINVAL;
@@ -1430,7 +1430,7 @@ static int igt_gtt_reserve(void *arg)
14301430
GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
14311431
if (vma->node.start != offset ||
14321432
vma->node.size != 2*I915_GTT_PAGE_SIZE) {
1433-
pr_err("i915_gem_gtt_reserve (pass 3) placement failed, found (%llx + %llx), expected (%llx + %lx)\n",
1433+
pr_err("i915_gem_gtt_reserve (pass 3) placement failed, found (%llx + %llx), expected (%llx + %llx)\n",
14341434
vma->node.start, vma->node.size,
14351435
offset, 2*I915_GTT_PAGE_SIZE);
14361436
err = -EINVAL;

0 commit comments

Comments
 (0)