dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Madhav.Chauhan@amd.com, dri-devel@lists.freedesktop.org
Cc: Ray.Huang@amd.com
Subject: [PATCH 03/13] drm/ttm: make num_pages uint32_t
Date: Sun, 25 Oct 2020 16:40:50 +0100	[thread overview]
Message-ID: <20201025154100.16400-4-christian.koenig@amd.com> (raw)
In-Reply-To: <20201025154100.16400-1-christian.koenig@amd.com>

We can still allocate 16TiB with that.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 10 +++++-----
 drivers/gpu/drm/nouveau/nouveau_ttm.c   |  2 +-
 drivers/gpu/drm/radeon/radeon_ttm.c     |  4 ++--
 include/drm/ttm/ttm_tt.h                |  2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 169468572930..0a3270f25e40 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -973,7 +973,7 @@ bool amdgpu_ttm_tt_get_user_pages_done(struct ttm_tt *ttm)
 	if (!gtt || !gtt->userptr)
 		return false;
 
-	DRM_DEBUG_DRIVER("user_pages_done 0x%llx pages 0x%lx\n",
+	DRM_DEBUG_DRIVER("user_pages_done 0x%llx pages 0x%x\n",
 		gtt->userptr, ttm->num_pages);
 
 	WARN_ONCE(!gtt->range || !gtt->range->hmm_pfns,
@@ -1124,7 +1124,7 @@ static int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
 
 gart_bind_fail:
 	if (r)
-		DRM_ERROR("failed to bind %lu pages at 0x%08llX\n",
+		DRM_ERROR("failed to bind %u pages at 0x%08llX\n",
 			  ttm->num_pages, gtt->offset);
 
 	return r;
@@ -1159,7 +1159,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_bo_device *bdev,
 		}
 	}
 	if (!ttm->num_pages) {
-		WARN(1, "nothing to bind %lu pages for mreg %p back %p!\n",
+		WARN(1, "nothing to bind %u pages for mreg %p back %p!\n",
 		     ttm->num_pages, bo_mem, ttm);
 	}
 
@@ -1182,7 +1182,7 @@ static int amdgpu_ttm_backend_bind(struct ttm_bo_device *bdev,
 		ttm->pages, gtt->ttm.dma_address, flags);
 
 	if (r)
-		DRM_ERROR("failed to bind %lu pages at 0x%08llX\n",
+		DRM_ERROR("failed to bind %u pages at 0x%08llX\n",
 			  ttm->num_pages, gtt->offset);
 	gtt->bound = true;
 	return r;
@@ -1291,7 +1291,7 @@ static void amdgpu_ttm_backend_unbind(struct ttm_bo_device *bdev,
 	/* unbind shouldn't be done for GDS/GWS/OA in ttm_bo_clean_mm */
 	r = amdgpu_gart_unbind(adev, gtt->offset, ttm->num_pages);
 	if (r)
-		DRM_ERROR("failed to unbind %lu pages at 0x%08llX\n",
+		DRM_ERROR("failed to unbind %u pages at 0x%08llX\n",
 			  gtt->ttm.ttm.num_pages, gtt->offset);
 	gtt->bound = false;
 }
diff --git a/drivers/gpu/drm/nouveau/nouveau_ttm.c b/drivers/gpu/drm/nouveau/nouveau_ttm.c
index 04b95277c73a..0592ed6eaad1 100644
--- a/drivers/gpu/drm/nouveau/nouveau_ttm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_ttm.c
@@ -108,7 +108,7 @@ nv04_gart_manager_new(struct ttm_resource_manager *man,
 		return ret;
 
 	ret = nvif_vmm_get(&mem->cli->vmm.vmm, PTES, false, 12, 0,
-			   reg->num_pages << PAGE_SHIFT, &mem->vma[0]);
+			   (long)reg->num_pages << PAGE_SHIFT, &mem->vma[0]);
 	if (ret) {
 		nouveau_mem_del(reg);
 		return ret;
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 75fa2f55186b..c51dcbc818ef 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -564,7 +564,7 @@ static int radeon_ttm_backend_bind(struct ttm_bo_device *bdev,
 
 	gtt->offset = (unsigned long)(bo_mem->start << PAGE_SHIFT);
 	if (!ttm->num_pages) {
-		WARN(1, "nothing to bind %lu pages for mreg %p back %p!\n",
+		WARN(1, "nothing to bind %u pages for mreg %p back %p!\n",
 		     ttm->num_pages, bo_mem, ttm);
 	}
 	if (ttm->caching == ttm_cached)
@@ -572,7 +572,7 @@ static int radeon_ttm_backend_bind(struct ttm_bo_device *bdev,
 	r = radeon_gart_bind(rdev, gtt->offset, ttm->num_pages,
 			     ttm->pages, gtt->ttm.dma_address, flags);
 	if (r) {
-		DRM_ERROR("failed to bind %lu pages at 0x%08X\n",
+		DRM_ERROR("failed to bind %u pages at 0x%08X\n",
 			  ttm->num_pages, (unsigned)gtt->offset);
 		return r;
 	}
diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index e3e60c1da754..931a31355870 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -61,7 +61,7 @@ struct ttm_operation_ctx;
 struct ttm_tt {
 	struct page **pages;
 	uint32_t page_flags;
-	unsigned long num_pages;
+	uint32_t num_pages;
 	struct sg_table *sg; /* for SG objects via dma-buf */
 	struct file *swap_storage;
 	enum ttm_caching caching;
-- 
2.17.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2020-10-25 15:41 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-25 15:40 drm/ttm: new TT backend allocation pool Christian König
2020-10-25 15:40 ` [PATCH 01/13] drm/ttm: nuke ttm_tt_set_(un)populated again Christian König
2020-10-26  4:43   ` Dave Airlie
2020-10-26 13:36   ` Chauhan, Madhav
2020-10-26 13:43     ` Christian König
2020-10-26 19:26       ` Chauhan, Madhav
2020-10-28 11:40         ` Chauhan, Madhav
2020-10-25 15:40 ` [PATCH 02/13] drm/ttm: move swapin out of page alloc backend Christian König
2020-10-25 15:40 ` Christian König [this message]
2020-10-25 15:40 ` [PATCH 04/13] drm/ttm: merge ttm_dma_tt back into ttm_tt Christian König
2020-10-25 15:40 ` [PATCH 05/13] drm/ttm: new TT backend allocation pool Christian König
2020-10-25 18:35   ` kernel test robot
2020-10-25 19:01   ` kernel test robot
2020-10-25 19:01   ` [RFC PATCH] drm/ttm: ttm_pool_apply_caching() can be static kernel test robot
2020-10-26  9:56   ` [PATCH 05/13] drm/ttm: new TT backend allocation pool kernel test robot
2020-10-25 15:40 ` [PATCH 06/13] drm/ttm: wire up the new pool as default one Christian König
2020-10-25 15:40 ` [PATCH 07/13] drm/amdgpu: switch to new allocator Christian König
2020-10-25 15:40 ` [PATCH 08/13] drm/radeon: " Christian König
2020-10-25 15:40 ` [PATCH 09/13] drm/nouveau: " Christian König
2020-10-25 15:40 ` [PATCH 10/13] drm/vmwgfx: " Christian König
2020-10-25 15:40 ` [PATCH 11/13] drm/qxl: drop ttm_page_alloc.h include Christian König
2020-10-25 15:40 ` [PATCH 12/13] drm/vram_helpers: " Christian König
2020-10-25 15:41 ` [PATCH 13/13] drm/ttm: nuke old page allocator Christian König
2020-10-26  5:23 ` drm/ttm: new TT backend allocation pool Dave Airlie
2020-10-26 12:01   ` Christian König
2020-10-26 12:15     ` Daniel Vetter
2020-10-26 13:45 ` Huang Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201025154100.16400-4-christian.koenig@amd.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=Madhav.Chauhan@amd.com \
    --cc=Ray.Huang@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).