Commit 53f1e062 authored by Souptick Joarder's avatar Souptick Joarder Committed by Thierry Reding

drm/tegra: Convert drm_atomic_helper_suspend/resume()

convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().

With this conversion, tegra_drm_fb_suspend() and
tegra_drm_fb_resume() will not be used anymore.
Both of these functions can be removed.

Also, in tegra_drm struct's member state will not be
used anymore. So this can be removed forever.

Fixed one sparse warning.
Signed-off-by: default avatarSouptick Joarder <jrdr.linux@gmail.com>
Signed-off-by: default avatarAjit Negi <ajitn.linux@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 5b394b2d
...@@ -1212,31 +1212,15 @@ static int host1x_drm_remove(struct host1x_device *dev) ...@@ -1212,31 +1212,15 @@ static int host1x_drm_remove(struct host1x_device *dev)
static int host1x_drm_suspend(struct device *dev) static int host1x_drm_suspend(struct device *dev)
{ {
struct drm_device *drm = dev_get_drvdata(dev); struct drm_device *drm = dev_get_drvdata(dev);
struct tegra_drm *tegra = drm->dev_private;
drm_kms_helper_poll_disable(drm);
tegra_drm_fb_suspend(drm);
tegra->state = drm_atomic_helper_suspend(drm);
if (IS_ERR(tegra->state)) {
tegra_drm_fb_resume(drm);
drm_kms_helper_poll_enable(drm);
return PTR_ERR(tegra->state);
}
return 0; return drm_mode_config_helper_suspend(drm);
} }
static int host1x_drm_resume(struct device *dev) static int host1x_drm_resume(struct device *dev)
{ {
struct drm_device *drm = dev_get_drvdata(dev); struct drm_device *drm = dev_get_drvdata(dev);
struct tegra_drm *tegra = drm->dev_private;
drm_atomic_helper_resume(drm, tegra->state); return drm_mode_config_helper_resume(drm);
tegra_drm_fb_resume(drm);
drm_kms_helper_poll_enable(drm);
return 0;
} }
#endif #endif
......
...@@ -60,8 +60,6 @@ struct tegra_drm { ...@@ -60,8 +60,6 @@ struct tegra_drm {
unsigned int pitch_align; unsigned int pitch_align;
struct tegra_display_hub *hub; struct tegra_display_hub *hub;
struct drm_atomic_state *state;
}; };
struct tegra_drm_client; struct tegra_drm_client;
...@@ -186,8 +184,6 @@ int tegra_drm_fb_prepare(struct drm_device *drm); ...@@ -186,8 +184,6 @@ int tegra_drm_fb_prepare(struct drm_device *drm);
void tegra_drm_fb_free(struct drm_device *drm); void tegra_drm_fb_free(struct drm_device *drm);
int tegra_drm_fb_init(struct drm_device *drm); int tegra_drm_fb_init(struct drm_device *drm);
void tegra_drm_fb_exit(struct drm_device *drm); void tegra_drm_fb_exit(struct drm_device *drm);
void tegra_drm_fb_suspend(struct drm_device *drm);
void tegra_drm_fb_resume(struct drm_device *drm);
extern struct platform_driver tegra_display_hub_driver; extern struct platform_driver tegra_display_hub_driver;
extern struct platform_driver tegra_dc_driver; extern struct platform_driver tegra_dc_driver;
......
...@@ -356,7 +356,7 @@ static void tegra_fbdev_exit(struct tegra_fbdev *fbdev) ...@@ -356,7 +356,7 @@ static void tegra_fbdev_exit(struct tegra_fbdev *fbdev)
/* Undo the special mapping we made in fbdev probe. */ /* Undo the special mapping we made in fbdev probe. */
if (bo && bo->pages) { if (bo && bo->pages) {
vunmap(bo->vaddr); vunmap(bo->vaddr);
bo->vaddr = 0; bo->vaddr = NULL;
} }
drm_framebuffer_remove(fbdev->fb); drm_framebuffer_remove(fbdev->fb);
...@@ -412,25 +412,3 @@ void tegra_drm_fb_exit(struct drm_device *drm) ...@@ -412,25 +412,3 @@ void tegra_drm_fb_exit(struct drm_device *drm)
tegra_fbdev_exit(tegra->fbdev); tegra_fbdev_exit(tegra->fbdev);
#endif #endif
} }
void tegra_drm_fb_suspend(struct drm_device *drm)
{
#ifdef CONFIG_DRM_FBDEV_EMULATION
struct tegra_drm *tegra = drm->dev_private;
console_lock();
drm_fb_helper_set_suspend(&tegra->fbdev->base, 1);
console_unlock();
#endif
}
void tegra_drm_fb_resume(struct drm_device *drm)
{
#ifdef CONFIG_DRM_FBDEV_EMULATION
struct tegra_drm *tegra = drm->dev_private;
console_lock();
drm_fb_helper_set_suspend(&tegra->fbdev->base, 0);
console_unlock();
#endif
}
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