From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Niels Ole Salscheider <niels_ole@salscheider-online.de>,
Alex Deucher <alexander.deucher@amd.com>
Subject: [ 09/21] drm/radeon: Fix VRAM size calculation for VRAM >= 4GB
Date: Wed, 22 May 2013 15:10:27 -0700 [thread overview]
Message-ID: <20130522205233.731157514@linuxfoundation.org> (raw)
In-Reply-To: <20130522205232.597066680@linuxfoundation.org>
3.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niels Ole Salscheider <niels_ole@salscheider-online.de>
commit fc986034540102cd090237bf3f70262e1ae80d9c upstream.
Add ULL prefix to avoid overflow.
Signed-off-by: Niels Ole Salscheider <niels_ole@salscheider-online.de>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/radeon/evergreen.c | 4 ++--
drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
drivers/gpu/drm/radeon/si.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -2400,8 +2400,8 @@ int evergreen_mc_init(struct radeon_devi
rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE);
} else {
/* size in MB on evergreen/cayman/tn */
- rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
- rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
+ rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
+ rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
}
rdev->mc.visible_vram_size = rdev->mc.aper_size;
r700_vram_gtt_location(rdev, &rdev->mc);
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -726,7 +726,7 @@ int radeon_ttm_init(struct radeon_device
return r;
}
DRM_INFO("radeon: %uM of VRAM memory ready\n",
- (unsigned)rdev->mc.real_vram_size / (1024 * 1024));
+ (unsigned) (rdev->mc.real_vram_size / (1024 * 1024)));
r = ttm_bo_init_mm(&rdev->mman.bdev, TTM_PL_TT,
rdev->mc.gtt_size >> PAGE_SHIFT);
if (r) {
--- a/drivers/gpu/drm/radeon/si.c
+++ b/drivers/gpu/drm/radeon/si.c
@@ -2644,8 +2644,8 @@ static int si_mc_init(struct radeon_devi
rdev->mc.aper_base = pci_resource_start(rdev->pdev, 0);
rdev->mc.aper_size = pci_resource_len(rdev->pdev, 0);
/* size in MB on si */
- rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
- rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024 * 1024;
+ rdev->mc.mc_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
+ rdev->mc.real_vram_size = RREG32(CONFIG_MEMSIZE) * 1024ULL * 1024ULL;
rdev->mc.visible_vram_size = rdev->mc.aper_size;
si_vram_gtt_location(rdev, &rdev->mc);
radeon_update_bandwidth_info(rdev);
next prev parent reply other threads:[~2013-05-22 22:10 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 22:10 [ 00/21] 3.9.4-stable review Greg Kroah-Hartman
2013-05-22 22:10 ` [ 01/21] arm64: debug: clear mdscr_el1 instead of taking the OS lock Greg Kroah-Hartman
2013-05-22 22:10 ` [ 02/21] arm64: mm: Fix operands of clz in __flush_dcache_all Greg Kroah-Hartman
2013-05-22 22:10 ` [ 03/21] btrfs: dont stop searching after encountering the wrong item Greg Kroah-Hartman
2013-05-22 22:10 ` [ 04/21] hwmon: fix error return code in abituguru_probe() Greg Kroah-Hartman
2013-05-22 22:10 ` [ 05/21] i2c: designware: fix RX FIFO overrun Greg Kroah-Hartman
2013-05-22 22:10 ` [ 06/21] i2c: designware: always clear interrupts before enabling them Greg Kroah-Hartman
2013-05-22 22:10 ` [ 07/21] x86: Fix bit corruption at CPU resume time Greg Kroah-Hartman
2013-05-22 22:10 ` [ 08/21] drm/nouveau/bios: fix thinko in ZM_MASK_ADD opcode Greg Kroah-Hartman
2013-05-22 22:10 ` Greg Kroah-Hartman [this message]
2013-05-22 22:10 ` [ 10/21] virtio_console: fix uapi header Greg Kroah-Hartman
2013-05-22 22:10 ` [ 11/21] NTB: variable dereferenced before check Greg Kroah-Hartman
2013-05-22 22:10 ` [ 12/21] ntb: off by one sanity checks Greg Kroah-Hartman
2013-05-22 22:10 ` [ 13/21] NTB: fix pointer math issues Greg Kroah-Hartman
2013-05-22 22:10 ` [ 14/21] NTB: Handle 64bit BAR sizes Greg Kroah-Hartman
2013-05-22 22:10 ` [ 15/21] NTB: Link toggle memory leak Greg Kroah-Hartman
2013-05-22 22:10 ` [ 16/21] NTB: reset tx_index on link toggle Greg Kroah-Hartman
2013-05-22 22:10 ` [ 17/21] NTB: Correctly handle receive buffers of the minimal size Greg Kroah-Hartman
2013-05-22 22:10 ` [ 18/21] NTB: memcpy lockup workaround Greg Kroah-Hartman
2013-05-22 22:10 ` [ 19/21] ntb_netdev: remove from list on exit Greg Kroah-Hartman
2013-05-22 22:10 ` [ 20/21] NTB: Multiple NTB client fix Greg Kroah-Hartman
2013-05-22 22:10 ` [ 21/21] x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...) Greg Kroah-Hartman
2013-05-24 11:13 ` Satoru Takeuchi
2013-05-23 16:52 ` [ 00/21] 3.9.4-stable review Shuah Khan
2013-05-23 16:57 ` Greg Kroah-Hartman
2013-05-24 11:46 ` Satoru Takeuchi
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=20130522205233.731157514@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=alexander.deucher@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=niels_ole@salscheider-online.de \
--cc=stable@vger.kernel.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).