if (stolen) { /* The start of the GTT is backed by stolen pages. */
start = root->start;
end = root->start + pdev->gtt.stolen_size - 1;
} else { /* The rest is backed by system pages. */
start = root->start + pdev->gtt.stolen_size;
end = root->end;
}
/** * psb_gtt_mask_pte - generate GTT pte entry * @pfn: page number to encode * @type: type of memory in the GTT * * Set the GTT entry for the appropriate memory type.
*/
uint32_t psb_gtt_mask_pte(uint32_t pfn, int type)
{
uint32_t mask = PSB_PTE_VALID;
/* Ensure we explode rather than put an invalid low mapping of
a high mapping page into the gtt */
BUG_ON(pfn & ~(0xFFFFFFFF >> PAGE_SHIFT));
if (type & PSB_MMU_CACHED_MEMORY)
mask |= PSB_PTE_CACHED; if (type & PSB_MMU_RO_MEMORY)
mask |= PSB_PTE_RO; if (type & PSB_MMU_WO_MEMORY)
mask |= PSB_PTE_WO;
ret = pci_read_config_word(pdev, PSB_GMCH_CTRL, &dev_priv->gmch_ctrl); if (ret) return pcibios_err_to_errno(ret);
ret = pci_write_config_word(pdev, PSB_GMCH_CTRL, dev_priv->gmch_ctrl | _PSB_GMCH_ENABLED); if (ret) return pcibios_err_to_errno(ret);
/* The root resource we allocate address space from */
gtt_phys_start = dev_priv->pge_ctl & PAGE_MASK;
/* * The video MMU has a HW bug when accessing 0x0d0000000. Make * GATT start at 0x0e0000000. This doesn't actually matter for * us now, but maybe will if the video acceleration ever gets * opened up.
*/
mmu_gatt_start = 0xe0000000;
/* CDV doesn't report this. In which case the system has 64 gtt pages */ if (!gtt_start || !gtt_pages) {
dev_dbg(dev->dev, "GTT PCI BAR not initialized.\n");
gtt_pages = 64;
gtt_start = dev_priv->pge_ctl;
}
/* * This can occur on CDV systems. Fudge it in this case. We * really don't care what imaginary space is being allocated * at this point.
*/
dev_dbg(dev->dev, "GATT PCI BAR not initialized.\n");
gatt_start = 0x40000000;
gatt_pages = (128 * 1024 * 1024) >> PAGE_SHIFT;
/* * This is a little confusing but in fact the GTT is providing * a view from the GPU into memory and not vice versa. As such * this is really allocating space that is not the same as the * CPU address space on CDV.
*/
fudge.start = 0x40000000;
fudge.end = 0x40000000 + 128 * 1024 * 1024 - 1;
fudge.name = "fudge";
fudge.flags = IORESOURCE_MEM;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.