public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH 2/4] drm/i915: fix include order in intel_tc.*
Date: Thu, 4 Jul 2019 21:53:48 +0300	[thread overview]
Message-ID: <20190704185348.GA11592@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <op.z4ez3vbpxaggs7@mwajdecz-mobl1.ger.corp.intel.com>

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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-07-04 18:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  0:06 [PATCH 0/4] Modular FIA Lucas De Marchi
2019-07-04  0:06 ` [PATCH 1/4] drm/i915: make new intel_tc.c use uncore accessors Lucas De Marchi
2019-07-04  0:06 ` [PATCH 2/4] drm/i915: fix include order in intel_tc.* Lucas De Marchi
2019-07-04 13:56   ` Imre Deak
2019-07-08 15:13     ` Lucas De Marchi
2019-08-05  9:16       ` Jani Nikula
2019-07-04 17:21   ` Michal Wajdeczko
2019-07-04 17:43     ` Imre Deak
2019-07-04 17:56       ` Michal Wajdeczko
2019-07-04 18:53         ` Imre Deak [this message]
2019-07-08 15:16     ` Lucas De Marchi
2019-07-04  0:06 ` [PATCH 3/4] drm/i915: move intel_ddi_set_fia_lane_count to intel_tc.c Lucas De Marchi
2019-07-04 14:03   ` Imre Deak
2019-07-04  0:06 ` [PATCH 4/4] drm/i915: Add modular FIA Lucas De Marchi
2019-07-04  1:04 ` ✗ Fi.CI.SPARSE: warning for Modular FIA Patchwork
2019-07-04  1:39 ` ✓ Fi.CI.BAT: success " Patchwork
2019-07-05  4:55 ` ✓ Fi.CI.IGT: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-07-03 23:59 [PATCH 1/4] drm/i915: make new intel_tc.c use uncore accessors Lucas De Marchi
2019-07-03 23:59 ` [PATCH 2/4] drm/i915: fix include order in intel_tc.* Lucas De Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190704185348.GA11592@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=michal.wajdeczko@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox