mbox series

[v1,0/6] drm: make headers self-contained

Message ID 20190519142036.22861-1-sam@ravnborg.org (mailing list archive)
Headers show
Series drm: make headers self-contained | expand

Message

Sam Ravnborg May 19, 2019, 2:20 p.m. UTC
While removing use of drmP.h from files in drm/* I
noticed that I had to add the same include files due to
build errors in the header files.

It is better to let the header files include what is necessary
and let the users pull in only the additional headers files required.
So I went ahead and made the header files self-conatined.
(I did not check if this made any includes redundant in some files,
I do not have tooling in place to do so).

These patches are preparation for removing use of drmP.h in all
the files in drm/*

I have the patchset ready - one patch per file.
It is a lot of small patches (59) and maybe it is better to
squash them all into one big patch. Any opinions on this?

I will await feedback on this patchset before sending the
patch(es) to remove drmP.h in drm/*

	Sam

Sam Ravnborg (6):
      drm: make drm_auth.h self contained
      drm: make drm_legacy.h self-contained
      drm: make drm_crtc_internal.h self-contained
      drm: make drm_internal.h self-contained
      drm: make drm_legacy.h self-contained
      drm: make drm_trace.h self-contained

 drivers/gpu/drm/drm_crtc_internal.h | 24 ++++++++++++++++++++----
 drivers/gpu/drm/drm_internal.h      | 10 +++++++++-
 drivers/gpu/drm/drm_legacy.h        |  4 ++++
 drivers/gpu/drm/drm_trace.h         |  2 ++
 include/drm/drm_auth.h              |  7 +++++++
 include/drm/drm_legacy.h            |  2 ++
 6 files changed, 44 insertions(+), 5 deletions(-)

Comments

Daniel Vetter May 20, 2019, 6:45 p.m. UTC | #1
On Sun, May 19, 2019 at 04:20:30PM +0200, Sam Ravnborg wrote:
> While removing use of drmP.h from files in drm/* I
> noticed that I had to add the same include files due to
> build errors in the header files.
> 
> It is better to let the header files include what is necessary
> and let the users pull in only the additional headers files required.
> So I went ahead and made the header files self-conatined.
> (I did not check if this made any includes redundant in some files,
> I do not have tooling in place to do so).

I think it'd be great to make sure this keeps being the case. Jani Nikula
just pointed me at some neat stuff in drm/i915/Makefile.header-test.

I think it'd be nice to have something similar for drm headers in
drivers/gpu/drm, behind a Kconfig option perhaps so that it doesn't upset
people, but 0day will still spot issues. That would also make the series
easier to review, since each patch would add the header it fixes to that
build target.
 
> These patches are preparation for removing use of drmP.h in all
> the files in drm/*
> 
> I have the patchset ready - one patch per file.
> It is a lot of small patches (59) and maybe it is better to
> squash them all into one big patch. Any opinions on this?

Imo fine to have a huge patch pile for this.

> I will await feedback on this patchset before sending the
> patch(es) to remove drmP.h in drm/*

Sounds good.

Cheers, Daniel

> 
> 	Sam
> 
> Sam Ravnborg (6):
>       drm: make drm_auth.h self contained
>       drm: make drm_legacy.h self-contained
>       drm: make drm_crtc_internal.h self-contained
>       drm: make drm_internal.h self-contained
>       drm: make drm_legacy.h self-contained
>       drm: make drm_trace.h self-contained
> 
>  drivers/gpu/drm/drm_crtc_internal.h | 24 ++++++++++++++++++++----
>  drivers/gpu/drm/drm_internal.h      | 10 +++++++++-
>  drivers/gpu/drm/drm_legacy.h        |  4 ++++
>  drivers/gpu/drm/drm_trace.h         |  2 ++
>  include/drm/drm_auth.h              |  7 +++++++
>  include/drm/drm_legacy.h            |  2 ++
>  6 files changed, 44 insertions(+), 5 deletions(-)
>
Sam Ravnborg May 20, 2019, 7:13 p.m. UTC | #2
Hi Daniel.

On Mon, May 20, 2019 at 08:45:26PM +0200, Daniel Vetter wrote:
> On Sun, May 19, 2019 at 04:20:30PM +0200, Sam Ravnborg wrote:
> > While removing use of drmP.h from files in drm/* I
> > noticed that I had to add the same include files due to
> > build errors in the header files.
> > 
> > It is better to let the header files include what is necessary
> > and let the users pull in only the additional headers files required.
> > So I went ahead and made the header files self-conatined.
> > (I did not check if this made any includes redundant in some files,
> > I do not have tooling in place to do so).
> 
> I think it'd be great to make sure this keeps being the case. Jani Nikula
> just pointed me at some neat stuff in drm/i915/Makefile.header-test.
> 

> I think it'd be nice to have something similar for drm headers in
> drivers/gpu/drm, behind a Kconfig option perhaps so that it doesn't upset
> people, but 0day will still spot issues. That would also make the series
> easier to review, since each patch would add the header it fixes to that
> build target.
I would like to wait with this until Jani's general solution:
https://www.spinics.net/lists/linux-kbuild/msg21839.html
hits mainline.

I can also duplicate what Jani already did and then migrate to the
general solution when it is ready.
Hmm. I think this is the best way forward.
So we can have all the other functionality in place.
Let me give this a shot and get back with a few patches.

	Sam