diff --git a/src/radeon_driver.c b/src/radeon_driver.c index bf560f7..ed86b02 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -1396,6 +1396,9 @@ static void RADEONInitMemoryMap(ScrnInfoPtr pScrn) aper_size = INREG(RADEON_CONFIG_APER_SIZE); } + if (aper_size > 0x10000000) + aper_size = 0x10000000; + if (mem_size == 0) mem_size = 0x800000; @@ -1613,6 +1616,9 @@ static uint32_t RADEONGetAccessibleVRAM(ScrnInfoPtr pScrn) else aper_size = INREG(RADEON_CONFIG_APER_SIZE) / 1024; + if (aper_size > 0x10000000) + aper_size = 0x10000000; + #ifdef XF86DRI /* If we use the DRI, we need to check if it's a version that has the * bug of always cropping MC_FB_LOCATION to one aperture, in which case @@ -1710,6 +1716,8 @@ static Bool RADEONPreInitVRAM(ScrnInfoPtr pScrn) /* Crop it to the size of the PCI BAR */ bar_size = PCI_REGION_SIZE(info->PciInfo, 0) / 1024; + if (bar_size > 0x10000000) + bar_size = 0x10000000; if (bar_size == 0) bar_size = 0x20000; if (accessible > bar_size)