Re: [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-17 Thread Thomas Zimmermann

Hi

Am 16.01.23 um 21:47 schrieb Sam Ravnborg:

Hi Thomas.

On Mon, Jan 16, 2023 at 02:12:13PM +0100, Thomas Zimmermann wrote:

A lot of source files include drm_crtc_helper.h for its contained
include statements. This leads to excessive compile-time dependencies.

Where possible, remove the include statements for drm_crtc_helper.h
and include the required source files directly. Also remove the
include statements from drm_crtc_helper.h itself, which doesn't need
most of them.

With this patchset drm_crtc_helper usage is reduced from 85 places to 35
places. And the 35 places is only .c files.
This is a very nice reduction of bloat! I hope this has a measureable
effect on building times.


I cannot say what the effect is for a single header, but if we do this 
for all header files, the effect is measureable.




I was working on something similar, but that approach only added missing
includes, and did not kill all the unnessesary includes - which I think
is the biggest win here.

All patches are:
Reviewed-by: Sam Ravnborg 


Thank you.



For a few of them the r-b is conditional, see the specific comments
posted.


I fixed all your comments, including the minor complaint about the 
commit messages.


I don't intent to send out a v2 here, but the fixed patches should soon 
show up in drm-misc-next.


Best regards
Thomas




I did a build check here with the archs and config I verifies with.
This covers "alpha arm arm64 sparc64 i386 x86 powerpc s390 riscv sh"
and everything was fine. I have a few specific configs to pull in
drivers that need a bit extra to be built.
So I consider build coverage OK for applying, but it would be nice to
wait a few days for the bots to verify too.

My own work on slimming drm_atomic_helper.h and drm_print.h will be
rebased on top of your work before I continue it.
I need to look into removing unused includes too.

Sam



I built this patchset on x86-64, aarch64 and arm. Hopefully I found
all include dependencies.

Thanks to Sam Ravnborg for bringing this to my attention.

Thomas Zimmermann (22):
   drm/amdgpu: Fix coding style
   drm: Remove unnecessary include statements for drm_crtc_helper.h
   drm/amdgpu: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/arm/komeda: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/aspeed: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/ast: Remove unnecessary include statements for drm_crtc_helper.h
   drm/bridge: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/gma500: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/i2c/ch7006: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/ingenic: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/kmb: Remove unnecessary include statements for drm_crtc_helper.h
   drm/logicvc: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/nouveau: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/radeon: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/rockchip: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/shmobile: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/sprd: Remove unnecessary include statements for drm_crtc_helper.h
   drm/sun4i: Remove unnecessary include statements for drm_crtc_helper.h
   drm/tidss: Remove unnecessary include statements for drm_crtc_helper.h
   drm/udl: Remove unnecessary include statements for drm_crtc_helper.h
   drm/vboxvideo: Remove unnecessary include statements for
 drm_crtc_helper.h
   drm/crtc-helper: Remove most include statements from drm_crtc_helper.h

  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c |  2 ++
  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  5 +++--
  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c|  1 +
  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c   |  1 -
  drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c|  1 -
  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h   |  1 -
  drivers/gpu/drm/amd/amdgpu/atombios_crtc.c |  1 -
  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c |  1 -
  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c |  2 ++
  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c |  2 ++
  drivers/gpu/drm/amd/amdgpu/dce_v6_0.c  |  2 ++
  drivers/gpu/drm/amd/amdgpu/dce_v8_0.c  |  2 ++
  drivers/gpu/drm/arm/display/komeda/komeda_crtc.c   |  1 -
  drivers/gpu/drm/arm/display/komeda/komeda_kms.h|  1 -
  drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c   |  1 -
  drivers/gpu/drm/aspeed/aspeed_gfx_drv.c|  1 -
  drivers/gpu/drm/aspeed/aspeed_gfx_out.c|  1 -
  drivers/gpu/drm/ast/ast_drv.c  |  1 -
  drivers/gpu/drm/ast/ast_main.c |  1 -
  drivers/gpu/drm/ast/ast_mode.c |  1 -
  drivers/gpu/drm/bridge/analogix/analogix-anx6345.c 

Re: [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-17 Thread Thomas Zimmermann

Hi

Am 16.01.23 um 19:37 schrieb Alex Deucher:

On Mon, Jan 16, 2023 at 11:20 AM Jani Nikula
 wrote:


On Mon, 16 Jan 2023, Thomas Zimmermann  wrote:

A lot of source files include drm_crtc_helper.h for its contained
include statements. This leads to excessive compile-time dependencies.

Where possible, remove the include statements for drm_crtc_helper.h
and include the required source files directly. Also remove the
include statements from drm_crtc_helper.h itself, which doesn't need
most of them.

I built this patchset on x86-64, aarch64 and arm. Hopefully I found
all include dependencies.


I think this is the right direction and I support this. Personally I
think it's enough to build test and fix any fallout afterwards.

To that end, I did build test this myself with my config, and it was
fine, though that probably doesn't add much coverage.

FWIW,

Acked-by: Jani Nikula 


Agreed.  I applied 1/22 since it was an unrelated cleanup, but the
rest of the series is:
Acked-by: Alex Deucher 


Thanks to both of you. I'll leave out the first patch when merging the 
series.


Best regards
Thomas






--
Jani Nikula, Intel Open Source Graphics Center


--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


OpenPGP_signature
Description: OpenPGP digital signature


Re: [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-16 Thread Sam Ravnborg
Hi Thomas.

On Mon, Jan 16, 2023 at 02:12:13PM +0100, Thomas Zimmermann wrote:
> A lot of source files include drm_crtc_helper.h for its contained
> include statements. This leads to excessive compile-time dependencies.
> 
> Where possible, remove the include statements for drm_crtc_helper.h
> and include the required source files directly. Also remove the
> include statements from drm_crtc_helper.h itself, which doesn't need
> most of them.
With this patchset drm_crtc_helper usage is reduced from 85 places to 35
places. And the 35 places is only .c files.
This is a very nice reduction of bloat! I hope this has a measureable
effect on building times.

I was working on something similar, but that approach only added missing
includes, and did not kill all the unnessesary includes - which I think
is the biggest win here.

All patches are:
Reviewed-by: Sam Ravnborg 

For a few of them the r-b is conditional, see the specific comments
posted.


I did a build check here with the archs and config I verifies with.
This covers "alpha arm arm64 sparc64 i386 x86 powerpc s390 riscv sh"
and everything was fine. I have a few specific configs to pull in
drivers that need a bit extra to be built.
So I consider build coverage OK for applying, but it would be nice to
wait a few days for the bots to verify too.

My own work on slimming drm_atomic_helper.h and drm_print.h will be
rebased on top of your work before I continue it.
I need to look into removing unused includes too.

Sam

> 
> I built this patchset on x86-64, aarch64 and arm. Hopefully I found
> all include dependencies.
> 
> Thanks to Sam Ravnborg for bringing this to my attention.
> 
> Thomas Zimmermann (22):
>   drm/amdgpu: Fix coding style
>   drm: Remove unnecessary include statements for drm_crtc_helper.h
>   drm/amdgpu: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/arm/komeda: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/aspeed: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/ast: Remove unnecessary include statements for drm_crtc_helper.h
>   drm/bridge: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/gma500: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/i2c/ch7006: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/ingenic: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/kmb: Remove unnecessary include statements for drm_crtc_helper.h
>   drm/logicvc: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/nouveau: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/radeon: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/rockchip: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/shmobile: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/sprd: Remove unnecessary include statements for drm_crtc_helper.h
>   drm/sun4i: Remove unnecessary include statements for drm_crtc_helper.h
>   drm/tidss: Remove unnecessary include statements for drm_crtc_helper.h
>   drm/udl: Remove unnecessary include statements for drm_crtc_helper.h
>   drm/vboxvideo: Remove unnecessary include statements for
> drm_crtc_helper.h
>   drm/crtc-helper: Remove most include statements from drm_crtc_helper.h
> 
>  drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c |  2 ++
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  5 +++--
>  drivers/gpu/drm/amd/amdgpu/amdgpu_display.c|  1 +
>  drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c   |  1 -
>  drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c|  1 -
>  drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h   |  1 -
>  drivers/gpu/drm/amd/amdgpu/atombios_crtc.c |  1 -
>  drivers/gpu/drm/amd/amdgpu/atombios_encoders.c |  1 -
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c |  2 ++
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c |  2 ++
>  drivers/gpu/drm/amd/amdgpu/dce_v6_0.c  |  2 ++
>  drivers/gpu/drm/amd/amdgpu/dce_v8_0.c  |  2 ++
>  drivers/gpu/drm/arm/display/komeda/komeda_crtc.c   |  1 -
>  drivers/gpu/drm/arm/display/komeda/komeda_kms.h|  1 -
>  drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c   |  1 -
>  drivers/gpu/drm/aspeed/aspeed_gfx_drv.c|  1 -
>  drivers/gpu/drm/aspeed/aspeed_gfx_out.c|  1 -
>  drivers/gpu/drm/ast/ast_drv.c  |  1 -
>  drivers/gpu/drm/ast/ast_main.c |  1 -
>  drivers/gpu/drm/ast/ast_mode.c |  1 -
>  drivers/gpu/drm/bridge/analogix/analogix-anx6345.c |  1 -
>  drivers/gpu/drm/bridge/analogix/anx7625.c  |  1 -
>  .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c|  1 -
>  drivers/gpu/drm/bridge/ite-it6505.c|  1 -
>  drivers/gpu/drm/bridge/ite-it66121.c   |  1 -
>  drivers/gpu/drm/bridge/tc358768.c  |  1 -
>  

Re: [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-16 Thread Alex Deucher
On Mon, Jan 16, 2023 at 11:20 AM Jani Nikula
 wrote:
>
> On Mon, 16 Jan 2023, Thomas Zimmermann  wrote:
> > A lot of source files include drm_crtc_helper.h for its contained
> > include statements. This leads to excessive compile-time dependencies.
> >
> > Where possible, remove the include statements for drm_crtc_helper.h
> > and include the required source files directly. Also remove the
> > include statements from drm_crtc_helper.h itself, which doesn't need
> > most of them.
> >
> > I built this patchset on x86-64, aarch64 and arm. Hopefully I found
> > all include dependencies.
>
> I think this is the right direction and I support this. Personally I
> think it's enough to build test and fix any fallout afterwards.
>
> To that end, I did build test this myself with my config, and it was
> fine, though that probably doesn't add much coverage.
>
> FWIW,
>
> Acked-by: Jani Nikula 

Agreed.  I applied 1/22 since it was an unrelated cleanup, but the
rest of the series is:
Acked-by: Alex Deucher 

>
>
> --
> Jani Nikula, Intel Open Source Graphics Center


Re: [PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-16 Thread Jani Nikula
On Mon, 16 Jan 2023, Thomas Zimmermann  wrote:
> A lot of source files include drm_crtc_helper.h for its contained
> include statements. This leads to excessive compile-time dependencies.
>
> Where possible, remove the include statements for drm_crtc_helper.h
> and include the required source files directly. Also remove the
> include statements from drm_crtc_helper.h itself, which doesn't need
> most of them.
>
> I built this patchset on x86-64, aarch64 and arm. Hopefully I found
> all include dependencies.

I think this is the right direction and I support this. Personally I
think it's enough to build test and fix any fallout afterwards.

To that end, I did build test this myself with my config, and it was
fine, though that probably doesn't add much coverage.

FWIW,

Acked-by: Jani Nikula 


-- 
Jani Nikula, Intel Open Source Graphics Center


[PATCH 00/22] drm: Remove includes for drm_crtc_helper.h

2023-01-16 Thread Thomas Zimmermann
A lot of source files include drm_crtc_helper.h for its contained
include statements. This leads to excessive compile-time dependencies.

Where possible, remove the include statements for drm_crtc_helper.h
and include the required source files directly. Also remove the
include statements from drm_crtc_helper.h itself, which doesn't need
most of them.

I built this patchset on x86-64, aarch64 and arm. Hopefully I found
all include dependencies.

Thanks to Sam Ravnborg for bringing this to my attention.

Thomas Zimmermann (22):
  drm/amdgpu: Fix coding style
  drm: Remove unnecessary include statements for drm_crtc_helper.h
  drm/amdgpu: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/arm/komeda: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/aspeed: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/ast: Remove unnecessary include statements for drm_crtc_helper.h
  drm/bridge: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/gma500: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/i2c/ch7006: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/ingenic: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/kmb: Remove unnecessary include statements for drm_crtc_helper.h
  drm/logicvc: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/nouveau: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/radeon: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/rockchip: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/shmobile: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/sprd: Remove unnecessary include statements for drm_crtc_helper.h
  drm/sun4i: Remove unnecessary include statements for drm_crtc_helper.h
  drm/tidss: Remove unnecessary include statements for drm_crtc_helper.h
  drm/udl: Remove unnecessary include statements for drm_crtc_helper.h
  drm/vboxvideo: Remove unnecessary include statements for
drm_crtc_helper.h
  drm/crtc-helper: Remove most include statements from drm_crtc_helper.h

 drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c |  2 ++
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c |  5 +++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c|  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c   |  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c|  1 -
 drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h   |  1 -
 drivers/gpu/drm/amd/amdgpu/atombios_crtc.c |  1 -
 drivers/gpu/drm/amd/amdgpu/atombios_encoders.c |  1 -
 drivers/gpu/drm/amd/amdgpu/dce_v10_0.c |  2 ++
 drivers/gpu/drm/amd/amdgpu/dce_v11_0.c |  2 ++
 drivers/gpu/drm/amd/amdgpu/dce_v6_0.c  |  2 ++
 drivers/gpu/drm/amd/amdgpu/dce_v8_0.c  |  2 ++
 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c   |  1 -
 drivers/gpu/drm/arm/display/komeda/komeda_kms.h|  1 -
 drivers/gpu/drm/aspeed/aspeed_gfx_crtc.c   |  1 -
 drivers/gpu/drm/aspeed/aspeed_gfx_drv.c|  1 -
 drivers/gpu/drm/aspeed/aspeed_gfx_out.c|  1 -
 drivers/gpu/drm/ast/ast_drv.c  |  1 -
 drivers/gpu/drm/ast/ast_main.c |  1 -
 drivers/gpu/drm/ast/ast_mode.c |  1 -
 drivers/gpu/drm/bridge/analogix/analogix-anx6345.c |  1 -
 drivers/gpu/drm/bridge/analogix/anx7625.c  |  1 -
 .../gpu/drm/bridge/cadence/cdns-mhdp8546-core.c|  1 -
 drivers/gpu/drm/bridge/ite-it6505.c|  1 -
 drivers/gpu/drm/bridge/ite-it66121.c   |  1 -
 drivers/gpu/drm/bridge/tc358768.c  |  1 -
 drivers/gpu/drm/bridge/tc358775.c  |  1 -
 drivers/gpu/drm/drm_crtc_helper.c  |  1 -
 drivers/gpu/drm/drm_lease.c|  2 +-
 drivers/gpu/drm/drm_plane_helper.c |  1 -
 drivers/gpu/drm/gma500/cdv_device.c|  1 +
 drivers/gpu/drm/gma500/cdv_intel_crt.c |  2 ++
 drivers/gpu/drm/gma500/cdv_intel_display.c |  1 +
 drivers/gpu/drm/gma500/cdv_intel_dp.c  |  1 +
 drivers/gpu/drm/gma500/cdv_intel_hdmi.c|  2 ++
 drivers/gpu/drm/gma500/cdv_intel_lvds.c|  2 ++
 drivers/gpu/drm/gma500/framebuffer.c   |  2 ++
 drivers/gpu/drm/gma500/gma_display.c   |  2 ++
 drivers/gpu/drm/gma500/oaktrail_crtc.c |  1 +
 drivers/gpu/drm/gma500/oaktrail_hdmi.c |  2 ++
 drivers/gpu/drm/gma500/oaktrail_lvds.c |  1 +
 drivers/gpu/drm/gma500/psb_device.c|  1 +
 drivers/gpu/drm/gma500/psb_intel_display.c |  3 +++
 drivers/gpu/drm/gma500/psb_intel_drv.h |  1 -
 drivers/gpu/drm/gma500/psb_intel_lvds.c|  2 ++
 drivers/gpu/drm/gma500/psb_intel_sdvo.c|  2 ++
 drivers/gpu/drm/i2c/ch7006_drv.c   |  2 ++
 drivers/gpu/drm/i2c/ch7006_priv.h