forked from Minki/linux
staging: xgifb: setup initial video RAM size for systems without BIOS
On embedded systems without a BIOS, the DRAM sizing register is 0 after the boot, and the driver thinks we have only 1 MB video memory. On such cases, use the PCI window size for the initial size. This information is needed only to create the I/O mapping - the driver will later detect and configure the memory size correctly. Limit the size to 16 MB as it should be sufficient for all supported video modes. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1839c7ebd9
commit
98f4eade14
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||||
|
|
||||||
|
#include <linux/sizes.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
|
|
||||||
#ifdef CONFIG_MTRR
|
#ifdef CONFIG_MTRR
|
||||||
@ -1470,6 +1471,9 @@ static int XGIfb_get_dram_size(struct xgifb_video_info *xgifb_info)
|
|||||||
xgifb_reg_set(XGISR, IND_SIS_DRAM_SIZE, 0x51);
|
xgifb_reg_set(XGISR, IND_SIS_DRAM_SIZE, 0x51);
|
||||||
|
|
||||||
reg = xgifb_reg_get(XGISR, IND_SIS_DRAM_SIZE);
|
reg = xgifb_reg_get(XGISR, IND_SIS_DRAM_SIZE);
|
||||||
|
if (!reg)
|
||||||
|
return -1;
|
||||||
|
|
||||||
switch ((reg & XGI_DRAM_SIZE_MASK) >> 4) {
|
switch ((reg & XGI_DRAM_SIZE_MASK) >> 4) {
|
||||||
case XGI_DRAM_SIZE_1MB:
|
case XGI_DRAM_SIZE_1MB:
|
||||||
xgifb_info->video_size = 0x100000;
|
xgifb_info->video_size = 0x100000;
|
||||||
@ -1778,10 +1782,8 @@ static int __devinit xgifb_probe(struct pci_dev *pdev,
|
|||||||
hw_info->jChipType = xgifb_info->chip;
|
hw_info->jChipType = xgifb_info->chip;
|
||||||
|
|
||||||
if (XGIfb_get_dram_size(xgifb_info)) {
|
if (XGIfb_get_dram_size(xgifb_info)) {
|
||||||
dev_err(&pdev->dev,
|
xgifb_info->video_size = min_t(unsigned long, video_size_max,
|
||||||
"Fatal error: Unable to determine RAM size.\n");
|
SZ_16M);
|
||||||
ret = -ENODEV;
|
|
||||||
goto error_disable;
|
|
||||||
} else if (xgifb_info->video_size > video_size_max) {
|
} else if (xgifb_info->video_size > video_size_max) {
|
||||||
xgifb_info->video_size = video_size_max;
|
xgifb_info->video_size = video_size_max;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user