From 33e079bc1530df4596181ccbfded8752bbedb92c Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Fri, 15 Oct 2021 10:40:51 +0200 Subject: 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 Acked-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20211015084053.13708-9-tzimmermann@suse.de --- drivers/gpu/drm/gma500/gem.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/gma500/gem.c') 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 +#include + #include #include @@ -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(>->gem, gt->pages, true, false); gt->pages = NULL; -- cgit v1.2.3