summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-11-04 12:54:00 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-11-04 12:55:53 +0000
commit7ed5b1156cbf173a68f4fe007c51b911e7c5a1a2 (patch)
tree7f05f0fd8e48022de8c54b3437fccd9a46314be1
parenta972c9886edc1141ad3f8a0a33d2f7f18d0008bc (diff)
sna: Reuse the queried aperture size for videoRam determination
Rather than repeat our derivation of how much RAM we can map, just reuse the already determined value. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_driver.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index ddb462b5..42fc7250 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -1059,12 +1059,6 @@ static void sna_dri_init(struct sna *sna, ScreenPtr screen)
"direct rendering: %senabled\n", str);
}
-static size_t
-agp_aperture_size(struct pci_device *dev, int gen)
-{
- return dev->regions[gen < 030 ? 0 : 2].size;
-}
-
static Bool
sna_mode_init(struct sna *sna, ScreenPtr screen)
{
@@ -1089,7 +1083,6 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
struct sna *sna = to_sna(scrn);
- struct pci_device *pci;
VisualPtr visuals;
DepthPtr depths;
int nvisuals;
@@ -1107,11 +1100,7 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL)
if (!sna_register_all_privates())
return FALSE;
- pci = xf86GetPciInfoForEntity(sna->pEnt->index);
- if (pci != NULL)
- scrn->videoRam = agp_aperture_size(pci, sna->kgem.gen) / 1024;
- else
- scrn->videoRam = 256;
+ scrn->videoRam = sna->kgem.aperture_mappable / 1024;
miClearVisualTypes();
if (!miSetVisualTypes(scrn->depth,