drm/komeda: Adds power management support
Subsystems (4)
PATCH 1/1 drm/komeda: Adds power management support
From: "Lowry Li (Arm Technology China)" <[email protected]>
Adds system power management support in KMS kernel driver.
Depends on:
https://patchwork.freedesktop.org/series/62377/
Changes since v1:
Since we have unified mclk/pclk/pipeline->aclk to one mclk, which will be turned on/off when crtc atomic enable/disable, removed runtime power management.
Removes run time get/put related flow.
Adds to disable the aclk when register access finished.
Changes since v2:
Rebases to the drm-misc-next branch.
--- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 1 - .../gpu/drm/arm/display/komeda/komeda_dev.c | 65 +++++++++++++++++-- .../gpu/drm/arm/display/komeda/komeda_dev.h | 3 + .../gpu/drm/arm/display/komeda/komeda_drv.c | 30 ++++++++- 4 files changed, 91 insertions(+), 8 deletions(-)
drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +0 -1
@@ -5,7 +5,6 @@* */ #include <linux/clk.h> -#include <linux/pm_runtime.h> #include <linux/spinlock.h> #include <drm/drm_atomic.h>
drivers/gpu/drm/arm/display/komeda/komeda_dev.c +59 -6
113 lines not on this page · raw message
drivers/gpu/drm/arm/display/komeda/komeda_dev.h +3 -0
@@ -224,4 +224,7 @@ void komeda_print_events(struct komeda_events *evts);static inline void komeda_print_events (struct komeda_events *evts) {}#endif +int komeda_dev_resume (struct komeda_dev *mdev); +int komeda_dev_suspend (struct komeda_dev *mdev); +#endif /*_KOMEDA_DEV_H_*/
drivers/gpu/drm/arm/display/komeda/komeda_drv.c +29 -1
@@ -8,6 +8,7 @@#include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/component.h> +#include <linux/pm_runtime.h> #include <drm/drm_of.h> #include "komeda_dev.h" #include "komeda_kms.h"
@@ -136,13 +137,40 @@ static const struct of_device_id komeda_of_match[] = {MODULE_DEVICE_TABLE (of, komeda_of_match); +static int __maybe_unused komeda_pm_suspend (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; +int res; + + res =drm_mode_config_helper_suspend (drm); + +komeda_dev_suspend (mdrv->mdev); + +return res; +} + +static int __maybe_unused komeda_pm_resume (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; + +komeda_dev_resume (mdrv->mdev); + +return drm_mode_config_helper_resume (drm); +} + +static const struct dev_pm_ops komeda_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (komeda_pm_suspend, komeda_pm_resume) +}; +static struct platform_driver komeda_platform_driver = { .probe = komeda_platform_probe, .remove = komeda_platform_remove, .driver = { .name ="komeda" , .of_match_table = komeda_of_match, - .pm =NULL , + .pm = &komeda_pm_ops, }, };
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 14 lines · Lowry Li (Arm Technology China)
From: "Lowry Li (Arm Technology China)" <[email protected]>
Adds system power management support in KMS kernel driver.
Depends on:
https://patchwork.freedesktop.org/series/62377/Changes since v1:
Since we have unified mclk/pclk/pipeline->aclk to one mclk, which will be turned on/off when crtc atomic enable/disable, removed runtime power management.
Removes run time get/put related flow.
Adds to disable the aclk when register access finished.
Quoted 4 lines
Changes since v2:
Rebases to the drm-misc-next branch.Signed-off-by Lowry Li (Arm Technology China) <[email protected]>
Looks good to me.
will push it to drm-misc-next.
Quoted 198 lines
--- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 1 - .../gpu/drm/arm/display/komeda/komeda_dev.c | 65 +++++++++++++++++-- .../gpu/drm/arm/display/komeda/komeda_dev.h | 3 + .../gpu/drm/arm/display/komeda/komeda_drv.c | 30 ++++++++- 4 files changed, 91 insertions(+), 8 deletions(-)drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +0
-1@@ -5,7 +5,6 @@* */ #include <linux/clk.h> -#include <linux/pm_runtime.h> #include <linux/spinlock.h> #include <drm/drm_atomic.h> drivers/gpu/drm/arm/display/komeda/komeda_dev.c +59
-6@@ -258,7 +258,7 @@ struct komeda_dev *komeda_dev_create(struct device *dev) product->product_id, MALIDP_CORE_ID_PRODUCT_ID(mdev->chip.core_id)); err = -ENODEV ; - goto err_cleanup; + goto disable_clk; } DRM_INFO("Found ARM Mali-D%x version r%dp%d\n",@@ -271,19 +271,19 @@ struct komeda_dev *komeda_dev_create(struct device *dev) err = mdev->funcs->enum_resources (mdev);if (err) {DRM_ERROR ("enumerate display resource failed.\n" ); - goto err_cleanup; + goto disable_clk; } err =komeda_parse_dt (dev, mdev);if (err) {DRM_ERROR ("parse device tree failed.\n" ); - goto err_cleanup; + goto disable_clk; } err =komeda_assemble_pipelines (mdev);if (err) {DRM_ERROR ("assemble display pipelines failed.\n" ); - goto err_cleanup; + goto disable_clk; } dev->dma_parms = &mdev->dma_parms;@@ -296,11 +296,14 @@ struct komeda_dev *komeda_dev_create(struct device *dev)if (mdev->iommu && mdev->funcs->connect_iommu) { err = mdev->funcs->connect_iommu (mdev);if (err) { +DRM_ERROR ("connect iommu failed.\n" ); mdev->iommu =NULL ; - goto err_cleanup; + goto disable_clk; } } +clk_disable_unprepare (mdev->aclk); + err =sysfs_create_group (&dev->kobj, &komeda_sysfs_attr_group);if (err) {DRM_ERROR ("create sysfs group failed.\n" );@@ -313,6 +316,8 @@ struct komeda_dev *komeda_dev_create(struct device *dev)return mdev; +disable_clk: +clk_disable_unprepare (mdev->aclk); err_cleanup:komeda_dev_destroy (mdev);return ERR_PTR (err);@@ -330,8 +335,12 @@ void komeda_dev_destroy(struct komeda_dev *mdev)debugfs_remove_recursive (mdev->debugfs_root);#endif +if (mdev->aclk) +clk_prepare_enable (mdev->aclk); +if (mdev->iommu && mdev->funcs->disconnect_iommu) - mdev->funcs->disconnect_iommu (mdev); +if (mdev->funcs->disconnect_iommu (mdev)) +DRM_ERROR ("disconnect iommu failed.\n" ); mdev->iommu =NULL ;for (i =0 ; i < mdev->n_pipelines; i++) {@@ -359,3 +368,47 @@ void komeda_dev_destroy(struct komeda_dev *mdev)devm_kfree (dev, mdev); } + +int komeda_dev_resume (struct komeda_dev *mdev) +{ +int ret =0 ; + +clk_prepare_enable (mdev->aclk); + +if (mdev->iommu && mdev->funcs->connect_iommu) { + ret = mdev->funcs->connect_iommu (mdev); +if (ret <0 ) { +DRM_ERROR ("connect iommu failed.\n" ); + goto disable_clk; + } + } + + ret = mdev->funcs->enable_irq (mdev); + +disable_clk: +clk_disable_unprepare (mdev->aclk); + +return ret; +} + +int komeda_dev_suspend (struct komeda_dev *mdev) +{ +int ret =0 ; + +clk_prepare_enable (mdev->aclk); + +if (mdev->iommu && mdev->funcs->disconnect_iommu) { + ret = mdev->funcs->disconnect_iommu (mdev); +if (ret <0 ) { +DRM_ERROR ("disconnect iommu failed.\n" ); + goto disable_clk; + } + } + + ret = mdev->funcs->disable_irq (mdev); + +disable_clk: +clk_disable_unprepare (mdev->aclk); + +return ret; +}drivers/gpu/drm/arm/display/komeda/komeda_dev.h +3
-0@@ -224,4 +224,7 @@ void komeda_print_events(struct komeda_events *evts);static inline void komeda_print_events (struct komeda_events *evts) {}#endif +int komeda_dev_resume (struct komeda_dev *mdev); +int komeda_dev_suspend (struct komeda_dev *mdev); +#endif /*_KOMEDA_DEV_H_*/ drivers/gpu/drm/arm/display/komeda/komeda_drv.c +28
-0@@ -8,6 +8,7 @@#include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/component.h> +#include <linux/pm_runtime.h> #include <drm/drm_of.h> #include "komeda_dev.h" #include "komeda_kms.h" @@ -136,13 +137,40 @@ static const struct of_device_id komeda_of_match[] = {MODULE_DEVICE_TABLE (of, komeda_of_match); +static int __maybe_unused komeda_pm_suspend (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; +int res; + + res =drm_mode_config_helper_suspend (drm); + +komeda_dev_suspend (mdrv->mdev); + +return res; +} + +static int __maybe_unused komeda_pm_resume (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; + +komeda_dev_resume (mdrv->mdev); + +return drm_mode_config_helper_resume (drm); +} + +static const struct dev_pm_ops komeda_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (komeda_pm_suspend, komeda_pm_resume) +}; +static struct platform_driver komeda_platform_driver = {
drivers/gpu/drm/arm/display/komeda/komeda_drv.c static const struct of_device_id komeda_of_match[] = { · line 176
Quoted 10 lines
drivers/gpu/drm/arm/display/komeda/komeda_drv.c +1
-1.probe = komeda_platform_probe, .remove = komeda_platform_remove, .driver = { .name = "komeda", .of_match_table = komeda_of_match, - .pm = NULL, + .pm = &komeda_pm_ops, }, };
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 185 lines · Lowry Li (Arm Technology China)
From: "Lowry Li (Arm Technology China)" <[email protected]>
Adds system power management support in KMS kernel driver.
Depends on:
https://patchwork.freedesktop.org/series/62377/Changes since v1:
Since we have unified mclk/pclk/pipeline->aclk to one mclk, which will be turned on/off when crtc atomic enable/disable, removed runtime power management.
Removes run time get/put related flow.
Adds to disable the aclk when register access finished.Changes since v2:
Rebases to the drm-misc-next branch.Signed-off-by Lowry Li (Arm Technology China) <[email protected]>--- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 1 - .../gpu/drm/arm/display/komeda/komeda_dev.c | 65 +++++++++++++++++-- .../gpu/drm/arm/display/komeda/komeda_dev.h | 3 + .../gpu/drm/arm/display/komeda/komeda_drv.c | 30 ++++++++- 4 files changed, 91 insertions(+), 8 deletions(-)drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +0
-1@@ -5,7 +5,6 @@* */ #include <linux/clk.h> -#include <linux/pm_runtime.h> #include <linux/spinlock.h> #include <drm/drm_atomic.h> drivers/gpu/drm/arm/display/komeda/komeda_dev.c +59
-6@@ -258,7 +258,7 @@ struct komeda_dev *komeda_dev_create(struct device *dev) product->product_id, MALIDP_CORE_ID_PRODUCT_ID(mdev->chip.core_id)); err = -ENODEV ; - goto err_cleanup; + goto disable_clk; } DRM_INFO("Found ARM Mali-D%x version r%dp%d\n",@@ -271,19 +271,19 @@ struct komeda_dev *komeda_dev_create(struct device *dev) err = mdev->funcs->enum_resources (mdev);if (err) {DRM_ERROR ("enumerate display resource failed.\n" ); - goto err_cleanup; + goto disable_clk; } err =komeda_parse_dt (dev, mdev);if (err) {DRM_ERROR ("parse device tree failed.\n" ); - goto err_cleanup; + goto disable_clk; } err =komeda_assemble_pipelines (mdev);if (err) {DRM_ERROR ("assemble display pipelines failed.\n" ); - goto err_cleanup; + goto disable_clk; } dev->dma_parms = &mdev->dma_parms;@@ -296,11 +296,14 @@ struct komeda_dev *komeda_dev_create(struct device *dev)if (mdev->iommu && mdev->funcs->connect_iommu) { err = mdev->funcs->connect_iommu (mdev);if (err) { +DRM_ERROR ("connect iommu failed.\n" ); mdev->iommu =NULL ; - goto err_cleanup; + goto disable_clk; } } +clk_disable_unprepare (mdev->aclk); + err =sysfs_create_group (&dev->kobj, &komeda_sysfs_attr_group);if (err) {DRM_ERROR ("create sysfs group failed.\n" );@@ -313,6 +316,8 @@ struct komeda_dev *komeda_dev_create(struct device *dev)return mdev; +disable_clk: +clk_disable_unprepare (mdev->aclk); err_cleanup:komeda_dev_destroy (mdev);return ERR_PTR (err);@@ -330,8 +335,12 @@ void komeda_dev_destroy(struct komeda_dev *mdev)debugfs_remove_recursive (mdev->debugfs_root);#endif +if (mdev->aclk) +clk_prepare_enable (mdev->aclk); +if (mdev->iommu && mdev->funcs->disconnect_iommu) - mdev->funcs->disconnect_iommu (mdev); +if (mdev->funcs->disconnect_iommu (mdev)) +DRM_ERROR ("disconnect iommu failed.\n" ); mdev->iommu =NULL ;for (i =0 ; i < mdev->n_pipelines; i++) {@@ -359,3 +368,47 @@ void komeda_dev_destroy(struct komeda_dev *mdev)devm_kfree (dev, mdev); } + +int komeda_dev_resume (struct komeda_dev *mdev) +{ +int ret =0 ; + +clk_prepare_enable (mdev->aclk); + +if (mdev->iommu && mdev->funcs->connect_iommu) { + ret = mdev->funcs->connect_iommu (mdev); +if (ret <0 ) { +DRM_ERROR ("connect iommu failed.\n" ); + goto disable_clk; + } + } + + ret = mdev->funcs->enable_irq (mdev); + +disable_clk: +clk_disable_unprepare (mdev->aclk); + +return ret; +} + +int komeda_dev_suspend (struct komeda_dev *mdev) +{ +int ret =0 ; + +clk_prepare_enable (mdev->aclk); + +if (mdev->iommu && mdev->funcs->disconnect_iommu) { + ret = mdev->funcs->disconnect_iommu (mdev); +if (ret <0 ) { +DRM_ERROR ("disconnect iommu failed.\n" ); + goto disable_clk; + } + } + + ret = mdev->funcs->disable_irq (mdev); + +disable_clk: +clk_disable_unprepare (mdev->aclk); + +return ret; +}drivers/gpu/drm/arm/display/komeda/komeda_dev.h +3
-0@@ -224,4 +224,7 @@ void komeda_print_events(struct komeda_events *evts);static inline void komeda_print_events (struct komeda_events *evts) {}#endif +int komeda_dev_resume (struct komeda_dev *mdev); +int komeda_dev_suspend (struct komeda_dev *mdev); +#endif /*_KOMEDA_DEV_H_*/ drivers/gpu/drm/arm/display/komeda/komeda_drv.c +1
-0@@ -8,6 +8,7 @@#include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/component.h> +#include <linux/pm_runtime.h> #include <drm/drm_of.h> #include "komeda_dev.h" #include "komeda_kms.h"
drivers/gpu/drm/arm/display/komeda/komeda_drv.c static const struct of_device_id komeda_of_match[] = { · line 146
Quoted 10 lines
drivers/gpu/drm/arm/display/komeda/komeda_drv.c +7
-0@@ -136,13 +137,40 @@ static const struct of_device_id komeda_of_match[] = {MODULE_DEVICE_TABLE (of, komeda_of_match); +static int __maybe_unused komeda_pm_suspend (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; +int res; + + res =drm_mode_config_helper_suspend (drm);
Just noticed this while prepping the -misc pull request.
You should use the atomic helpers instead, drm_atomic_helper_suspend and drm_atomic_helper_resume.
Quoted 38 lines
drivers/gpu/drm/arm/display/komeda/komeda_drv.c +21
-1+ +komeda_dev_suspend (mdrv->mdev); + +return res; +} + +static int __maybe_unused komeda_pm_resume (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; + +komeda_dev_resume (mdrv->mdev); + +return drm_mode_config_helper_resume (drm); +} + +static const struct dev_pm_ops komeda_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (komeda_pm_suspend, komeda_pm_resume) +}; +static struct platform_driver komeda_platform_driver = { .probe = komeda_platform_probe, .remove = komeda_platform_remove, .driver = { .name ="komeda" , .of_match_table = komeda_of_match, - .pm =NULL , + .pm = &komeda_pm_ops, }, };Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 1 line
Sean Paul, Software Engineer, Google / Chromium OS
Quoted 200 lines · Sean Paul
Quoted 185 lines · Lowry Li (Arm Technology China)
From: "Lowry Li (Arm Technology China)" <[email protected]>
Adds system power management support in KMS kernel driver.
Depends on:
https://patchwork.freedesktop.org/series/62377/Changes since v1:
Since we have unified mclk/pclk/pipeline->aclk to one mclk, which will be turned on/off when crtc atomic enable/disable, removed runtime power management.
Removes run time get/put related flow.
Adds to disable the aclk when register access finished.Changes since v2:
Rebases to the drm-misc-next branch.Signed-off-by Lowry Li (Arm Technology China) <[email protected]>--- .../gpu/drm/arm/display/komeda/komeda_crtc.c | 1 - .../gpu/drm/arm/display/komeda/komeda_dev.c | 65 +++++++++++++++++-- .../gpu/drm/arm/display/komeda/komeda_dev.h | 3 + .../gpu/drm/arm/display/komeda/komeda_drv.c | 30 ++++++++- 4 files changed, 91 insertions(+), 8 deletions(-)drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +0
-1@@ -5,7 +5,6 @@* */ #include <linux/clk.h> -#include <linux/pm_runtime.h> #include <linux/spinlock.h> #include <drm/drm_atomic.h> drivers/gpu/drm/arm/display/komeda/komeda_dev.c +59
-6@@ -258,7 +258,7 @@ struct komeda_dev *komeda_dev_create(struct device *dev) product->product_id, MALIDP_CORE_ID_PRODUCT_ID(mdev->chip.core_id)); err = -ENODEV ; - goto err_cleanup; + goto disable_clk; } DRM_INFO("Found ARM Mali-D%x version r%dp%d\n",@@ -271,19 +271,19 @@ struct komeda_dev *komeda_dev_create(struct device *dev) err = mdev->funcs->enum_resources (mdev);if (err) {DRM_ERROR ("enumerate display resource failed.\n" ); - goto err_cleanup; + goto disable_clk; } err =komeda_parse_dt (dev, mdev);if (err) {DRM_ERROR ("parse device tree failed.\n" ); - goto err_cleanup; + goto disable_clk; } err =komeda_assemble_pipelines (mdev);if (err) {DRM_ERROR ("assemble display pipelines failed.\n" ); - goto err_cleanup; + goto disable_clk; } dev->dma_parms = &mdev->dma_parms;@@ -296,11 +296,14 @@ struct komeda_dev *komeda_dev_create(struct device *dev)if (mdev->iommu && mdev->funcs->connect_iommu) { err = mdev->funcs->connect_iommu (mdev);if (err) { +DRM_ERROR ("connect iommu failed.\n" ); mdev->iommu =NULL ; - goto err_cleanup; + goto disable_clk; } } +clk_disable_unprepare (mdev->aclk); + err =sysfs_create_group (&dev->kobj, &komeda_sysfs_attr_group);if (err) {DRM_ERROR ("create sysfs group failed.\n" );@@ -313,6 +316,8 @@ struct komeda_dev *komeda_dev_create(struct device *dev)return mdev; +disable_clk: +clk_disable_unprepare (mdev->aclk); err_cleanup:komeda_dev_destroy (mdev);return ERR_PTR (err);@@ -330,8 +335,12 @@ void komeda_dev_destroy(struct komeda_dev *mdev)debugfs_remove_recursive (mdev->debugfs_root);#endif +if (mdev->aclk) +clk_prepare_enable (mdev->aclk); +if (mdev->iommu && mdev->funcs->disconnect_iommu) - mdev->funcs->disconnect_iommu (mdev); +if (mdev->funcs->disconnect_iommu (mdev)) +DRM_ERROR ("disconnect iommu failed.\n" ); mdev->iommu =NULL ;for (i =0 ; i < mdev->n_pipelines; i++) {@@ -359,3 +368,47 @@ void komeda_dev_destroy(struct komeda_dev *mdev)devm_kfree (dev, mdev); } + +int komeda_dev_resume (struct komeda_dev *mdev) +{ +int ret =0 ; + +clk_prepare_enable (mdev->aclk); + +if (mdev->iommu && mdev->funcs->connect_iommu) { + ret = mdev->funcs->connect_iommu (mdev); +if (ret <0 ) { +DRM_ERROR ("connect iommu failed.\n" ); + goto disable_clk; + } + } + + ret = mdev->funcs->enable_irq (mdev); + +disable_clk: +clk_disable_unprepare (mdev->aclk); + +return ret; +} + +int komeda_dev_suspend (struct komeda_dev *mdev) +{ +int ret =0 ; + +clk_prepare_enable (mdev->aclk); + +if (mdev->iommu && mdev->funcs->disconnect_iommu) { + ret = mdev->funcs->disconnect_iommu (mdev); +if (ret <0 ) { +DRM_ERROR ("disconnect iommu failed.\n" ); + goto disable_clk; + } + } + + ret = mdev->funcs->disable_irq (mdev); + +disable_clk: +clk_disable_unprepare (mdev->aclk); + +return ret; +}drivers/gpu/drm/arm/display/komeda/komeda_dev.h +3
-0@@ -224,4 +224,7 @@ void komeda_print_events(struct komeda_events *evts);static inline void komeda_print_events (struct komeda_events *evts) {}#endif +int komeda_dev_resume (struct komeda_dev *mdev); +int komeda_dev_suspend (struct komeda_dev *mdev); +#endif /*_KOMEDA_DEV_H_*/ drivers/gpu/drm/arm/display/komeda/komeda_drv.c +1
-0@@ -8,6 +8,7 @@#include <linux/kernel.h> #include <linux/platform_device.h> #include <linux/component.h> +#include <linux/pm_runtime.h> #include <drm/drm_of.h> #include "komeda_dev.h" #include "komeda_kms.h" drivers/gpu/drm/arm/display/komeda/komeda_drv.c static const struct of_device_id komeda_of_match[] = { · line 146
Quoted 10 lines
drivers/gpu/drm/arm/display/komeda/komeda_drv.c +7
-0@@ -136,13 +137,40 @@ static const struct of_device_id komeda_of_match[] = {MODULE_DEVICE_TABLE (of, komeda_of_match); +static int __maybe_unused komeda_pm_suspend (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; +int res; + + res =drm_mode_config_helper_suspend (drm);Just noticed this while prepping the -misc pull request.
Quoted 3 lines
You should use the atomic helpers instead,
drm_atomic_helper_suspendanddrm_atomic_helper_resume.
Hmm, looks like I was mistaken. For some reason, I thought this was legacy but looking into mode_config_helper_suspend(), that will gets you kms_helper_poll_disable/enable as well as stashes the state in mode_config. So less work is better :)
Sean
Quoted 34 lines
Quoted 34 lines
drivers/gpu/drm/arm/display/komeda/komeda_drv.c +21
-2+ +komeda_dev_suspend (mdrv->mdev); + +return res; +} + +static int __maybe_unused komeda_pm_resume (struct device *dev) +{ +struct komeda_drv *mdrv =dev_get_drvdata (dev); +struct drm_device *drm = &mdrv->kms->base; + +komeda_dev_resume (mdrv->mdev); + +return drm_mode_config_helper_resume (drm); +} + +static const struct dev_pm_ops komeda_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (komeda_pm_suspend, komeda_pm_resume) +}; +static struct platform_driver komeda_platform_driver = { .probe = komeda_platform_probe, .remove = komeda_platform_remove, .driver = { .name ="komeda" , .of_match_table = komeda_of_match, - .pm =NULL , + .pm = &komeda_pm_ops, }, }; --2.17.1
Quoted 7 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel--
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel