drm/komeda: Initialize and enable output polling on Komeda

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: default avatarLowry Li (Arm Technology China) <lowry.li@arm.com>
Reviewed-by: default avatarJames Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: default avatarjames qian wang (Arm Technology China) <james.qian.wang@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1564733249-24329-1-git-send-email-lowry.li@arm.com
parent f7ccbed6
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <drm/drm_gem_framebuffer_helper.h> #include <drm/drm_gem_framebuffer_helper.h>
#include <drm/drm_irq.h> #include <drm/drm_irq.h>
#include <drm/drm_vblank.h> #include <drm/drm_vblank.h>
#include <drm/drm_probe_helper.h>
#include "komeda_dev.h" #include "komeda_dev.h"
#include "komeda_framebuffer.h" #include "komeda_framebuffer.h"
...@@ -315,6 +316,8 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev) ...@@ -315,6 +316,8 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
drm->irq_enabled = true; drm->irq_enabled = true;
drm_kms_helper_poll_init(drm);
err = drm_dev_register(drm, 0); err = drm_dev_register(drm, 0);
if (err) if (err)
goto cleanup_mode_config; goto cleanup_mode_config;
...@@ -322,6 +325,7 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev) ...@@ -322,6 +325,7 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
return kms; return kms;
cleanup_mode_config: cleanup_mode_config:
drm_kms_helper_poll_fini(drm);
drm->irq_enabled = false; drm->irq_enabled = false;
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
komeda_kms_cleanup_private_objs(kms); komeda_kms_cleanup_private_objs(kms);
...@@ -338,6 +342,7 @@ void komeda_kms_detach(struct komeda_kms_dev *kms) ...@@ -338,6 +342,7 @@ void komeda_kms_detach(struct komeda_kms_dev *kms)
drm->irq_enabled = false; drm->irq_enabled = false;
mdev->funcs->disable_irq(mdev); mdev->funcs->disable_irq(mdev);
drm_dev_unregister(drm); drm_dev_unregister(drm);
drm_kms_helper_poll_fini(drm);
component_unbind_all(mdev->dev, drm); component_unbind_all(mdev->dev, drm);
komeda_kms_cleanup_private_objs(kms); komeda_kms_cleanup_private_objs(kms);
drm_mode_config_cleanup(drm); drm_mode_config_cleanup(drm);
......
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