summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2022-12-23 00:58:12 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-12 22:06:01 +0300
commit2c3878820bf0bbd659c2b897add8a011b5e9f2e1 (patch)
treec3b1487ea248b7af9abd9bc6a277a99b415d6ac2 /drivers/gpu
parentebec269c522fc9bb48d11b65456b01adbdecb97d (diff)
downloadlinux-2c3878820bf0bbd659c2b897add8a011b5e9f2e1.tar.xz
drm/xe/gt: Fix min() with u32 and u64
Fix the following error while building for 32b: In file included from ../drivers/gpu/drm/xe/xe_gt.c:6: ../drivers/gpu/drm/xe/xe_gt.c: In function ‘gt_ttm_mgr_init’: ../include/linux/minmax.h:20:35: error: comparison of distinct pointer types lacks a cast [-Werror] 20 | (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) | ^~ Cast it to u64 so size of the second operand matches the first one when building it for 32 bits. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/xe/xe_gt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_gt.c b/drivers/gpu/drm/xe/xe_gt.c
index 96d0f5845d87..39df6945e1d9 100644
--- a/drivers/gpu/drm/xe/xe_gt.c
+++ b/drivers/gpu/drm/xe/xe_gt.c
@@ -183,7 +183,7 @@ static int gt_ttm_mgr_init(struct xe_gt *gt)
if (err)
return err;
gtt_size = min(max((XE_DEFAULT_GTT_SIZE_MB << 20),
- gt->mem.vram.size),
+ (u64)gt->mem.vram.size),
gtt_size);
xe->info.mem_region_mask |= BIT(gt->info.vram_id) << 1;
}