Commit 271393ba authored by Mario Kleiner's avatar Mario Kleiner Committed by Ben Skeggs

drm/nouveau/fb/gf100-: Fix 32 bit wraparound in new ram detection

A missing u64 cast causes a 32-Bit wraparound from
4096 MiB to 0 MiB and therefore total 0 MiB VRAM detected
if card has 4096 Mib per FBP.
Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: default avatarKarol Herbst <karolherbst@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 48907c23
...@@ -589,7 +589,7 @@ gf100_ram_ctor(const struct nvkm_ram_func *func, struct nvkm_fb *fb, ...@@ -589,7 +589,7 @@ gf100_ram_ctor(const struct nvkm_ram_func *func, struct nvkm_fb *fb,
nvkm_debug(subdev, "FBP %d: %4d MiB, %d LTC(s)\n", nvkm_debug(subdev, "FBP %d: %4d MiB, %d LTC(s)\n",
fbp, size, ltcs); fbp, size, ltcs);
lcomm = min(lcomm, (u64)(size / ltcs) << 20); lcomm = min(lcomm, (u64)(size / ltcs) << 20);
total += size << 20; total += (u64) size << 20;
ltcn += ltcs; ltcn += ltcs;
} else { } else {
nvkm_debug(subdev, "FBP %d: disabled\n", fbp); nvkm_debug(subdev, "FBP %d: disabled\n", fbp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment