[Intel-gfx] [PATCH] drm: Nuke ->vblank_disable_allowed

Alex Deucher alexdeucher at gmail.com
Wed May 18 20:02:45 UTC 2016


On Wed, May 18, 2016 at 3:47 PM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> This was added in
>
> commit 0a3e67a4caac273a3bfc4ced3da364830b1ab241
> Author: Jesse Barnes <jbarnes at virtuousgeek.org>
> Date:   Tue Sep 30 12:14:26 2008 -0700
>
>     drm: Rework vblank-wait handling to allow interrupt reduction.
>
> to stay backwards-compatible with old UMS code that didn't even tell
> the kernel when it did a modeset, so that the kernel could
> save/restore vblank counters. At worst this means vblanks will be
> somewhat funky on a setup that very likely no one still runs.
>
> So let's just nuke it.
>
> Plan B would be to set it unconditionally in drm_vblank_init for kms
> drivers, instead of in each driver separately. So if this patch breaks
> anything please only restore the hunks in drmP.h and drm_irq.c, plus
> add a check for DRIVER_MODESET in drm_vblank_init.
>
> Stumbled over this in a discussion on irc with Chris.
>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Liviu Dudau <liviu.dudau at arm.com>
> Cc: Russell King <rmk+kernel at arm.linux.org.uk>
> Cc: Thierry Reding <thierry.reding at gmail.com>
> Cc: Eric Anholt <eric at anholt.net>
> Cc: Laurent Pinchart <laurent.pinchart+renesas at ideasonboard.com>
> Cc: Inki Dae <inki.dae at samsung.com>
> Cc: Tomi Valkeinen <tomi.valkeinen at ti.com>
> Cc: Mark Yao <mark.yao at rock-chips.com>
> Cc: Sascha Hauer <s.hauer at pengutronix.de>
> Cc: Philipp Zabel <p.zabel at pengutronix.de>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c     | 1 -
>  drivers/gpu/drm/arm/hdlcd_drv.c             | 1 -
>  drivers/gpu/drm/armada/armada_drv.c         | 1 -
>  drivers/gpu/drm/drm_irq.c                   | 6 ------
>  drivers/gpu/drm/exynos/exynos_drm_drv.c     | 7 -------
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c   | 1 -
>  drivers/gpu/drm/gma500/psb_drv.c            | 1 -
>  drivers/gpu/drm/i915/i915_dma.c             | 3 ---
>  drivers/gpu/drm/i915/intel_psr.c            | 3 +++
>  drivers/gpu/drm/imx/imx-drm-core.c          | 7 -------
>  drivers/gpu/drm/radeon/radeon_irq_kms.c     | 1 -
>  drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 7 -------
>  drivers/gpu/drm/tegra/drm.c                 | 1 -
>  drivers/gpu/drm/vc4/vc4_kms.c               | 2 --
>  include/drm/drmP.h                          | 8 --------
>  15 files changed, 3 insertions(+), 47 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> index 9266c7b69808..835a3fa8d8df 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> @@ -219,7 +219,6 @@ int amdgpu_irq_init(struct amdgpu_device *adev)
>         if (r) {
>                 return r;
>         }
> -       adev->ddev->vblank_disable_allowed = true;
>
>         /* enable msi */
>         adev->irq.msi_enabled = false;
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 2112f0b105e3..4f909378d581 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -379,7 +379,6 @@ static int hdlcd_drm_bind(struct device *dev)
>                 DRM_ERROR("failed to initialise vblank\n");
>                 goto err_vblank;
>         }
> -       drm->vblank_disable_allowed = true;
>
>         drm_mode_config_reset(drm);
>         drm_kms_helper_poll_init(drm);
> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> index 531fcb946346..cb21c0b6374a 100644
> --- a/drivers/gpu/drm/armada/armada_drv.c
> +++ b/drivers/gpu/drm/armada/armada_drv.c
> @@ -113,7 +113,6 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags)
>                 goto err_comp;
>
>         dev->irq_enabled = true;
> -       dev->vblank_disable_allowed = 1;
>
>         ret = armada_fbdev_init(dev);
>         if (ret)
> diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
> index d1b5fc20b2f8..1a0ae89087e8 100644
> --- a/drivers/gpu/drm/drm_irq.c
> +++ b/drivers/gpu/drm/drm_irq.c
> @@ -348,9 +348,6 @@ static void vblank_disable_fn(unsigned long arg)
>         unsigned int pipe = vblank->pipe;
>         unsigned long irqflags;
>
> -       if (!dev->vblank_disable_allowed)
> -               return;
> -
>         spin_lock_irqsave(&dev->vbl_lock, irqflags);
>         if (atomic_read(&vblank->refcount) == 0 && vblank->enabled) {
>                 DRM_DEBUG("disabling vblank on crtc %u\n", pipe);
> @@ -437,8 +434,6 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs)
>                          "get_vblank_timestamp == NULL\n");
>         }
>
> -       dev->vblank_disable_allowed = false;
> -
>         return 0;
>
>  err:
> @@ -1555,7 +1550,6 @@ static void drm_legacy_vblank_post_modeset(struct drm_device *dev,
>
>         if (vblank->inmodeset) {
>                 spin_lock_irqsave(&dev->vbl_lock, irqflags);
> -               dev->vblank_disable_allowed = true;
>                 drm_reset_vblank_timestamp(dev, pipe);
>                 spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
>
> diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> index 21c719e8e02b..2dd820e23b0c 100644
> --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
> +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
> @@ -212,13 +212,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
>          */
>         dev->irq_enabled = true;
>
> -       /*
> -        * with vblank_disable_allowed = true, vblank interrupt will be disabled
> -        * by drm timer once a current process gives up ownership of
> -        * vblank event.(after drm_vblank_put function is called)
> -        */
> -       dev->vblank_disable_allowed = true;
> -
>         /* init kms poll for handling hpd */
>         drm_kms_helper_poll_init(dev);
>
> diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> index 2e58dfd74ae1..33727d5d826a 100644
> --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
> @@ -80,7 +80,6 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags)
>                 dev_err(dev->dev, "failed to initialize vblank\n");
>                 goto done;
>         }
> -       dev->vblank_disable_allowed = true;
>
>         ret = fsl_dcu_drm_irq_init(dev);
>         if (ret < 0)
> diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
> index 4e1c6850520e..82b8ce418b27 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.c
> +++ b/drivers/gpu/drm/gma500/psb_drv.c
> @@ -374,7 +374,6 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
>
>         drm_irq_install(dev, dev->pdev->irq);
>
> -       dev->vblank_disable_allowed = true;
>         dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */
>         dev->driver->get_vblank_counter = psb_get_vblank_counter;
>
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index a8c79f6512a4..fd06bff216ff 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -515,9 +515,6 @@ static int i915_load_modeset_init(struct drm_device *dev)
>
>         intel_modeset_gem_init(dev);
>
> -       /* Always safe in the mode setting case. */
> -       /* FIXME: do pre/post-mode set stuff in core KMS code */
> -       dev->vblank_disable_allowed = true;
>         if (INTEL_INFO(dev)->num_pipes == 0)
>                 return 0;
>
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index f9ce47135bb4..02fc5871b5b7 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -274,6 +274,9 @@ static void hsw_psr_enable_source(struct intel_dp *intel_dp)
>         if (dev_priv->psr.link_standby)
>                 val |= EDP_PSR_LINK_STANDBY;
>
> +       printk("tp1 wakupe time %i\n", dev_priv->vbt.psr.tp1_wakeup_time);
> +       printk("tp2/3 wakupe time %i\n", dev_priv->vbt.psr.tp2_tp3_wakeup_time);
> +

Some leftover debugging statements?

Alex


More information about the Intel-gfx mailing list