From: "Lowry Li (Arm Technology China)" <[email protected]>
Initialize and enable output polling on Komeda.
Changes since v1:
1. Enable the polling before registering the driver;
2. Disable the polling after unregistering the driver.
Changes since v2:
1. If driver register failed, disable the polling.
Signed-off-by: Lowry Li (Arm Technology China) <[email protected]>
---
drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
index 419a8b0..d50e75f 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
@@ -15,6 +15,7 @@
#include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_irq.h>
#include <drm/drm_vblank.h>
+#include <drm/drm_probe_helper.h>
#include "komeda_dev.h"
#include "komeda_framebuffer.h"
@@ -315,6 +316,8 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
drm->irq_enabled = true;
+ drm_kms_helper_poll_init(drm);
+
err = drm_dev_register(drm, 0);
if (err)
goto cleanup_mode_config;
@@ -322,6 +325,7 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
return kms;
cleanup_mode_config:
+ drm_kms_helper_poll_fini(drm);
drm->irq_enabled = false;
drm_mode_config_cleanup(drm);
komeda_kms_cleanup_private_objs(kms);
@@ -338,6 +342,7 @@ void komeda_kms_detach(struct komeda_kms_dev *kms)
drm->irq_enabled = false;
mdev->funcs->disable_irq(mdev);
drm_dev_unregister(drm);
+ drm_kms_helper_poll_fini(drm);
component_unbind_all(mdev->dev, drm);
komeda_kms_cleanup_private_objs(kms);
drm_mode_config_cleanup(drm);
--
1.9.1
On Fri, Aug 02, 2019 at 08:07:52AM +0000, Lowry Li (Arm Technology China) wrote:
> From: "Lowry Li (Arm Technology China)" <[email protected]>
>
> Initialize and enable output polling on Komeda.
>
> Changes since v1:
> 1. Enable the polling before registering the driver;
> 2. Disable the polling after unregistering the driver.
>
> Changes since v2:
> 1. If driver register failed, disable the polling.
>
> Signed-off-by: Lowry Li (Arm Technology China) <[email protected]>
> ---
> drivers/gpu/drm/arm/display/komeda/komeda_kms.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> index 419a8b0..d50e75f 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> @@ -15,6 +15,7 @@
> #include <drm/drm_gem_framebuffer_helper.h>
> #include <drm/drm_irq.h>
> #include <drm/drm_vblank.h>
> +#include <drm/drm_probe_helper.h>
>
> #include "komeda_dev.h"
> #include "komeda_framebuffer.h"
> @@ -315,6 +316,8 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
>
> drm->irq_enabled = true;
>
> + drm_kms_helper_poll_init(drm);
> +
> err = drm_dev_register(drm, 0);
> if (err)
> goto cleanup_mode_config;
> @@ -322,6 +325,7 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
> return kms;
>
> cleanup_mode_config:
> + drm_kms_helper_poll_fini(drm);
> drm->irq_enabled = false;
> drm_mode_config_cleanup(drm);
> komeda_kms_cleanup_private_objs(kms);
> @@ -338,6 +342,7 @@ void komeda_kms_detach(struct komeda_kms_dev *kms)
> drm->irq_enabled = false;
> mdev->funcs->disable_irq(mdev);
> drm_dev_unregister(drm);
> + drm_kms_helper_poll_fini(drm);
> component_unbind_all(mdev->dev, drm);
> komeda_kms_cleanup_private_objs(kms);
> drm_mode_config_cleanup(drm);
Looks good to me.
Reviewed-by: James Qian Wang (Arm Technology China) <[email protected]>