[5/5] drm/hisilicon: Remove custom FB helper deferred setup
diff mbox

Message ID 20170706130023.28417-5-daniel.vetter@ffwll.ch
State New
Headers show

Commit Message

Daniel Vetter July 6, 2017, 1 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

The FB helper core now supports deferred setup, so the driver's custom
implementation can be removed.

v2: Dont' resurrect drm_vblank_cleanup.

Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Cc: Rongrong Zou <zourongrong@gmail.com>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

Sean Paul July 7, 2017, 1:28 p.m. UTC | #1
On Thu, Jul 6, 2017 at 9:00 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> The FB helper core now supports deferred setup, so the driver's custom
> implementation can be removed.
>
> v2: Dont' resurrect drm_vblank_cleanup.
>
> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
> Cc: Rongrong Zou <zourongrong@gmail.com>
> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
> Cc: Chen Feng <puck.chen@hisilicon.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Sean Paul <seanpaul@chromium.org>

> ---
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index 8065d6cb1d7f..1178341c3858 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -54,14 +54,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
>  {
>         struct kirin_drm_private *priv = dev->dev_private;
>
> -       if (priv->fbdev) {
> -               drm_fbdev_cma_hotplug_event(priv->fbdev);
> -       } else {
> -               priv->fbdev = drm_fbdev_cma_init(dev, 32,
> -                                                dev->mode_config.num_connector);
> -               if (IS_ERR(priv->fbdev))
> -                       priv->fbdev = NULL;
> -       }
> +       drm_fbdev_cma_hotplug_event(priv->fbdev);
>  }
>  #endif
>
> @@ -128,11 +121,18 @@ static int kirin_drm_kms_init(struct drm_device *dev)
>         /* init kms poll for handling hpd */
>         drm_kms_helper_poll_init(dev);
>
> -       /* force detection after connectors init */
> -       (void)drm_helper_hpd_irq_event(dev);
> +       priv->fbdev = drm_fbdev_cma_init(dev, 32,
> +                                        dev->mode_config.num_connector);
> +       if (IS_ERR(priv->fbdev)) {
> +               DRM_ERROR("failed to initialize fbdev.\n");
> +               ret = PTR_ERR(priv->fbdev);
> +               goto err_cleanup_poll;
> +       }
>
>         return 0;
>
> +err_cleanup_poll:
> +       drm_kms_helper_poll_fini(dev);
>  err_unbind_all:
>         component_unbind_all(dev->dev, dev);
>  err_dc_cleanup:
> --
> 2.13.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter July 20, 2017, 5:59 p.m. UTC | #2
On Fri, Jul 07, 2017 at 09:28:11AM -0400, Sean Paul wrote:
> On Thu, Jul 6, 2017 at 9:00 AM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > From: Thierry Reding <treding@nvidia.com>
> >
> > The FB helper core now supports deferred setup, so the driver's custom
> > implementation can be removed.
> >
> > v2: Dont' resurrect drm_vblank_cleanup.
> >
> > Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
> > Cc: Rongrong Zou <zourongrong@gmail.com>
> > Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
> > Cc: Chen Feng <puck.chen@hisilicon.com>
> > Signed-off-by: Thierry Reding <treding@nvidia.com> (v1)
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Reviewed-by: Sean Paul <seanpaul@chromium.org>

Merged the final patches, thanks for your review.
-Daniel

> 
> > ---
> >  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> > index 8065d6cb1d7f..1178341c3858 100644
> > --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> > +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> > @@ -54,14 +54,7 @@ static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
> >  {
> >         struct kirin_drm_private *priv = dev->dev_private;
> >
> > -       if (priv->fbdev) {
> > -               drm_fbdev_cma_hotplug_event(priv->fbdev);
> > -       } else {
> > -               priv->fbdev = drm_fbdev_cma_init(dev, 32,
> > -                                                dev->mode_config.num_connector);
> > -               if (IS_ERR(priv->fbdev))
> > -                       priv->fbdev = NULL;
> > -       }
> > +       drm_fbdev_cma_hotplug_event(priv->fbdev);
> >  }
> >  #endif
> >
> > @@ -128,11 +121,18 @@ static int kirin_drm_kms_init(struct drm_device *dev)
> >         /* init kms poll for handling hpd */
> >         drm_kms_helper_poll_init(dev);
> >
> > -       /* force detection after connectors init */
> > -       (void)drm_helper_hpd_irq_event(dev);
> > +       priv->fbdev = drm_fbdev_cma_init(dev, 32,
> > +                                        dev->mode_config.num_connector);
> > +       if (IS_ERR(priv->fbdev)) {
> > +               DRM_ERROR("failed to initialize fbdev.\n");
> > +               ret = PTR_ERR(priv->fbdev);
> > +               goto err_cleanup_poll;
> > +       }
> >
> >         return 0;
> >
> > +err_cleanup_poll:
> > +       drm_kms_helper_poll_fini(dev);
> >  err_unbind_all:
> >         component_unbind_all(dev->dev, dev);
> >  err_dc_cleanup:
> > --
> > 2.13.2
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 8065d6cb1d7f..1178341c3858 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -54,14 +54,7 @@  static void kirin_fbdev_output_poll_changed(struct drm_device *dev)
 {
 	struct kirin_drm_private *priv = dev->dev_private;
 
-	if (priv->fbdev) {
-		drm_fbdev_cma_hotplug_event(priv->fbdev);
-	} else {
-		priv->fbdev = drm_fbdev_cma_init(dev, 32,
-						 dev->mode_config.num_connector);
-		if (IS_ERR(priv->fbdev))
-			priv->fbdev = NULL;
-	}
+	drm_fbdev_cma_hotplug_event(priv->fbdev);
 }
 #endif
 
@@ -128,11 +121,18 @@  static int kirin_drm_kms_init(struct drm_device *dev)
 	/* init kms poll for handling hpd */
 	drm_kms_helper_poll_init(dev);
 
-	/* force detection after connectors init */
-	(void)drm_helper_hpd_irq_event(dev);
+	priv->fbdev = drm_fbdev_cma_init(dev, 32,
+					 dev->mode_config.num_connector);
+	if (IS_ERR(priv->fbdev)) {
+		DRM_ERROR("failed to initialize fbdev.\n");
+		ret = PTR_ERR(priv->fbdev);
+		goto err_cleanup_poll;
+	}
 
 	return 0;
 
+err_cleanup_poll:
+	drm_kms_helper_poll_fini(dev);
 err_unbind_all:
 	component_unbind_all(dev->dev, dev);
 err_dc_cleanup: