Re: [PATCH 4/4] drm/hisilicon: Remove custom FB helper deferred setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jun 03, 2016 at 06:11:19PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@xxxxxxxxxx>
> 
> The FB helper core now supports deferred setup, so the driver's custom
> implementation can be removed.
> 
> Cc: Xinliang Liu <z.liuxinliang@xxxxxxxxxxxxx>
> Cc: Xinwei Kong <kong.kongxinwei@xxxxxxxxxxxxx>
> Cc: Chen Feng <puck.chen@xxxxxxxxxxxxx>
> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
> ---
> Compile-tested only.
> 
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index 3f94785fbcca..0e0bd77e4499 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -54,15 +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_crtc,
> -				dev->mode_config.num_connector);
> -		if (IS_ERR(priv->fbdev))
> -			priv->fbdev = NULL;
> -	}
> +	drm_fbdev_cma_hotplug_event(priv->fbdev);

btw spotted a pile more if (priv->fbdev) conditions which could all be
removed for drm_fbdev_cma_hotplug_event, since that has that check
already. Care to type those patches and throw it on top?

Otherwise didn't spot anything in the driver conversion, lgtm for patches
2-4.
-Daniel

>  }
>  #endif
>  
> @@ -129,11 +121,19 @@ 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_crtc,
> +					 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);
> +	drm_vblank_cleanup(dev);
>  err_unbind_all:
>  	component_unbind_all(dev->dev, dev);
>  err_dc_cleanup:
> -- 
> 2.8.3
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux