Skip to contentSkip to conversation

gma500: Mask out bits not part of the page table base address

PATCH Patrik Jakobsson 2 participants 3 messages Jul 7, 2011 Staging

lore
Share & tools
lore
#0 lore raw

Otherwise we can't ioremap the gtt and the screen gets garbled.

---

drivers/staging/gma500/gtt.c +1 -1
index 28f2261..78dd01b 100644
@@ -397,7 +397,7 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 	/* The root resource we allocate address space from */
 	dev_priv->gtt_initialized = 1;
 
-	pg->gtt_phys_start = dev_priv->pge_ctl;
+	pg->gtt_phys_start = dev_priv->pge_ctl & PAGE_MASK;
 	
 	/*
 	 *	FIXME: video mmu has hw bug to access 0x0D0000000,
Acked-by
#1 lore raw
Quoted 10 lines · On Fri, 8 Jul 2011 00:06:21 +0200 Patrik Jakobsson…

Otherwise we can't ioremap the gtt and the screen gets garbled.

---

drivers/staging/gma500/gtt.c +0 -0
index 28f2261..78dd01b 100644

drivers/staging/gma500/gtt.c int psb_gtt_init(struct drm_device *dev, int resume) · line 400

Quoted 5 lines
drivers/staging/gma500/gtt.c +1 -1
@@ -397,7 +397,7 @@ int psb_gtt_init(struct drm_device *dev, int resume)
 	/* The root resource we allocate address space from */
 	dev_priv->gtt_initialized = 1;
 
-	pg->gtt_phys_start = dev_priv->pge_ctl;
+	pg->gtt_phys_start = dev_priv->pge_ctl & PAGE_MASK;

Umm yes I suppose if its already been enabled that'll be slightly important

#2 lore raw
Quoted 2 lines

Umm yes I suppose if its already been enabled that'll be slightly important

Yes :) and I guess that the size (bits 3:1) of the gtt could theoretically be something other than 512KB. Is it safe to just look at the pci resource length or should one perhaps cross-check it against the control register?

Maybe I just worry too much