Skip to content

Commit 25c9a15

Browse files
pc2005czhdeller
authored andcommitted
video: fbdev: intelfb: Use aperture size from pci_resource_len
Aperture size for i9x5 variants is determined from PCI base address. if (pci_resource_start(pdev, 2) & 0x08000000) *aperture_size = MB(128); ... This condition is incorrect as 128 MiB address can have the address set as 0x?8000000 or 0x?0000000. Also the code can be simplified to just use pci_resource_len(). The true settings of the aperture size is in the MSAC register, which could be used instead. However the value is used only as an info message, so it doesn't matter. Signed-off-by: Petr Cvek <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent fc37879 commit 25c9a15

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/video/fbdev/intelfb/intelfbhw.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,11 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
201201
case PCI_DEVICE_ID_INTEL_945GME:
202202
case PCI_DEVICE_ID_INTEL_965G:
203203
case PCI_DEVICE_ID_INTEL_965GM:
204-
/* 915, 945 and 965 chipsets support a 256MB aperture.
205-
Aperture size is determined by inspected the
206-
base address of the aperture. */
207-
if (pci_resource_start(pdev, 2) & 0x08000000)
208-
*aperture_size = MB(128);
209-
else
210-
*aperture_size = MB(256);
204+
/*
205+
* 915, 945 and 965 chipsets support 64MB, 128MB or 256MB
206+
* aperture. Determine size from PCI resource length.
207+
*/
208+
*aperture_size = pci_resource_len(pdev, 2);
211209
break;
212210
default:
213211
if ((tmp & INTEL_GMCH_MEM_MASK) == INTEL_GMCH_MEM_64M)

0 commit comments

Comments
 (0)