gpu/drm/exynos: Convert drm_atomic_helper_suspend/resume()
Subsystems (3)
PATCH v2 1/1 gpu/drm/exynos: Convert drm_atomic_helper_suspend/resume()
convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().
exynos_drm_fbdev_suspend/resume can be removed
as drm_mode_config_helper_suspend/resume has
implement the same in generic way.
---
v2: Address Inki Dae's comment. Remove
ret variable from both suspend/resume
function.
drivers/gpu/drm/exynos/exynos_drm_drv.c | 26 ++++---------------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 17 ----------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 10 ---------- 3 files changed, 4 insertions(+), 49 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +4 -22
@@ -151,39 +151,21 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)static int exynos_drm_suspend (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; - -drm_kms_helper_poll_disable (drm_dev); -exynos_drm_fbdev_suspend (drm_dev); - private->suspend_state =drm_atomic_helper_suspend (drm_dev); -if (IS_ERR (private->suspend_state)) { -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); -return PTR_ERR (private->suspend_state); - } - -return 0 ; +return drm_mode_config_helper_suspend (drm_dev); }static int exynos_drm_resume (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; -drm_atomic_helper_resume (drm_dev, private->suspend_state); -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); - -return 0 ; +return drm_mode_config_helper_resume (drm_dev); }#endif
drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0 -17
@@ -270,20 +270,3 @@ void exynos_drm_fbdev_fini(struct drm_device *dev) private->fb_helper =NULL ; } -void exynos_drm_fbdev_suspend (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,1 ); -console_unlock (); -} - -void exynos_drm_fbdev_resume (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,0 ); -console_unlock (); -}
drivers/gpu/drm/exynos/exynos_drm_fbdev.h +0 -10
@@ -19,8 +19,6 @@int exynos_drm_fbdev_init (struct drm_device *dev);void exynos_drm_fbdev_fini (struct drm_device *dev); -void exynos_drm_fbdev_suspend (struct drm_device *drm); -void exynos_drm_fbdev_resume (struct drm_device *drm);#else
@@ -39,14 +37,6 @@ static inline void exynos_drm_fbdev_restore_mode(struct drm_device *dev)#define exynos_drm_output_poll_changed (NULL) -static inline void exynos_drm_fbdev_suspend (struct drm_device *drm) -{ -} - -static inline void exynos_drm_fbdev_resume (struct drm_device *drm) -{ -} -#endif #endif
Signature · 1 line
1.9.1
Quoted 7 lines · Souptick Joarder
convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().exynos_drm_fbdev_suspend/resume can be removed
as drm_mode_config_helper_suspend/resume has
implement the same in generic way.
Quoted 7 lines
Signed-off-by Souptick Joarder <[email protected]>Signed-off-by Ajit Negi <[email protected]>---
v2: Address Inki Dae's comment. Remove
ret variable from both suspend/resume
function.
Any further comment on this patch ?
Quoted 109 lines
drivers/gpu/drm/exynos/exynos_drm_drv.c | 26 ++++---------------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 17 ----------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 10 ---------- 3 files changed, 4 insertions(+), 49 deletions(-)drivers/gpu/drm/exynos/exynos_drm_drv.c +4
-22@@ -151,39 +151,21 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)static int exynos_drm_suspend (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; - -drm_kms_helper_poll_disable (drm_dev); -exynos_drm_fbdev_suspend (drm_dev); - private->suspend_state =drm_atomic_helper_suspend (drm_dev); -if (IS_ERR (private->suspend_state)) { -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); -return PTR_ERR (private->suspend_state); - } - -return 0 ; +return drm_mode_config_helper_suspend (drm_dev); }static int exynos_drm_resume (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; -drm_atomic_helper_resume (drm_dev, private->suspend_state); -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); - -return 0 ; +return drm_mode_config_helper_resume (drm_dev); }#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0
-17@@ -270,20 +270,3 @@ void exynos_drm_fbdev_fini(struct drm_device *dev) private->fb_helper =NULL ; } -void exynos_drm_fbdev_suspend (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,1 ); -console_unlock (); -} - -void exynos_drm_fbdev_resume (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,0 ); -console_unlock (); -}drivers/gpu/drm/exynos/exynos_drm_fbdev.h +0
-11@@ -19,8 +19,6 @@int exynos_drm_fbdev_init (struct drm_device *dev);void exynos_drm_fbdev_fini (struct drm_device *dev); -void exynos_drm_fbdev_suspend (struct drm_device *drm); -void exynos_drm_fbdev_resume (struct drm_device *drm);#else @@ -39,14 +37,6 @@ static inline void exynos_drm_fbdev_restore_mode(struct drm_device *dev)#define exynos_drm_output_poll_changed (NULL) -static inline void exynos_drm_fbdev_suspend (struct drm_device *drm) -{ -} - -static inline void exynos_drm_fbdev_resume (struct drm_device *drm) -{ -} -#endif #endif --1.9.1
Marek Szyprowski
Tested-byHi Souptick,
Quoted 8 lines · Souptick Joarder
Quoted 7 lines · Souptick Joarder
convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().exynos_drm_fbdev_suspend/resume can be removed
as drm_mode_config_helper_suspend/resume has
implement the same in generic way.
Quoted 8 lines
Quoted 7 lines
Signed-off-by Souptick Joarder <[email protected]>Signed-off-by Ajit Negi <[email protected]>---
v2: Address Inki Dae's comment. Remove
ret variable from both suspend/resume
function.Any further comment on this patch ?
However you need to rebase onto current drm-next, because there have been some changes, which prevent this patch from applying.
pm_runtime_suspended(dev) checks were useless and have been removed, what simplifies suspend/resume functions even more. Now it is too late for v4.19 merge window, so this patch will have to wait for v4.20.
Quoted 105 lines
Quoted 105 lines
drivers/gpu/drm/exynos/exynos_drm_drv.c | 26 ++++---------------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 17 ----------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 10 ---------- 3 files changed, 4 insertions(+), 49 deletions(-)drivers/gpu/drm/exynos/exynos_drm_drv.c +4
-22@@ -151,39 +151,21 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)static int exynos_drm_suspend (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; - -drm_kms_helper_poll_disable (drm_dev); -exynos_drm_fbdev_suspend (drm_dev); - private->suspend_state =drm_atomic_helper_suspend (drm_dev); -if (IS_ERR (private->suspend_state)) { -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); -return PTR_ERR (private->suspend_state); - } - -return 0 ; +return drm_mode_config_helper_suspend (drm_dev); }static int exynos_drm_resume (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; -drm_atomic_helper_resume (drm_dev, private->suspend_state); -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); - -return 0 ; +return drm_mode_config_helper_resume (drm_dev); }#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0
-17@@ -270,20 +270,3 @@ void exynos_drm_fbdev_fini(struct drm_device *dev) private->fb_helper =NULL ; } -void exynos_drm_fbdev_suspend (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,1 ); -console_unlock (); -} - -void exynos_drm_fbdev_resume (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,0 ); -console_unlock (); -}drivers/gpu/drm/exynos/exynos_drm_fbdev.h +0
-10@@ -19,8 +19,6 @@int exynos_drm_fbdev_init (struct drm_device *dev);void exynos_drm_fbdev_fini (struct drm_device *dev); -void exynos_drm_fbdev_suspend (struct drm_device *drm); -void exynos_drm_fbdev_resume (struct drm_device *drm);#else @@ -39,14 +37,6 @@ static inline void exynos_drm_fbdev_restore_mode(struct drm_device *dev)#define exynos_drm_output_poll_changed (NULL) -static inline void exynos_drm_fbdev_suspend (struct drm_device *drm) -{ -} - -static inline void exynos_drm_fbdev_resume (struct drm_device *drm) -{ -} -#endif
Quoted 10 lines
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_fbdev.h +0
-1#endif --1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Best regards
Signature · 2 lines
Marek Szyprowski, PhD Samsung R&D Institute Poland
Quoted 22 lines · Marek Szyprowski
Hi Souptick,
Quoted 8 lines · Souptick Joarder
Quoted 7 lines · Souptick Joarder
convert drm_atomic_helper_suspend/resume() to use
drm_mode_config_helper_suspend/resume().exynos_drm_fbdev_suspend/resume can be removed
as drm_mode_config_helper_suspend/resume has
implement the same in generic way.Quoted 8 lines
Quoted 7 lines
Signed-off-by Souptick Joarder <[email protected]>Signed-off-by Ajit Negi <[email protected]>---
v2: Address Inki Dae's comment. Remove
ret variable from both suspend/resume
function.Any further comment on this patch ?
Tested-by Marek Szyprowski <[email protected]>
Quoted 7 lines
However you need to rebase onto current drm-next, because there have been some changes, which prevent this patch from applying.
pm_runtime_suspended(dev)checks were useless and have been removed, what simplifies suspend/resume functions even more. Now it is too late for v4.19 merge window, so this patch will have to wait for v4.20.
Thanks, I will remove in v3 after rebase to drm-next.
Quoted 121 lines
Quoted 105 lines
Quoted 105 lines
drivers/gpu/drm/exynos/exynos_drm_drv.c | 26 ++++---------------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.c | 17 ----------------- drivers/gpu/drm/exynos/exynos_drm_fbdev.h | 10 ---------- 3 files changed, 4 insertions(+), 49 deletions(-)drivers/gpu/drm/exynos/exynos_drm_drv.c +4
-22@@ -151,39 +151,21 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)static int exynos_drm_suspend (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; - -drm_kms_helper_poll_disable (drm_dev); -exynos_drm_fbdev_suspend (drm_dev); - private->suspend_state =drm_atomic_helper_suspend (drm_dev); -if (IS_ERR (private->suspend_state)) { -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); -return PTR_ERR (private->suspend_state); - } - -return 0 ; +return drm_mode_config_helper_suspend (drm_dev); }static int exynos_drm_resume (struct device *dev) {struct drm_device *drm_dev =dev_get_drvdata (dev); -struct exynos_drm_private *private; -if (pm_runtime_suspended (dev) || !drm_dev) +if (pm_runtime_suspended (dev))return 0 ; - private = drm_dev->dev_private; -drm_atomic_helper_resume (drm_dev, private->suspend_state); -exynos_drm_fbdev_resume (drm_dev); -drm_kms_helper_poll_enable (drm_dev); - -return 0 ; +return drm_mode_config_helper_resume (drm_dev); }#endif drivers/gpu/drm/exynos/exynos_drm_fbdev.c +0
-17@@ -270,20 +270,3 @@ void exynos_drm_fbdev_fini(struct drm_device *dev) private->fb_helper =NULL ; } -void exynos_drm_fbdev_suspend (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,1 ); -console_unlock (); -} - -void exynos_drm_fbdev_resume (struct drm_device *dev) -{ -struct exynos_drm_private *private = dev->dev_private; - -console_lock (); -drm_fb_helper_set_suspend (private->fb_helper,0 ); -console_unlock (); -}drivers/gpu/drm/exynos/exynos_drm_fbdev.h +0
-10@@ -19,8 +19,6 @@int exynos_drm_fbdev_init (struct drm_device *dev);void exynos_drm_fbdev_fini (struct drm_device *dev); -void exynos_drm_fbdev_suspend (struct drm_device *drm); -void exynos_drm_fbdev_resume (struct drm_device *drm);#else @@ -39,14 +37,6 @@ static inline void exynos_drm_fbdev_restore_mode(struct drm_device *dev)#define exynos_drm_output_poll_changed (NULL) -static inline void exynos_drm_fbdev_suspend (struct drm_device *drm) -{ -} - -static inline void exynos_drm_fbdev_resume (struct drm_device *drm) -{ -} -#endif Quoted 10 lines
Quoted 4 lines
drivers/gpu/drm/exynos/exynos_drm_fbdev.h +0
-1#endif --1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.htmlBest regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland