From: Alex Deucher Date: Mon, 25 Oct 2010 23:44:00 +0000 (-0400) Subject: drm/radeon/kms: MC vram map needs to be >= pci aperture size X-Git-Tag: firefly_0821_release~9833^2~79^2^2~209 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c350041047b0822fe971851debfd18d6deedcd4d;p=firefly-linux-kernel-4.4.55.git drm/radeon/kms: MC vram map needs to be >= pci aperture size commit b7d8cce5b558e0c0aa6898c9865356481598b46d upstream. The vram map in the radeon memory controller needs to be >= the pci aperture size. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=28402 The problematic cards in the above bug have 64 MB of vram, but the pci aperture is 128 MB and the MC vram map was only 64 MB. This can lead to hangs. Signed-off-by: Alex Deucher Signed-off-by: Dave Airlie Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index e59422320bb6..a20fe2376d66 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c @@ -2318,6 +2318,9 @@ void r100_vram_init_sizes(struct radeon_device *rdev) /* Fix for RN50, M6, M7 with 8/16/32(??) MBs of VRAM - * Novell bug 204882 + along with lots of ubuntu ones */ + if (rdev->mc.aper_size > config_aper_size) + config_aper_size = rdev->mc.aper_size; + if (config_aper_size > rdev->mc.real_vram_size) rdev->mc.mc_vram_size = config_aper_size; else