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
This commit is contained in:
Thomas Zimmermann
2021-10-15 10:40:51 +02:00
parent 3c101135ba
commit 33e079bc15
3 changed files with 11 additions and 17 deletions

View File

@@ -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;