diff mbox series

[2/4] drm/i915: fix include order in intel_tc.*

Message ID 20190704000649.20661-3-lucas.demarchi@intel.com (mailing list archive)
State New, archived
Headers show
Series Modular FIA | expand

Commit Message

Lucas De Marchi July 4, 2019, 12:06 a.m. UTC
Make intel_tc.h the first include so we guarantee it's self-contained.
Sort the rest. Same principle applies for includes in the header.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
 drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

Comments

Imre Deak July 4, 2019, 1:56 p.m. UTC | #1
On Wed, Jul 03, 2019 at 05:06:47PM -0700, Lucas De Marchi wrote:
> Make intel_tc.h the first include so we guarantee it's self-contained.
> Sort the rest. Same principle applies for includes in the header.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
>  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
> index 1a9dd32fb0a5..e6e6163c1232 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.c
> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> @@ -3,10 +3,11 @@
>   * Copyright © 2019 Intel Corporation
>   */
>  
> +#include "intel_tc.h"

I get your point to keep the self-contained check work even without the
header test files, but I'm not sure if we need that, since there is the
header test file approach in place. I haven't seen this done anywhere
else, so we shouldn't make an exception here either imo.

+Jani for that.

Fixing the rest of my ABC screw-up looks ok.

> +
> +#include "i915_drv.h"
>  #include "intel_display.h"
>  #include "intel_dp_mst.h"
> -#include "i915_drv.h"
> -#include "intel_tc.h"
>  
>  static const char *tc_port_mode_name(enum tc_port_mode mode)
>  {
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.h b/drivers/gpu/drm/i915/display/intel_tc.h
> index 0d8411d4a91d..45ae30537b78 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.h
> +++ b/drivers/gpu/drm/i915/display/intel_tc.h
> @@ -6,10 +6,11 @@
>  #ifndef __INTEL_TC_H__
>  #define __INTEL_TC_H__
>  
> -#include <linux/types.h>
> -#include <linux/mutex.h>
>  #include "intel_drv.h"
>  
> +#include <linux/mutex.h>
> +#include <linux/types.h>
> +
>  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
>  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
>  int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port);
> -- 
> 2.21.0
>
Michal Wajdeczko July 4, 2019, 5:21 p.m. UTC | #2
On Thu, 04 Jul 2019 02:06:47 +0200, Lucas De Marchi  
<lucas.demarchi@intel.com> wrote:

> Make intel_tc.h the first include so we guarantee it's self-contained.
> Sort the rest. Same principle applies for includes in the header.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
>  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c  
> b/drivers/gpu/drm/i915/display/intel_tc.c
> index 1a9dd32fb0a5..e6e6163c1232 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.c
> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> @@ -3,10 +3,11 @@
>   * Copyright © 2019 Intel Corporation
>   */
> +#include "intel_tc.h"
> +
> +#include "i915_drv.h"

this master header will likely include everything, so while
your .h is now self-contained, .c remains unclean

