Commit 42ceddb6 authored by Thomas Zimmermann's avatar Thomas Zimmermann Committed by Patrik Jakobsson

drm/gma500: Inline psb_gtt_restore()

Inline psb_gtt_restore() into its only caller in power.c.

Perform the GTT restoration in psb_gem_mm_resume(). The restoration
step is part of GEM anyway and will be moved over at some point.
Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220308195222.13471-10-tzimmermann@suse.de
parent d00f44dd
...@@ -339,7 +339,7 @@ int psb_gem_mm_init(struct drm_device *dev) ...@@ -339,7 +339,7 @@ int psb_gem_mm_init(struct drm_device *dev)
return ret; return ret;
} }
static int psb_gtt_resume(struct drm_device *dev) int psb_gtt_resume(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
...@@ -422,7 +422,7 @@ static int psb_gtt_resume(struct drm_device *dev) ...@@ -422,7 +422,7 @@ static int psb_gtt_resume(struct drm_device *dev)
return ret; return ret;
} }
static int psb_gem_mm_resume(struct drm_device *dev) int psb_gem_mm_resume(struct drm_device *dev)
{ {
struct drm_psb_private *dev_priv = to_drm_psb_private(dev); struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
struct pci_dev *pdev = to_pci_dev(dev->dev); struct pci_dev *pdev = to_pci_dev(dev->dev);
...@@ -445,17 +445,6 @@ static int psb_gem_mm_resume(struct drm_device *dev) ...@@ -445,17 +445,6 @@ static int psb_gem_mm_resume(struct drm_device *dev)
} }
psb_gtt_populate_stolen(dev_priv); psb_gtt_populate_stolen(dev_priv);
return 0;
}
int psb_gtt_restore(struct drm_device *dev)
{
struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
psb_gtt_resume(dev);
psb_gem_mm_resume(dev);
psb_gtt_populate_resources(dev_priv); psb_gtt_populate_resources(dev_priv);
return 0; return 0;
......
...@@ -27,7 +27,7 @@ struct psb_gtt { ...@@ -27,7 +27,7 @@ struct psb_gtt {
/* Exported functions */ /* Exported functions */
int psb_gtt_init(struct drm_device *dev); int psb_gtt_init(struct drm_device *dev);
void psb_gtt_fini(struct drm_device *dev); void psb_gtt_fini(struct drm_device *dev);
extern int psb_gtt_restore(struct drm_device *dev); int psb_gtt_resume(struct drm_device *dev);
int psb_gtt_allocate_resource(struct drm_psb_private *pdev, struct resource *res, int psb_gtt_allocate_resource(struct drm_psb_private *pdev, struct resource *res,
const char *name, resource_size_t size, resource_size_t align, const char *name, resource_size_t size, resource_size_t align,
...@@ -39,5 +39,6 @@ void psb_gtt_remove_pages(struct drm_psb_private *pdev, const struct resource *r ...@@ -39,5 +39,6 @@ void psb_gtt_remove_pages(struct drm_psb_private *pdev, const struct resource *r
int psb_gem_mm_init(struct drm_device *dev); int psb_gem_mm_init(struct drm_device *dev);
void psb_gem_mm_fini(struct drm_device *dev); void psb_gem_mm_fini(struct drm_device *dev);
int psb_gem_mm_resume(struct drm_device *dev);
#endif #endif
...@@ -112,7 +112,9 @@ static void gma_resume_display(struct pci_dev *pdev) ...@@ -112,7 +112,9 @@ static void gma_resume_display(struct pci_dev *pdev)
pci_write_config_word(pdev, PSB_GMCH_CTRL, pci_write_config_word(pdev, PSB_GMCH_CTRL,
dev_priv->gmch_ctrl | _PSB_GMCH_ENABLED); dev_priv->gmch_ctrl | _PSB_GMCH_ENABLED);
psb_gtt_restore(dev); /* Rebuild our GTT mappings */ /* Rebuild our GTT mappings */
psb_gtt_resume(dev);
psb_gem_mm_resume(dev);
dev_priv->ops->restore_regs(dev); dev_priv->ops->restore_regs(dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment