summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/gma_display.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2022-03-08 20:52:11 +0100
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>2022-03-16 17:42:17 +0100
commitde2d1822f9489268e0707b2d188dd789d5effd08 (patch)
treec21b9cf5b18324db757b7e119208eb4a327a723d /drivers/gpu/drm/gma500/gma_display.c
parent47042e0ddd218f100292cebc5208cb1eff7473b6 (diff)
downloadlinux-de2d1822f9489268e0707b2d188dd789d5effd08.tar.bz2
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
Diffstat (limited to 'drivers/gpu/drm/gma500/gma_display.c')
-rw-r--r--drivers/gpu/drm/gma500/gma_display.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c
index 60ba7de59139..dd801404cf99 100644
--- a/drivers/gpu/drm/gma500/gma_display.c
+++ b/drivers/gpu/drm/gma500/gma_display.c
@@ -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;