>  #include "intel_display.h"
>  #include "intel_dp_mst.h"
> -#include "i915_drv.h"
> -#include "intel_tc.h"
> static const char *tc_port_mode_name(enum tc_port_mode mode)
>  {
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.h  
> b/drivers/gpu/drm/i915/display/intel_tc.h
> index 0d8411d4a91d..45ae30537b78 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.h
> +++ b/drivers/gpu/drm/i915/display/intel_tc.h
> @@ -6,10 +6,11 @@
>  #ifndef __INTEL_TC_H__
>  #define __INTEL_TC_H__
> -#include <linux/types.h>
> -#include <linux/mutex.h>
>  #include "intel_drv.h"

are you sure you want this giant header to be included here?
note that it will #include almost everything (i915_drv.h too)
and may introduce hard to resolve circular dependencies

> +#include <linux/mutex.h>

we don't need mutex definitions here in current header file

> +#include <linux/types.h>
> +

so you need only above types.h and then add forward decl for:

struct intel_digital_port;

>  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
>  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
>  int intel_tc_port_fia_max_lane_count(struct intel_digital_port  
> *dig_port);
Imre Deak July 4, 2019, 5:43 p.m. UTC | #3
On Thu, Jul 04, 2019 at 07:21:38PM +0200, Michal Wajdeczko wrote:
> On Thu, 04 Jul 2019 02:06:47 +0200, Lucas De Marchi
> <lucas.demarchi@intel.com> wrote:
> 
> > Make intel_tc.h the first include so we guarantee it's self-contained.
> > Sort the rest. Same principle applies for includes in the header.
> > 
> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
> >  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
> >  2 files changed, 6 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> > b/drivers/gpu/drm/i915/display/intel_tc.c
> > index 1a9dd32fb0a5..e6e6163c1232 100644
> > --- a/drivers/gpu/drm/i915/display/intel_tc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> > @@ -3,10 +3,11 @@
> >   * Copyright © 2019 Intel Corporation
> >   */
> > +#include "intel_tc.h"
> > +
> > +#include "i915_drv.h"
> 
> this master header will likely include everything, so while
> your .h is now self-contained, .c remains unclean
> 
> >  #include "intel_display.h"
> >  #include "intel_dp_mst.h"
> > -#include "i915_drv.h"
> > -#include "intel_tc.h"
> > static const char *tc_port_mode_name(enum tc_port_mode mode)
> >  {
> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.h
> > b/drivers/gpu/drm/i915/display/intel_tc.h
> > index 0d8411d4a91d..45ae30537b78 100644
> > --- a/drivers/gpu/drm/i915/display/intel_tc.h
> > +++ b/drivers/gpu/drm/i915/display/intel_tc.h
> > @@ -6,10 +6,11 @@
> >  #ifndef __INTEL_TC_H__
> >  #define __INTEL_TC_H__
> > -#include <linux/types.h>
> > -#include <linux/mutex.h>
> >  #include "intel_drv.h"
> 
> are you sure you want this giant header to be included here?
> note that it will #include almost everything (i915_drv.h too)
> and may introduce hard to resolve circular dependencies
> 
> > +#include <linux/mutex.h>
> 
> we don't need mutex definitions here in current header file
> 
> > +#include <linux/types.h>
> > +
> 
> so you need only above types.h and then add forward decl for:
> 
> struct intel_digital_port;

Both the mutex and intel_digital_port definitions are needed by 
intel_tc_port_ref_held() in this header.

> 
> >  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
> >  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
> >  int intel_tc_port_fia_max_lane_count(struct intel_digital_port
> > *dig_port);
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Michal Wajdeczko July 4, 2019, 5:56 p.m. UTC | #4
On Thu, 04 Jul 2019 19:43:12 +0200, Imre Deak <imre.deak@intel.com> wrote:

> On Thu, Jul 04, 2019 at 07:21:38PM +0200, Michal Wajdeczko wrote:
>> On Thu, 04 Jul 2019 02:06:47 +0200, Lucas De Marchi
>> <lucas.demarchi@intel.com> wrote:
>>
>> > Make intel_tc.h the first include so we guarantee it's self-contained.
>> > Sort the rest. Same principle applies for includes in the header.
>> >
>> > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
>> >  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
>> >  2 files changed, 6 insertions(+), 4 deletions(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
>> > b/drivers/gpu/drm/i915/display/intel_tc.c
>> > index 1a9dd32fb0a5..e6e6163c1232 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_tc.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
>> > @@ -3,10 +3,11 @@
>> >   * Copyright © 2019 Intel Corporation
>> >   */
>> > +#include "intel_tc.h"
>> > +
>> > +#include "i915_drv.h"
>>
>> this master header will likely include everything, so while
>> your .h is now self-contained, .c remains unclean
>>
>> >  #include "intel_display.h"
>> >  #include "intel_dp_mst.h"
>> > -#include "i915_drv.h"
>> > -#include "intel_tc.h"
>> > static const char *tc_port_mode_name(enum tc_port_mode mode)
>> >  {
>> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.h
>> > b/drivers/gpu/drm/i915/display/intel_tc.h
>> > index 0d8411d4a91d..45ae30537b78 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_tc.h
>> > +++ b/drivers/gpu/drm/i915/display/intel_tc.h
>> > @@ -6,10 +6,11 @@
>> >  #ifndef __INTEL_TC_H__
>> >  #define __INTEL_TC_H__
>> > -#include <linux/types.h>
>> > -#include <linux/mutex.h>
>> >  #include "intel_drv.h"
>>
>> are you sure you want this giant header to be included here?
>> note that it will #include almost everything (i915_drv.h too)
>> and may introduce hard to resolve circular dependencies
>>
>> > +#include <linux/mutex.h>
>>
>> we don't need mutex definitions here in current header file
>>
>> > +#include <linux/types.h>
>> > +
>>
>> so you need only above types.h and then add forward decl for:
>>
>> struct intel_digital_port;
>
> Both the mutex and intel_digital_port definitions are needed by
> intel_tc_port_ref_held() in this header.

oops, sorry, didn't scroll down to see intel_tc_port_ref_held() inline.

but wait, it is used only once in intel_display_power.c so
maybe this inline can be moved to one of the .c file ?

also, maybe it's time to move struct intel_digital_port definition
out of intel_drv.h ?

>
>>
>> >  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
>> >  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
>> >  int intel_tc_port_fia_max_lane_count(struct intel_digital_port
>> > *dig_port);
>> _______________________________________________
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Imre Deak July 4, 2019, 6:53 p.m. UTC | #5
On Thu, Jul 04, 2019 at 07:56:09PM +0200, Michal Wajdeczko wrote:
> On Thu, 04 Jul 2019 19:43:12 +0200, Imre Deak <imre.deak@intel.com> wrote:
> 
> > On Thu, Jul 04, 2019 at 07:21:38PM +0200, Michal Wajdeczko wrote:
> > > On Thu, 04 Jul 2019 02:06:47 +0200, Lucas De Marchi
> > > <lucas.demarchi@intel.com> wrote:
> > > 
> > > > Make intel_tc.h the first include so we guarantee it's self-contained.
> > > > Sort the rest. Same principle applies for includes in the header.
> > > >
> > > > Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
> > > >  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
> > > >  2 files changed, 6 insertions(+), 4 deletions(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> > > > b/drivers/gpu/drm/i915/display/intel_tc.c
> > > > index 1a9dd32fb0a5..e6e6163c1232 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_tc.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> > > > @@ -3,10 +3,11 @@
> > > >   * Copyright © 2019 Intel Corporation
> > > >   */
> > > > +#include "intel_tc.h"
> > > > +
> > > > +#include "i915_drv.h"
> > > 
> > > this master header will likely include everything, so while
> > > your .h is now self-contained, .c remains unclean
> > > 
> > > >  #include "intel_display.h"
> > > >  #include "intel_dp_mst.h"
> > > > -#include "i915_drv.h"
> > > > -#include "intel_tc.h"
> > > > static const char *tc_port_mode_name(enum tc_port_mode mode)
> > > >  {
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_tc.h
> > > > b/drivers/gpu/drm/i915/display/intel_tc.h
> > > > index 0d8411d4a91d..45ae30537b78 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_tc.h
> > > > +++ b/drivers/gpu/drm/i915/display/intel_tc.h
> > > > @@ -6,10 +6,11 @@
> > > >  #ifndef __INTEL_TC_H__
> > > >  #define __INTEL_TC_H__
> > > > -#include <linux/types.h>
> > > > -#include <linux/mutex.h>
> > > >  #include "intel_drv.h"
> > > 
> > > are you sure you want this giant header to be included here?
> > > note that it will #include almost everything (i915_drv.h too)
> > > and may introduce hard to resolve circular dependencies
> > > 
> > > > +#include <linux/mutex.h>
> > > 
> > > we don't need mutex definitions here in current header file
> > > 
> > > > +#include <linux/types.h>
> > > > +
> > > 
> > > so you need only above types.h and then add forward decl for:
> > > 
> > > struct intel_digital_port;
> > 
> > Both the mutex and intel_digital_port definitions are needed by
> > intel_tc_port_ref_held() in this header.
> 
> oops, sorry, didn't scroll down to see intel_tc_port_ref_held() inline.
> 
> but wait, it is used only once in intel_display_power.c so
> maybe this inline can be moved to one of the .c file ?

Imo a simple function is ok as inline and it should be defined with the
rest of TypeC functions.

> also, maybe it's time to move struct intel_digital_port definition
> out of intel_drv.h ?

Not sure what would be a good division, it's used by a few
platforms/output types. But yea, sounds like a good idea as a follow-up.

>
> > > 
> > > >  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
> > > >  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
> > > >  int intel_tc_port_fia_max_lane_count(struct intel_digital_port
> > > > *dig_port);
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Lucas De Marchi July 8, 2019, 3:13 p.m. UTC | #6
On Thu, Jul 04, 2019 at 04:56:41PM +0300, Imre Deak wrote:
>On Wed, Jul 03, 2019 at 05:06:47PM -0700, Lucas De Marchi wrote:
>> Make intel_tc.h the first include so we guarantee it's self-contained.
>> Sort the rest. Same principle applies for includes in the header.
>>
>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
>>  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
>>  2 files changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
>> index 1a9dd32fb0a5..e6e6163c1232 100644
>> --- a/drivers/gpu/drm/i915/display/intel_tc.c
>> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
>> @@ -3,10 +3,11 @@
>>   * Copyright © 2019 Intel Corporation
>>   */
>>
>> +#include "intel_tc.h"
>
>I get your point to keep the self-contained check work even without the
>header test files, but I'm not sure if we need that, since there is the
>header test file approach in place. I haven't seen this done anywhere
>else, so we shouldn't make an exception here either imo.
>
>+Jani for that.
>
>Fixing the rest of my ABC screw-up looks ok.

I can change this and leave it for later to maintain
consistency across the codebase.

Lucas De Marchi

>
>> +
>> +#include "i915_drv.h"
>>  #include "intel_display.h"
>>  #include "intel_dp_mst.h"
>> -#include "i915_drv.h"
>> -#include "intel_tc.h"
>>
>>  static const char *tc_port_mode_name(enum tc_port_mode mode)
>>  {
>> diff --git a/drivers/gpu/drm/i915/display/intel_tc.h b/drivers/gpu/drm/i915/display/intel_tc.h
>> index 0d8411d4a91d..45ae30537b78 100644
>> --- a/drivers/gpu/drm/i915/display/intel_tc.h
>> +++ b/drivers/gpu/drm/i915/display/intel_tc.h
>> @@ -6,10 +6,11 @@
>>  #ifndef __INTEL_TC_H__
>>  #define __INTEL_TC_H__
>>
>> -#include <linux/types.h>
>> -#include <linux/mutex.h>
>>  #include "intel_drv.h"
>>
>> +#include <linux/mutex.h>
>> +#include <linux/types.h>
>> +
>>  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
>>  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
>>  int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port);
>> --
>> 2.21.0
>>
Lucas De Marchi July 8, 2019, 3:16 p.m. UTC | #7
On Thu, Jul 04, 2019 at 07:21:38PM +0200, Michal Wajdeczko wrote:
>On Thu, 04 Jul 2019 02:06:47 +0200, Lucas De Marchi 
><lucas.demarchi@intel.com> wrote:
>
>>Make intel_tc.h the first include so we guarantee it's self-contained.
>>Sort the rest. Same principle applies for includes in the header.
>>
>>Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>>---
>> drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
>> drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
>> 2 files changed, 6 insertions(+), 4 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/i915/display/intel_tc.c 
>>b/drivers/gpu/drm/i915/display/intel_tc.c
>>index 1a9dd32fb0a5..e6e6163c1232 100644
>>--- a/drivers/gpu/drm/i915/display/intel_tc.c
>>+++ b/drivers/gpu/drm/i915/display/intel_tc.c
>>@@ -3,10 +3,11 @@
>>  * Copyright © 2019 Intel Corporation
>>  */
>>+#include "intel_tc.h"
>>+
>>+#include "i915_drv.h"
>
>this master header will likely include everything, so while
>your .h is now self-contained, .c remains unclean

there are 2 different concepts on header organization:
1) being self-contained and 2) include-what-you-use

(2) is not done by this patch... i915_drv.h was already there,
just in the wrong position.

Lucas De Marchi

>
>> #include "intel_display.h"
>> #include "intel_dp_mst.h"
>>-#include "i915_drv.h"
>>-#include "intel_tc.h"
>>static const char *tc_port_mode_name(enum tc_port_mode mode)
>> {
>>diff --git a/drivers/gpu/drm/i915/display/intel_tc.h 
>>b/drivers/gpu/drm/i915/display/intel_tc.h
>>index 0d8411d4a91d..45ae30537b78 100644
>>--- a/drivers/gpu/drm/i915/display/intel_tc.h
>>+++ b/drivers/gpu/drm/i915/display/intel_tc.h
>>@@ -6,10 +6,11 @@
>> #ifndef __INTEL_TC_H__
>> #define __INTEL_TC_H__
>>-#include <linux/types.h>
>>-#include <linux/mutex.h>
>> #include "intel_drv.h"
>
>are you sure you want this giant header to be included here?
>note that it will #include almost everything (i915_drv.h too)
>and may introduce hard to resolve circular dependencies
>
>>+#include <linux/mutex.h>
>
>we don't need mutex definitions here in current header file
>
>>+#include <linux/types.h>
>>+
>
>so you need only above types.h and then add forward decl for:
>
>struct intel_digital_port;
>
>> bool intel_tc_port_connected(struct intel_digital_port *dig_port);
>> u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
>> int intel_tc_port_fia_max_lane_count(struct intel_digital_port 
>>*dig_port);
Jani Nikula Aug. 5, 2019, 9:16 a.m. UTC | #8
On Mon, 08 Jul 2019, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Thu, Jul 04, 2019 at 04:56:41PM +0300, Imre Deak wrote:
>>On Wed, Jul 03, 2019 at 05:06:47PM -0700, Lucas De Marchi wrote:
>>> Make intel_tc.h the first include so we guarantee it's self-contained.
>>> Sort the rest. Same principle applies for includes in the header.
>>>
>>> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
>>> ---
>>>  drivers/gpu/drm/i915/display/intel_tc.c | 5 +++--
>>>  drivers/gpu/drm/i915/display/intel_tc.h | 5 +++--
>>>  2 files changed, 6 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
>>> index 1a9dd32fb0a5..e6e6163c1232 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_tc.c
>>> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
>>> @@ -3,10 +3,11 @@
>>>   * Copyright © 2019 Intel Corporation
>>>   */
>>>
>>> +#include "intel_tc.h"
>>
>>I get your point to keep the self-contained check work even without the
>>header test files, but I'm not sure if we need that, since there is the
>>header test file approach in place. I haven't seen this done anywhere
>>else, so we shouldn't make an exception here either imo.
>>
>>+Jani for that.
>>
>>Fixing the rest of my ABC screw-up looks ok.
>
> I can change this and leave it for later to maintain
> consistency across the codebase.

This is what we've ended up with, each block sorted:

#include <linux/...>

#include <drm/...>

#include "..."


BR,
Jani.


>
> Lucas De Marchi
>
>>
>>> +
>>> +#include "i915_drv.h"
>>>  #include "intel_display.h"
>>>  #include "intel_dp_mst.h"
>>> -#include "i915_drv.h"
>>> -#include "intel_tc.h"
>>>
>>>  static const char *tc_port_mode_name(enum tc_port_mode mode)
>>>  {
>>> diff --git a/drivers/gpu/drm/i915/display/intel_tc.h b/drivers/gpu/drm/i915/display/intel_tc.h
>>> index 0d8411d4a91d..45ae30537b78 100644
>>> --- a/drivers/gpu/drm/i915/display/intel_tc.h
>>> +++ b/drivers/gpu/drm/i915/display/intel_tc.h
>>> @@ -6,10 +6,11 @@
>>>  #ifndef __INTEL_TC_H__
>>>  #define __INTEL_TC_H__
>>>
>>> -#include <linux/types.h>
>>> -#include <linux/mutex.h>
>>>  #include "intel_drv.h"
>>>
>>> +#include <linux/mutex.h>
>>> +#include <linux/types.h>
>>> +
>>>  bool intel_tc_port_connected(struct intel_digital_port *dig_port);
>>>  u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
>>>  int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port);
>>> --
>>> 2.21.0
>>>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
index 1a9dd32fb0a5..e6e6163c1232 100644
--- a/drivers/gpu/drm/i915/display/intel_tc.c
+++ b/drivers/gpu/drm/i915/display/intel_tc.c
@@ -3,10 +3,11 @@ 
  * Copyright © 2019 Intel Corporation
  */
 
+#include "intel_tc.h"
+
+#include "i915_drv.h"
 #include "intel_display.h"
 #include "intel_dp_mst.h"
-#include "i915_drv.h"
-#include "intel_tc.h"
 
 static const char *tc_port_mode_name(enum tc_port_mode mode)
 {
diff --git a/drivers/gpu/drm/i915/display/intel_tc.h b/drivers/gpu/drm/i915/display/intel_tc.h
index 0d8411d4a91d..45ae30537b78 100644
--- a/drivers/gpu/drm/i915/display/intel_tc.h
+++ b/drivers/gpu/drm/i915/display/intel_tc.h
@@ -6,10 +6,11 @@ 
 #ifndef __INTEL_TC_H__
 #define __INTEL_TC_H__
 
-#include <linux/types.h>
-#include <linux/mutex.h>
 #include "intel_drv.h"
 
+#include <linux/mutex.h>
+#include <linux/types.h>
+
 bool intel_tc_port_connected(struct intel_digital_port *dig_port);
 u32 intel_tc_port_get_lane_mask(struct intel_digital_port *dig_port);
 int intel_tc_port_fia_max_lane_count(struct intel_digital_port *dig_port);