diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2021-10-15 11:40:52 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2021-10-19 11:38:54 +0300 |
commit | e1f80341e312088f0e6c46107db7098e30e6d764 (patch) | |
tree | bb6153f3561ba6dee103473e1acb43dfd45af877 /drivers/gpu/drm/gma500/gtt.h | |
parent | 33e079bc1530df4596181ccbfded8752bbedb92c (diff) | |
download | linux-e1f80341e312088f0e6c46107db7098e30e6d764.tar.xz |
drm/gma500: Rewrite GTT page insert/remove without struct gtt_range
struct gtt_range represents a GEM object and should not be used for GTT
setup. Change psb_gtt_insert() and psb_gtt_remove() to receive all
necessary parameters from their caller. This also eliminates possible
failure from psb_gtt_insert().
There's one exception in psb_gtt_restore(), which requires an upcast
from struct resource to struct gtt_range when restoring the GTT after
hibernation. A possible solution would track the GEM objects that need
restoration separately from the GTT resource.
Rename the functions to psb_gtt_insert_pages() and psb_gtt_remove_pages()
to reflect their similarity to MMU interfaces.
v3:
* restore the comments about locking rules (Patrik)
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-10-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/gma500/gtt.h')
-rw-r--r-- | drivers/gpu/drm/gma500/gtt.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/gma500/gtt.h b/drivers/gpu/drm/gma500/gtt.h index ddb4f3af93f7..b967dcf6bef1 100644 --- a/drivers/gpu/drm/gma500/gtt.h +++ b/drivers/gpu/drm/gma500/gtt.h @@ -49,7 +49,8 @@ int psb_gtt_allocate_resource(struct drm_psb_private *pdev, struct resource *res const char *name, resource_size_t size, resource_size_t align, bool stolen, u32 *offset); -int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r); -void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r); +void psb_gtt_insert_pages(struct drm_psb_private *pdev, const struct resource *res, + struct page **pages); +void psb_gtt_remove_pages(struct drm_psb_private *pdev, const struct resource *res); #endif |