summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-08-11 17:46:58 +1000
committerDave Airlie <airlied@redhat.com>2020-08-24 17:06:08 +1000
commitebb21aa1882f418b436ee23463683790c553a447 (patch)
tree6b1e5f92ccfb9ffa0bfe48e383e7b263a4f587e2 /drivers/gpu/drm/ttm
parent098754fe3ce79af2d5772c0356ba5d52e67eb64a (diff)
drm/ttm: drop bus.size from bus placement.
This is always calculated the same, and only used in a couple of places. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200811074658.58309-2-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_bo_util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index eaed29b81d9e..ee04716b2603 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -140,7 +140,6 @@ int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
mem->bus.addr = NULL;
mem->bus.offset = 0;
- mem->bus.size = mem->num_pages << PAGE_SHIFT;
mem->bus.base = 0;
mem->bus.is_iomem = false;
retry:
@@ -214,12 +213,14 @@ static int ttm_resource_ioremap(struct ttm_bo_device *bdev,
if (mem->bus.addr) {
addr = mem->bus.addr;
} else {
+ size_t bus_size = (size_t)mem->num_pages << PAGE_SHIFT;
+
if (mem->placement & TTM_PL_FLAG_WC)
addr = ioremap_wc(mem->bus.base + mem->bus.offset,
- mem->bus.size);
+ bus_size);
else
addr = ioremap(mem->bus.base + mem->bus.offset,
- mem->bus.size);
+ bus_size);
if (!addr) {
(void) ttm_mem_io_lock(man, false);
ttm_mem_io_free(bdev, mem);