97 gtt_slot = psb_gtt_entry(dev, r);
104 for (i = r->
roll; i < r->npage; i++) {
108 for (i = 0; i < r->
roll; i++) {
136 gtt_slot = psb_gtt_entry(dev, r);
139 for (i = 0; i < r->
npage; i++)
161 if (roll >= r->
npage) {
173 gtt_slot = psb_gtt_entry(dev, r);
175 for (i = r->
roll; i < r->npage; i++) {
179 for (i = 0; i < r->
roll; i++) {
194 static int psb_gtt_attach_pages(
struct gtt_range *gt)
205 inode = gt->
gem.filp->f_path.dentry->d_inode;
213 for (i = 0; i <
pages; i++) {
214 p = shmem_read_mapping_page(mapping, i);
238 static void psb_gtt_detach_pages(
struct gtt_range *gt)
241 for (i = 0; i < gt->
npage; i++) {
269 ret = psb_gtt_attach_pages(gt);
272 ret = psb_gtt_insert(dev, gt);
274 psb_gtt_detach_pages(gt);
306 psb_gtt_remove(dev, gt);
307 psb_gtt_detach_pages(gt);
331 const char *
name,
int backed)
342 end = r->
start + dev_priv->
gtt.stolen_size - 1;
345 start = r->
start + dev_priv->
gtt.stolen_size;
388 static void psb_gtt_alloc(
struct drm_device *dev)
455 if (pg->
gtt_start == 0 || gtt_pages == 0) {
456 dev_dbg(dev->dev,
"GTT PCI BAR not initialized.\n");
471 dev_dbg(dev->dev,
"GATT PCI BAR not initialized.\n");
478 fudge.
start = 0x40000000;
479 fudge.
end = 0x40000000 + 128 * 1024 * 1024 - 1;
480 fudge.
name =
"fudge";
489 stolen_size = vram_stolen_size;
491 dev_dbg(dev->dev,
"Stolen memory base 0x%x, size %luK\n",
494 if (resume && (gtt_pages != pg->
gtt_pages) &&
496 dev_err(dev->dev,
"GTT resume error.\n");
511 dev_err(dev->dev,
"Failure to map gtt.\n");
518 dev_err(dev->dev,
"Failure to map stolen base.\n");
529 dev_dbg(dev->dev,
"Set up %d stolen pages starting at 0x%08x, GTT offset %dK\n",
530 num_pages, pfn_base << PAGE_SHIFT, 0);
532 pte = psb_gtt_mask_pte(pfn_base + i, 0);
541 pte = psb_gtt_mask_pte(pfn_base, 0);
542 for (; i < gtt_pages; ++
i)