Skip to content

Commit

Permalink
drm/nouveau/fb/gf100-: Fix 32 bit wraparound in new ram detection
Browse files Browse the repository at this point in the history
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: Mario Kleiner <[email protected]>
Reviewed-by: Karol Herbst <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
  • Loading branch information
kleinerm authored and Ben Skeggs committed Apr 29, 2017
1 parent 48907c2 commit 271393b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgf100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
fbp, size, ltcs);
lcomm = min(lcomm, (u64)(size / ltcs) << 20);
total += size << 20;
total += (u64) size << 20;
ltcn += ltcs;
} else {
nvkm_debug(subdev, "FBP %d: disabled\n", fbp);
Expand Down

0 comments on commit 271393b

Please sign in to comment.