(gpu_base + pobj->offset), npages, 0, 0,
PSB_MMU_CACHED_MEMORY);
- pobj->npage = npages;
pobj->pages = pages;
out:
struct drm_device *dev = obj->dev;
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
u32 gpu_base = dev_priv->gtt.gatt_start;
+ unsigned long npages;
mutex_lock(&dev_priv->gtt_mutex);
if (pobj->in_gart || pobj->stolen)
goto out;
+ npages = obj->size / PAGE_SIZE;
+
psb_mmu_remove_pages(psb_mmu_get_default_pd(dev_priv->mmu),
- (gpu_base + pobj->offset), pobj->npage, 0, 0);
+ (gpu_base + pobj->offset), npages, 0, 0);
psb_gtt_remove_pages(dev_priv, &pobj->resource);
/* Reset caching flags */
- set_pages_array_wb(pobj->pages, pobj->npage);
+ set_pages_array_wb(pobj->pages, npages);
drm_gem_put_pages(obj, pobj->pages, true, false);
pobj->pages = NULL;
- pobj->npage = 0;
out:
mutex_unlock(&dev_priv->gtt_mutex);
bool stolen; /* Backed from stolen RAM */
bool mmapping; /* Is mmappable */
struct page **pages; /* Backing pages if present */
- int npage; /* Number of backing pages */
};
static inline struct psb_gem_object *to_psb_gem_object(struct drm_gem_object *obj)
goto unref_cursor;
}
- /* Prevent overflow */
- if (pobj->npage > 4)
- cursor_pages = 4;
- else
- cursor_pages = pobj->npage;
+ cursor_pages = obj->size / PAGE_SIZE;
+ if (cursor_pages > 4)
+ cursor_pages = 4; /* Prevent overflow */
/* Copy the cursor to cursor mem */
tmp_dst = dev_priv->vram_addr + cursor_pobj->offset;