diff options
author | 2021-10-15 10:40:51 +0200 | |
---|---|---|
committer | 2021-10-19 10:38:54 +0200 | |
commit | 33e079bc1530df4596181ccbfded8752bbedb92c (patch) | |
tree | f776ff383612cca932e683c051de6d5f7a358532 /drivers/gpu/drm/gma500/gtt.c | |
parent | drm/gma500: Inline psb_gtt_{alloc,free}_range() into rsp callers (diff) | |
download | wireguard-linux-33e079bc1530df4596181ccbfded8752bbedb92c.tar.xz wireguard-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/gtt.c')
-rw-r--r-- | drivers/gpu/drm/gma500/gtt.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c index d00ca065f3d3..3a716a970a8a 100644 --- a/drivers/gpu/drm/gma500/gtt.c +++ b/drivers/gpu/drm/gma500/gtt.c @@ -7,10 +7,6 @@ * Alan Cox <alan@linux.intel.com> */ -#include <linux/shmem_fs.h> - -#include <asm/set_memory.h> - #include "psb_drv.h" @@ -92,17 +88,15 @@ static u32 __iomem *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r) * psb_gtt_insert - put an object into the GTT * @dev: our DRM device * @r: our GTT range - * @resume: on resume * * Take our preallocated GTT range and insert the GEM object into * the GTT. This is protected via the gtt mutex which the caller * must hold. */ -int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r, int resume) +int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r) { u32 __iomem *gtt_slot; u32 pte; - struct page **pages; int i; if (r->pages == NULL) { @@ -113,12 +107,6 @@ int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r, int resume) WARN_ON(r->stolen); /* refcount these maybe ? */ gtt_slot = psb_gtt_entry(dev, r); - pages = r->pages; - - if (!resume) { - /* Make sure changes are visible to the GPU */ - set_pages_array_wc(pages, r->npage); - } /* Write our page entries into the GTT itself */ for (i = 0; i < r->npage; i++) { @@ -158,7 +146,6 @@ void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r) for (i = 0; i < r->npage; i++) iowrite32(pte, gtt_slot++); ioread32(gtt_slot - 1); - set_pages_array_wb(r->pages, r->npage); } static void psb_gtt_alloc(struct drm_device *dev) @@ -349,7 +336,7 @@ int psb_gtt_restore(struct drm_device *dev) while (r != NULL) { range = container_of(r, struct gtt_range, resource); if (range->pages) { - psb_gtt_insert(dev, range, 1); + psb_gtt_insert(dev, range); size += range->resource.end - range->resource.start; restored++; } |