aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_crtc_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 11fe9c870d17..45981304feb8 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -831,13 +831,11 @@ int drm_helper_resume_force_mode(struct drm_device *dev)
831} 831}
832EXPORT_SYMBOL(drm_helper_resume_force_mode); 832EXPORT_SYMBOL(drm_helper_resume_force_mode);
833 833
834static struct slow_work_ops output_poll_ops;
835
836#define DRM_OUTPUT_POLL_PERIOD (10*HZ) 834#define DRM_OUTPUT_POLL_PERIOD (10*HZ)
837static void output_poll_execute(struct slow_work *work) 835static void output_poll_execute(struct work_struct *work)
838{ 836{
839 struct delayed_slow_work *delayed_work = container_of(work, struct delayed_slow_work, work); 837 struct delayed_work *delayed_work = to_delayed_work(work);
840 struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_slow_work); 838 struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work);
841 struct drm_connector *connector; 839 struct drm_connector *connector;
842 enum drm_connector_status old_status, status; 840 enum drm_connector_status old_status, status;
843 bool repoll = false, changed = false; 841 bool repoll = false, changed = false;
@@ -877,7 +875,7 @@ static void output_poll_execute(struct slow_work *work)
877 } 875 }
878 876
879 if (repoll) { 877 if (repoll) {
880 ret = delayed_slow_work_enqueue(delayed_work, DRM_OUTPUT_POLL_PERIOD); 878 ret = queue_delayed_work(system_nrt_wq, delayed_work, DRM_OUTPUT_POLL_PERIOD);
881 if (ret) 879 if (ret)
882 DRM_ERROR("delayed enqueue failed %d\n", ret); 880 DRM_ERROR("delayed enqueue failed %d\n", ret);
883 } 881 }
@@ -887,7 +885,7 @@ void drm_kms_helper_poll_disable(struct drm_device *dev)
887{ 885{
888 if (!dev->mode_config.poll_enabled) 886 if (!dev->mode_config.poll_enabled)
889 return; 887 return;
890 delayed_slow_work_cancel(&dev->mode_config.output_poll_slow_work); 888 cancel_delayed_work_sync(&dev->mode_config.output_poll_work);
891} 889}
892EXPORT_SYMBOL(drm_kms_helper_poll_disable); 890EXPORT_SYMBOL(drm_kms_helper_poll_disable);
893 891
@@ -903,7 +901,7 @@ void drm_kms_helper_poll_enable(struct drm_device *dev)
903 } 901 }
904 902
905 if (poll) { 903 if (poll) {
906 ret = delayed_slow_work_enqueue(&dev->mode_config.output_poll_slow_work, DRM_OUTPUT_POLL_PERIOD); 904 ret = queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD);
907 if (ret) 905 if (ret)
908 DRM_ERROR("delayed enqueue failed %d\n", ret); 906 DRM_ERROR("delayed enqueue failed %d\n", ret);
909 } 907 }
@@ -912,9 +910,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_enable);
912 910
913void drm_kms_helper_poll_init(struct drm_device *dev) 911void drm_kms_helper_poll_init(struct drm_device *dev)
914{ 912{
915 slow_work_register_user(THIS_MODULE); 913 INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute);
916 delayed_slow_work_init(&dev->mode_config.output_poll_slow_work,
917 &output_poll_ops);
918 dev->mode_config.poll_enabled = true; 914 dev->mode_config.poll_enabled = true;
919 915
920 drm_kms_helper_poll_enable(dev); 916 drm_kms_helper_poll_enable(dev);
@@ -924,7 +920,6 @@ EXPORT_SYMBOL(drm_kms_helper_poll_init);
924void drm_kms_helper_poll_fini(struct drm_device *dev) 920void drm_kms_helper_poll_fini(struct drm_device *dev)
925{ 921{
926 drm_kms_helper_poll_disable(dev); 922 drm_kms_helper_poll_disable(dev);
927 slow_work_unregister_user(THIS_MODULE);
928} 923}
929EXPORT_SYMBOL(drm_kms_helper_poll_fini); 924EXPORT_SYMBOL(drm_kms_helper_poll_fini);
930 925
@@ -932,12 +927,8 @@ void drm_helper_hpd_irq_event(struct drm_device *dev)
932{ 927{
933 if (!dev->mode_config.poll_enabled) 928 if (!dev->mode_config.poll_enabled)
934 return; 929 return;
935 delayed_slow_work_cancel(&dev->mode_config.output_poll_slow_work); 930 /* kill timer and schedule immediate execution, this doesn't block */
936 /* schedule a slow work asap */ 931 cancel_delayed_work(&dev->mode_config.output_poll_work);
937 delayed_slow_work_enqueue(&dev->mode_config.output_poll_slow_work, 0); 932 queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, 0);
938} 933}
939EXPORT_SYMBOL(drm_helper_hpd_irq_event); 934EXPORT_SYMBOL(drm_helper_hpd_irq_event);
940
941static struct slow_work_ops output_poll_ops = {
942 .execute = output_poll_execute,
943};