Re: [PATCH v2] drm: Rely on mode_config data for fb_helper initialization

2017-03-01 Thread Daniel Vetter
On Wed, Mar 01, 2017 at 04:01:05PM -0300, Gabriel Krisman Bertazi wrote:
> Daniel Vetter  writes:
> 
> > You forgot to update the kernel-doc, building them now generates new
> > warnings. Please fix in a follow-up patch.
> 
> Hm, that´s a bummer.  Please take the fix below.  Thanks for spotting.

Applied, thx for the quick fix.
-Daniel

> 
> -- >8 --
> Subject: [PATCH] drm: Update drm_fbdev_cma_init documentation
> 
> Commit be7f735cd5ea ("drm: Rely on mode_config data for fb_helper
> initialization") dropped the num_crtc argument.  Update the
> documentation to reflect that and prevent the kernel-doc warnings below:
> 
> ./drivers/gpu/drm/drm_fb_cma_helper.c:557: warning: Excess function parameter 
> 'num_crtc' description in 'drm_fbdev_cma_init'
> ./drivers/gpu/drm/drm_fb_cma_helper.c:558: warning: Excess function parameter 
> 'num_crtc' description in 'drm_fbdev_cma_init'
> 
> Fixes: be7f735cd5ea ("drm: Rely on mode_config data for fb_helper 
> initialization")
> Signed-off-by: Gabriel Krisman Bertazi 
> ---
>  drivers/gpu/drm/drm_fb_cma_helper.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c 
> b/drivers/gpu/drm/drm_fb_cma_helper.c
> index be6d90664e50..74cd393a6407 100644
> --- a/drivers/gpu/drm/drm_fb_cma_helper.c
> +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
> @@ -547,7 +547,6 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_init_with_funcs);
>   * drm_fbdev_cma_init() - Allocate and initializes a drm_fbdev_cma struct
>   * @dev: DRM device
>   * @preferred_bpp: Preferred bits per pixel for the device
> - * @num_crtc: Number of CRTCs
>   * @max_conn_count: Maximum number of connectors
>   *
>   * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR.
> -- 
> 2.11.0
> 

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


Re: [PATCH v2] drm: Rely on mode_config data for fb_helper initialization

2017-03-01 Thread Gabriel Krisman Bertazi
Daniel Vetter  writes:

> You forgot to update the kernel-doc, building them now generates new
> warnings. Please fix in a follow-up patch.

Hm, that´s a bummer.  Please take the fix below.  Thanks for spotting.

-- >8 --
Subject: [PATCH] drm: Update drm_fbdev_cma_init documentation

Commit be7f735cd5ea ("drm: Rely on mode_config data for fb_helper
initialization") dropped the num_crtc argument.  Update the
documentation to reflect that and prevent the kernel-doc warnings below:

./drivers/gpu/drm/drm_fb_cma_helper.c:557: warning: Excess function parameter 
'num_crtc' description in 'drm_fbdev_cma_init'
./drivers/gpu/drm/drm_fb_cma_helper.c:558: warning: Excess function parameter 
'num_crtc' description in 'drm_fbdev_cma_init'

Fixes: be7f735cd5ea ("drm: Rely on mode_config data for fb_helper 
initialization")
Signed-off-by: Gabriel Krisman Bertazi 
---
 drivers/gpu/drm/drm_fb_cma_helper.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c 
b/drivers/gpu/drm/drm_fb_cma_helper.c
index be6d90664e50..74cd393a6407 100644
--- a/drivers/gpu/drm/drm_fb_cma_helper.c
+++ b/drivers/gpu/drm/drm_fb_cma_helper.c
@@ -547,7 +547,6 @@ EXPORT_SYMBOL_GPL(drm_fbdev_cma_init_with_funcs);
  * drm_fbdev_cma_init() - Allocate and initializes a drm_fbdev_cma struct
  * @dev: DRM device
  * @preferred_bpp: Preferred bits per pixel for the device
- * @num_crtc: Number of CRTCs
  * @max_conn_count: Maximum number of connectors
  *
  * Returns a newly allocated drm_fbdev_cma struct or a ERR_PTR.
-- 
2.11.0

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH v2] drm: Rely on mode_config data for fb_helper initialization

2017-03-01 Thread Daniel Vetter
On Thu, Feb 02, 2017 at 02:26:40PM -0200, Gabriel Krisman Bertazi wrote:
> Instead of receiving the num_crts as a parameter, we can read it
> directly from the mode_config structure.  I audited the drivers that
> invoke this helper and I believe all of them initialize the mode_config
> struct accordingly, prior to calling the fb_helper.
> 
> I used the following coccinelle hack to make this transformation, except
> for the function headers and comment updates.  The first and second
> rules are split because I couldn't find a way to remove the unused
> temporary variables at the same time I removed the parameter.
> 
> // 
> @r@
> expression A,B,D,E;
> identifier C;
> @@
> (
> - drm_fb_helper_init(A,B,C,D)
> + drm_fb_helper_init(A,B,D)
> |
> - drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
> + drm_fbdev_cma_init_with_funcs(A,B,D,E)
> |
> - drm_fbdev_cma_init(A,B,C,D)
> + drm_fbdev_cma_init(A,B,D)
> )
> 
> @@
> expression A,B,C,D,E;
> @@
> (
> - drm_fb_helper_init(A,B,C,D)
> + drm_fb_helper_init(A,B,D)
> |
> - drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
> + drm_fbdev_cma_init_with_funcs(A,B,D,E)
> |
> - drm_fbdev_cma_init(A,B,C,D)
> + drm_fbdev_cma_init(A,B,D)
> )
> 
> @@
> identifier r.C;
> type T;
> expression V;
> @@
> - T C;
> <...
> when != C
> - C = V;
> ...>
> // 
> 
> Changes since v1:
>  - Rebased on top of the tip of drm-misc-next.
>  - Remove mention to sti since a proper fix got merged.
> 
> Suggested-by: Daniel Vetter 
> Signed-off-by: Gabriel Krisman Bertazi 
> Reviewed-by: Eric Anholt 

You forgot to update the kernel-doc, building them now generates new
warnings. Please fix in a follow-up patch.

Thanks, Daniel
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c|  1 -
>  drivers/gpu/drm/arc/arcpgu_drv.c  |  3 +--
>  drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
>  drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
>  drivers/gpu/drm/armada/armada_fbdev.c |  2 +-
>  drivers/gpu/drm/ast/ast_fb.c  |  3 +--
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c  |  1 -
>  drivers/gpu/drm/bochs/bochs_fbdev.c   |  3 +--
>  drivers/gpu/drm/cirrus/cirrus_fbdev.c |  2 +-
>  drivers/gpu/drm/drm_fb_cma_helper.c   | 15 +++
>  drivers/gpu/drm/drm_fb_helper.c   | 10 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  5 +
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 +-
>  drivers/gpu/drm/gma500/framebuffer.c  |  2 +-
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c |  3 +--
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c   |  3 +--
>  drivers/gpu/drm/i915/intel_fbdev.c|  3 +--
>  drivers/gpu/drm/imx/imx-drm-core.c|  3 +--
>  drivers/gpu/drm/meson/meson_drv.c |  1 -
>  drivers/gpu/drm/mgag200/mgag200_fb.c  |  2 +-
>  drivers/gpu/drm/msm/msm_fbdev.c   |  3 +--
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_fbcon.c   |  3 +--
>  drivers/gpu/drm/omapdrm/omap_fbdev.c  |  3 +--
>  drivers/gpu/drm/qxl/qxl_fb.c  |  1 -
>  drivers/gpu/drm/radeon/radeon_fb.c|  1 -
>  drivers/gpu/drm/rcar-du/rcar_du_kms.c |  2 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c |  5 +
>  drivers/gpu/drm/sti/sti_drv.c |  2 +-
>  drivers/gpu/drm/sun4i/sun4i_framebuffer.c |  4 +---
>  drivers/gpu/drm/tegra/fb.c|  2 +-
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c   |  3 +--
>  drivers/gpu/drm/udl/udl_fb.c  |  3 +--
>  drivers/gpu/drm/vc4/vc4_kms.c |  1 -
>  drivers/gpu/drm/virtio/virtgpu_fb.c   |  1 -
>  drivers/gpu/drm/zte/zx_drm_drv.c  |  2 +-
>  include/drm/drm_fb_cma_helper.h   |  7 +++
>  include/drm/drm_fb_helper.h   |  3 +--
>  38 files changed, 43 insertions(+), 73 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> index 838943d0962e..36ce3cac81ba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> @@ -374,7 +374,6 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)
>   _fb_helper_funcs);
>  
>   ret = drm_fb_helper_init(adev->ddev, >helper,
> -  adev->mode_info.num_crtc,
>AMDGPUFB_CONN_LIMIT);
>   if (ret) {
>   kfree(rfbdev);
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c 
> b/drivers/gpu/drm/arc/arcpgu_drv.c
> index 0b6eaa49a1db..8d8344ed655e 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -135,8 +135,7 @@ static int arcpgu_load(struct drm_device *drm)
>   

Re: [PATCH v2] drm: Rely on mode_config data for fb_helper initialization

2017-02-02 Thread Daniel Vetter
On Thu, Feb 02, 2017 at 02:26:40PM -0200, Gabriel Krisman Bertazi wrote:
> Instead of receiving the num_crts as a parameter, we can read it
> directly from the mode_config structure.  I audited the drivers that
> invoke this helper and I believe all of them initialize the mode_config
> struct accordingly, prior to calling the fb_helper.
> 
> I used the following coccinelle hack to make this transformation, except
> for the function headers and comment updates.  The first and second
> rules are split because I couldn't find a way to remove the unused
> temporary variables at the same time I removed the parameter.
> 
> // 
> @r@
> expression A,B,D,E;
> identifier C;
> @@
> (
> - drm_fb_helper_init(A,B,C,D)
> + drm_fb_helper_init(A,B,D)
> |
> - drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
> + drm_fbdev_cma_init_with_funcs(A,B,D,E)
> |
> - drm_fbdev_cma_init(A,B,C,D)
> + drm_fbdev_cma_init(A,B,D)
> )
> 
> @@
> expression A,B,C,D,E;
> @@
> (
> - drm_fb_helper_init(A,B,C,D)
> + drm_fb_helper_init(A,B,D)
> |
> - drm_fbdev_cma_init_with_funcs(A,B,C,D,E)
> + drm_fbdev_cma_init_with_funcs(A,B,D,E)
> |
> - drm_fbdev_cma_init(A,B,C,D)
> + drm_fbdev_cma_init(A,B,D)
> )
> 
> @@
> identifier r.C;
> type T;
> expression V;
> @@
> - T C;
> <...
> when != C
> - C = V;
> ...>
> // 
> 
> Changes since v1:
>  - Rebased on top of the tip of drm-misc-next.
>  - Remove mention to sti since a proper fix got merged.
> 
> Suggested-by: Daniel Vetter 
> Signed-off-by: Gabriel Krisman Bertazi 
> Reviewed-by: Eric Anholt 

Yup, this applied cleanly, thanks for respinning.
-Daniel

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c|  1 -
>  drivers/gpu/drm/arc/arcpgu_drv.c  |  3 +--
>  drivers/gpu/drm/arm/hdlcd_drv.c   |  2 +-
>  drivers/gpu/drm/arm/malidp_drv.c  |  2 +-
>  drivers/gpu/drm/armada/armada_fbdev.c |  2 +-
>  drivers/gpu/drm/ast/ast_fb.c  |  3 +--
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c  |  1 -
>  drivers/gpu/drm/bochs/bochs_fbdev.c   |  3 +--
>  drivers/gpu/drm/cirrus/cirrus_fbdev.c |  2 +-
>  drivers/gpu/drm/drm_fb_cma_helper.c   | 15 +++
>  drivers/gpu/drm/drm_fb_helper.c   | 10 +-
>  drivers/gpu/drm/exynos/exynos_drm_fbdev.c |  5 +
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c |  2 +-
>  drivers/gpu/drm/gma500/framebuffer.c  |  2 +-
>  drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c |  3 +--
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c   |  3 +--
>  drivers/gpu/drm/i915/intel_fbdev.c|  3 +--
>  drivers/gpu/drm/imx/imx-drm-core.c|  3 +--
>  drivers/gpu/drm/meson/meson_drv.c |  1 -
>  drivers/gpu/drm/mgag200/mgag200_fb.c  |  2 +-
>  drivers/gpu/drm/msm/msm_fbdev.c   |  3 +--
>  drivers/gpu/drm/mxsfb/mxsfb_drv.c |  2 +-
>  drivers/gpu/drm/nouveau/nouveau_fbcon.c   |  3 +--
>  drivers/gpu/drm/omapdrm/omap_fbdev.c  |  3 +--
>  drivers/gpu/drm/qxl/qxl_fb.c  |  1 -
>  drivers/gpu/drm/radeon/radeon_fb.c|  1 -
>  drivers/gpu/drm/rcar-du/rcar_du_kms.c |  2 +-
>  drivers/gpu/drm/rockchip/rockchip_drm_fbdev.c |  5 +
>  drivers/gpu/drm/sti/sti_drv.c |  2 +-
>  drivers/gpu/drm/sun4i/sun4i_framebuffer.c |  4 +---
>  drivers/gpu/drm/tegra/fb.c|  2 +-
>  drivers/gpu/drm/tilcdc/tilcdc_drv.c   |  3 +--
>  drivers/gpu/drm/udl/udl_fb.c  |  3 +--
>  drivers/gpu/drm/vc4/vc4_kms.c |  1 -
>  drivers/gpu/drm/virtio/virtgpu_fb.c   |  1 -
>  drivers/gpu/drm/zte/zx_drm_drv.c  |  2 +-
>  include/drm/drm_fb_cma_helper.h   |  7 +++
>  include/drm/drm_fb_helper.h   |  3 +--
>  38 files changed, 43 insertions(+), 73 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> index 838943d0962e..36ce3cac81ba 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c
> @@ -374,7 +374,6 @@ int amdgpu_fbdev_init(struct amdgpu_device *adev)
>   _fb_helper_funcs);
>  
>   ret = drm_fb_helper_init(adev->ddev, >helper,
> -  adev->mode_info.num_crtc,
>AMDGPUFB_CONN_LIMIT);
>   if (ret) {
>   kfree(rfbdev);
> diff --git a/drivers/gpu/drm/arc/arcpgu_drv.c 
> b/drivers/gpu/drm/arc/arcpgu_drv.c
> index 0b6eaa49a1db..8d8344ed655e 100644
> --- a/drivers/gpu/drm/arc/arcpgu_drv.c
> +++ b/drivers/gpu/drm/arc/arcpgu_drv.c
> @@ -135,8 +135,7 @@ static int arcpgu_load(struct drm_device *drm)
>   drm_kms_helper_poll_init(drm);
>  
>   arcpgu->fbdev =