drm/gma500: Remove struct psb_gem_object.npage
Calculate the number of pages in the BO's backing storage from the size. Remove the npage field. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-2-tzimmermann@suse.de
This commit is contained in:
parent
47042e0ddd
commit
de2d1822f9
|
@ -51,7 +51,6 @@ int psb_gem_pin(struct psb_gem_object *pobj)
|
|||
(gpu_base + pobj->offset), npages, 0, 0,
|
||||
PSB_MMU_CACHED_MEMORY);
|
||||
|
||||
pobj->npage = npages;
|
||||
pobj->pages = pages;
|
||||
|
||||
out:
|
||||
|
@ -71,6 +70,7 @@ void psb_gem_unpin(struct psb_gem_object *pobj)
|
|||
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);
|
||||
|
||||
|
@ -81,16 +81,17 @@ void psb_gem_unpin(struct psb_gem_object *pobj)
|
|||
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);
|
||||
|
|
|
@ -23,7 +23,6 @@ struct psb_gem_object {
|
|||
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)
|
||||
|
|
|
@ -391,11 +391,9 @@ int gma_crtc_cursor_set(struct drm_crtc *crtc,
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue