summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/gma500/gem.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2021-10-15 10:40:51 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2021-10-19 10:38:54 +0200
commit33e079bc1530df4596181ccbfded8752bbedb92c (patch)
treef776ff383612cca932e683c051de6d5f7a358532 /drivers/gpu/drm/gma500/gem.c
parentdrm/gma500: Inline psb_gtt_{alloc,free}_range() into rsp callers (diff)
downloadlinux-33e079bc1530df4596181ccbfded8752bbedb92c.tar.xz
linux-33e079bc1530df4596181ccbfded8752bbedb92c.zip
drm/gma500: Set page-caching flags in GEM pin/unpin
Caching of the GEM object's backing pages are unrelated to GTT management. Move the respective calls from GTT code to GEM code. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-9-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/gma500/gem.c')
-rw-r--r--drivers/gpu/drm/gma500/gem.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c
index 425d183c76ca..def26d9ce89d 100644
--- a/drivers/gpu/drm/gma500/gem.c
+++ b/drivers/gpu/drm/gma500/gem.c
@@ -13,6 +13,8 @@
#include <linux/pagemap.h>
+#include <asm/set_memory.h>
+
#include <drm/drm.h>
#include <drm/drm_vma_manager.h>
@@ -41,7 +43,9 @@ int psb_gem_pin(struct gtt_range *gt)
npages = gt->gem.size / PAGE_SIZE;
- ret = psb_gtt_insert(dev, gt, 0);
+ set_pages_array_wc(pages, npages);
+
+ ret = psb_gtt_insert(dev, gt);
if (ret)
goto err_drm_gem_put_pages;
@@ -84,6 +88,9 @@ void psb_gem_unpin(struct gtt_range *gt)
(gpu_base + gt->offset), gt->npage, 0, 0);
psb_gtt_remove(dev, gt);
+ /* Reset caching flags */
+ set_pages_array_wb(gt->pages, gt->npage);
+
drm_gem_put_pages(&gt->gem, gt->pages, true, false);
gt->pages = NULL;