From 8d4641d4f77024509cf57629f6567a28c92f4cc1 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 4 Jan 2017 10:58:45 +0200 Subject: [PATCH] drm: HACK: Do not start the polling within poll_init() Drivers from now needs to explicitly enable the poll when they need it. The only driver needs the polling to be disabled after it has been initialized is nouveau, which relied on the fact that in the past the work to do the actual poll was delayed by 10 seconds. Signed-off-by: Peter Ujfalusi --- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 1 + drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 1 + drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 1 + drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 1 + drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 1 + drivers/gpu/drm/arc/arcpgu_drv.c | 1 + drivers/gpu/drm/arm/hdlcd_drv.c | 1 + drivers/gpu/drm/arm/malidp_drv.c | 1 + drivers/gpu/drm/armada/armada_drv.c | 1 + drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 1 + drivers/gpu/drm/drm_probe_helper.c | 2 -- drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 + drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 1 + drivers/gpu/drm/gma500/psb_drv.c | 1 + drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 1 + drivers/gpu/drm/i915/i915_drv.c | 1 + drivers/gpu/drm/imx/imx-drm-core.c | 1 + drivers/gpu/drm/mediatek/mtk_drm_drv.c | 1 + drivers/gpu/drm/meson/meson_drv.c | 1 + drivers/gpu/drm/msm/msm_drv.c | 1 + drivers/gpu/drm/mxsfb/mxsfb_drv.c | 1 + drivers/gpu/drm/nouveau/nouveau_display.c | 1 - drivers/gpu/drm/omapdrm/omap_drv.c | 1 + drivers/gpu/drm/qxl/qxl_kms.c | 1 + drivers/gpu/drm/radeon/radeon_display.c | 1 + drivers/gpu/drm/rcar-du/rcar_du_kms.c | 1 + drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 1 + drivers/gpu/drm/shmobile/shmob_drm_kms.c | 1 + drivers/gpu/drm/sti/sti_drv.c | 1 + drivers/gpu/drm/sun4i/sun4i_drv.c | 1 + drivers/gpu/drm/tegra/drm.c | 1 + drivers/gpu/drm/tilcdc/tilcdc_drv.c | 1 + drivers/gpu/drm/vc4/vc4_kms.c | 1 + drivers/gpu/drm/zte/zx_drm_drv.c | 1 + 34 files changed, 32 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 9999dc71b998..5665fb9c9af6 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c @@ -3012,6 +3012,7 @@ static int dce_v10_0_sw_init(void *handle) return r; drm_kms_helper_poll_init(adev->ddev); + drm_kms_helper_poll_enable(adev->ddev); adev->mode_info.mode_config_initialized = true; return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index b3d62b909f43..ec67a8f86f1e 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c @@ -3067,6 +3067,7 @@ static int dce_v11_0_sw_init(void *handle) return r; drm_kms_helper_poll_init(adev->ddev); + drm_kms_helper_poll_enable(adev->ddev); adev->mode_info.mode_config_initialized = true; return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index b4e4ec630e8c..54c2af1144dd 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -2357,6 +2357,7 @@ static int dce_v6_0_sw_init(void *handle) return r; drm_kms_helper_poll_init(adev->ddev); + drm_kms_helper_poll_enable(adev->ddev); return r; } diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index 584abe834a3c..cccf540128b8 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c @@ -2859,6 +2859,7 @@ static int dce_v8_0_sw_init(void *handle) return r; drm_kms_helper_poll_init(adev->ddev); + drm_kms_helper_poll_enable(adev->ddev); adev->mode_info.mode_config_initialized = true; return 0; diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c index 762f8e82ceb7..1363dfd1ce0e 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c @@ -497,6 +497,7 @@ static int dce_virtual_sw_init(void *handle) } drm_kms_helper_poll_init(adev->ddev); + drm_kms_helper_poll_enable(adev->ddev); adev->mode_info.mode_config_initialized = true; return 0; diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c b/drivers/gpu/drm/arc/arcpgu_drv.c index 0b6eaa49a1db..777fee38f1f2 100644 --- a/drivers/gpu/drm/arc/arcpgu_drv.c +++ b/drivers/gpu/drm/arc/arcpgu_drv.c @@ -133,6 +133,7 @@ static int arcpgu_load(struct drm_device *drm) drm_mode_config_reset(drm); drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); arcpgu->fbdev = drm_fbdev_cma_init(drm, 16, drm->mode_config.num_crtc, diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index e5f4f4a6546d..9484d6f8fa5c 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c @@ -355,6 +355,7 @@ static int hdlcd_drm_bind(struct device *dev) drm_mode_config_reset(drm); drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); hdlcd->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc, drm->mode_config.num_connector); diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 32f746e31379..e35d247c8902 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -397,6 +397,7 @@ static int malidp_bind(struct device *dev) } drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); ret = drm_dev_register(drm, 0); if (ret) diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c index 07086b427c22..b0b8037d9380 100644 --- a/drivers/gpu/drm/armada/armada_drv.c +++ b/drivers/gpu/drm/armada/armada_drv.c @@ -194,6 +194,7 @@ static int armada_drm_bind(struct device *dev) goto err_comp; drm_kms_helper_poll_init(&priv->drm); + drm_kms_helper_poll_enable(&priv->drm); ret = drm_dev_register(&priv->drm, 0); if (ret) diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c index cbd0070265c9..f0948b88b66d 100644 --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c @@ -654,6 +654,7 @@ static int atmel_hlcdc_dc_load(struct drm_device *dev) platform_set_drvdata(pdev, dev); drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); /* force connectors detection */ drm_helper_hpd_irq_event(dev); diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index ac953f037be7..55cee6203ef4 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c @@ -521,8 +521,6 @@ void drm_kms_helper_poll_init(struct drm_device *dev) { INIT_DELAYED_WORK(&dev->mode_config.output_poll_work, output_poll_execute); dev->mode_config.poll_enabled = true; - - drm_kms_helper_poll_enable(dev); } EXPORT_SYMBOL(drm_kms_helper_poll_init); diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 739180ac3da5..c0cce8d89833 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -167,6 +167,7 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) /* init kms poll for handling hpd */ drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); /* force connectors detection */ drm_helper_hpd_irq_event(dev); diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c index d9d6cc1c8e39..3294075df506 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c @@ -49,6 +49,7 @@ int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev) drm_mode_config_reset(fsl_dev->drm); drm_kms_helper_poll_init(fsl_dev->drm); + drm_kms_helper_poll_enable(fsl_dev->drm); return 0; diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index ff37ea585664..5dddbeed6f76 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -378,6 +378,7 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags) psb_modeset_init(dev); psb_fbdev_init(dev); drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); /* Only add backlight support if we have LVDS output */ list_for_each_entry(connector, &dev->mode_config.connector_list, diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index ebd5f4fe4c23..06d7aceb1ddd 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c @@ -129,6 +129,7 @@ static int kirin_drm_kms_init(struct drm_device *dev) /* init kms poll for handling hpd */ drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); /* force detection after connectors init */ (void)drm_helper_hpd_irq_event(dev); diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 445fec9c2841..92e568e21432 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -622,6 +622,7 @@ static int i915_load_modeset_init(struct drm_device *dev) intel_hpd_init(dev_priv); drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); return 0; diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 33404295b447..3c2c172f5e20 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -399,6 +399,7 @@ static int imx_drm_bind(struct device *dev) #endif drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); ret = drm_dev_register(drm, 0); if (ret) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 4b7fe7eaec01..2e1538b17d42 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -220,6 +220,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) goto err_component_unbind; drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); drm_mode_config_reset(drm); return 0; diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index ff1f6019b97b..0a3e16faa503 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -287,6 +287,7 @@ static int meson_drv_probe(struct platform_device *pdev) } drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); platform_set_drvdata(pdev, priv); diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index e29bb66f55b1..e0b55e916bde 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -475,6 +475,7 @@ static int msm_drm_init(struct device *dev, struct drm_driver *drv) goto fail; drm_kms_helper_poll_init(ddev); + drm_kms_helper_poll_enable(ddev); return 0; diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c index 79a18bf48b54..6ad78fd03591 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c @@ -217,6 +217,7 @@ static int mxsfb_load(struct drm_device *drm, unsigned long flags) } drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); mxsfb->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc, drm->mode_config.num_connector); diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index cef08da1da4e..3afdec45de8a 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -534,7 +534,6 @@ nouveau_display_create(struct drm_device *dev) dev->mode_config.async_page_flip = true; drm_kms_helper_poll_init(dev); - drm_kms_helper_poll_disable(dev); if (nouveau_modeset != 2 && drm->vbios.dcb.entries) { static const u16 oclass[] = { diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index fdc83cbcde61..6c5211e52570 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -690,6 +690,7 @@ static int dev_load(struct drm_device *dev, unsigned long flags) dev_set_drvdata(dev->dev, dev); drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); return 0; } diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c index af685f1d91f8..d4a539f82eb3 100644 --- a/drivers/gpu/drm/qxl/qxl_kms.c +++ b/drivers/gpu/drm/qxl/qxl_kms.c @@ -326,6 +326,7 @@ int qxl_driver_load(struct drm_device *dev, unsigned long flags) goto unload; drm_kms_helper_poll_init(qdev->ddev); + drm_kms_helper_poll_enable(qdev->ddev); return 0; unload: diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index e7409e8a9f87..0b09697ed036 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c @@ -1666,6 +1666,7 @@ int radeon_modeset_init(struct radeon_device *rdev) radeon_fbdev_init(rdev); drm_kms_helper_poll_init(rdev->ddev); + drm_kms_helper_poll_enable(rdev->ddev); /* do pm late init */ ret = radeon_pm_late_init(rdev); diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index b5d3f16cfa12..b66c9ee5afdc 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -660,6 +660,7 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu) drm_mode_config_reset(dev); drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); if (dev->mode_config.num_connector) { fbdev = drm_fbdev_cma_init(dev, 32, dev->mode_config.num_crtc, diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index 2390c8577617..227fd12daedc 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -199,6 +199,7 @@ static int rockchip_drm_bind(struct device *dev) /* init kms poll for handling hpd */ drm_kms_helper_poll_init(drm_dev); + drm_kms_helper_poll_enable(drm_dev); /* * enable drm irq mode. diff --git a/drivers/gpu/drm/shmobile/shmob_drm_kms.c b/drivers/gpu/drm/shmobile/shmob_drm_kms.c index 388a0fc13564..ffa8f6518cfc 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_kms.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_kms.c @@ -147,6 +147,7 @@ int shmob_drm_modeset_init(struct shmob_drm_device *sdev) shmob_drm_connector_create(sdev, &sdev->encoder.encoder); drm_kms_helper_poll_init(sdev->ddev); + drm_kms_helper_poll_enable(sdev->ddev); sdev->ddev->mode_config.min_width = 0; sdev->ddev->mode_config.min_height = 0; diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index ff71e25ab5bf..57f9a3fc240b 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -360,6 +360,7 @@ static int sti_init(struct drm_device *ddev) sti_mode_config_init(ddev); drm_kms_helper_poll_init(ddev); + drm_kms_helper_poll_enable(ddev); return 0; } diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 4ce665349f6b..9c407fec1281 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -169,6 +169,7 @@ static int sun4i_drv_bind(struct device *dev) /* Enable connectors polling */ drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); ret = drm_dev_register(drm, 0); if (ret) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index b8be3ee4d3b8..825603ddf5c2 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -168,6 +168,7 @@ static int tegra_drm_load(struct drm_device *drm, unsigned long flags) goto config; drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); err = host1x_device_init(device); if (err < 0) diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index bd0a3bd07167..5d66f47b6236 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c @@ -411,6 +411,7 @@ static int tilcdc_init(struct drm_driver *ddrv, struct device *dev) } drm_kms_helper_poll_init(ddev); + drm_kms_helper_poll_enable(ddev); ret = drm_dev_register(ddev, 0); if (ret) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index be8dd8262f27..cb98964a7abb 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -237,6 +237,7 @@ int vc4_kms_load(struct drm_device *dev) vc4->fbdev = NULL; drm_kms_helper_poll_init(dev); + drm_kms_helper_poll_enable(dev); return 0; } diff --git a/drivers/gpu/drm/zte/zx_drm_drv.c b/drivers/gpu/drm/zte/zx_drm_drv.c index 3e76f72c92ff..e85284d04a53 100644 --- a/drivers/gpu/drm/zte/zx_drm_drv.c +++ b/drivers/gpu/drm/zte/zx_drm_drv.c @@ -140,6 +140,7 @@ static int zx_drm_bind(struct device *dev) drm_mode_config_reset(drm); drm_kms_helper_poll_init(drm); + drm_kms_helper_poll_enable(drm); priv->fbdev = drm_fbdev_cma_init(drm, 32, drm->mode_config.num_crtc, drm->mode_config.num_connector); -- 2.11.0