All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: Re: [PATCH 00/25] drm/i915: the great header refactoring, part one
Date: Fri, 05 Apr 2019 10:50:31 +0300	[thread overview]
Message-ID: <155445063144.5448.7682624923536730022@jlahtine-desk.ger.corp.intel.com> (raw)
In-Reply-To: <155441353301.8259.2343723509284551491@skylake-alporthouse-com>

Quoting Chris Wilson (2019-04-05 00:32:13)
> Quoting Jani Nikula (2019-04-04 22:14:24)
> > intel_drv.h has grown out of proportions, and turned into a dumping
> > ground. Way back when it was useful to have only a handful of headers,
> > but we're long past that.
> > 
> > Start splitting off per-module headers. The basic principles:
> > 
> > * Make the new headers self-contained (i.e. can be compiled without
> >   including other headers first), and test this using the new infra for
> >   that.
> > 
> > * Use minimal includes for making the headers self-contained. Use
> >   forward declarations for structs where applicable, and e.g. include
> >   <linux/types.h> instead of <linux/kernel.h>.
> > 
> > * Only split off the headers, and mostly refrain from doing other
> >   refactoring while at it. (There are a few minor things.)
> > 
> > * Mostly only split off function declarations. Splitting off types is
> >   left for follow-up work.
> > 
> > * Include the new headers only where needed. This leads to a lot of
> >   includes here and there, but on the other hand increases the clarity
> >   of the relationships between the modules. (And already raises a bunch
> >   of questions about the split and cross-calls between some
> >   modules. It'll be easier to analyze this.)
> > 
> > * Wherever adding new includes, group the includes by <linux/...> first,
> >   then <drm/...>, then "...", and sort the groups alphabetically.
> > 
> > * Choice of what to extract first here is purely arbitrary.
> > 
> > * Follow-up work should consider renaming functions according to the
> >   module, i.e. functions in intel_foo.c should be prefixed
> >   intel_foo_. Better naming will be helpful in further organizing the
> >   driver, as well as grasping the structure to begin with.
> 
> I wholeheartedly agree. Recent experience shows that with a small number
> of very large headers, getting the types defined at the right point is
> much harder than with small scoped headers. (And don't get me started on
> trying to avoid circular definitions for inlines.)
> 
> The counterpoint is that it can be harder to find the right header. But
> it's no harder than trying to find the right c-file, and if we keep to
> the rule that object-name.c is accompanied by object-name.h, once you
> know object name, it is easy to find.

I'm also very much in favor of this split.

Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas

> > Jani Nikula (25):
> >   drm/i915: make intel_frontbuffer.h self-contained
> >   drm/i915: extract intel_audio.h from intel_drv.h
> >   drm/i915: extract intel_crt.h from intel_drv.h
> >   drm/i915: extract intel_ddi.h from intel_drv.h
> >   drm/i915: extract intel_connector.h from intel_drv.h
> >   drm/i915: extract intel_csr.h from intel_drv.h
> >   drm/i915: extract intel_fbc.h from intel_drv.h
> >   drm/i915: extract intel_psr.h from intel_drv.h
> >   drm/i915: extract intel_color.h from intel_drv.h
> >   drm/i915: extract intel_lspcon.h from intel_drv.h
> >   drm/i915: extract intel_sdvo.h from intel_drv.h
> >   drm/i915: extract intel_hdcp.h from intel_drv.h
> >   drm/i915: extract intel_panel.h from intel_drv.h
> >   drm/i915: extract intel_pm.h from intel_drv.h
> >   drm/i915: extract intel_fbdev.h from intel_drv.h
> >   drm/i915: extract intel_dp.h from intel_drv.h
> >   drm/i915: extract intel_hdmi.h from intel_drv.h
> >   drm/i915: extract intel_atomic_plane.h from intel_drv.h
> >   drm/i915: extract intel_pipe_crc.h from intel_drv.h
> >   drm/i915: extract intel_tv.h from intel_drv.h
> >   drm/i915: extract intel_lvds.h from intel_drv.h
> >   drm/i915: extract intel_dvo.h from intel_drv.h
> >   drm/i915: extract intel_sprite.h from intel_drv.h
> >   drm/i915: extract intel_cdclk.h from intel_drv.h
> >   drm/i915/cdclk: have only one init/uninit function
> 
> Read through the patches, and they are just code motion.
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> 
> The real work is done by the compiler.
> -Chris
> _______________________________________________
> 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-04-05  7:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 21:14 [PATCH 00/25] drm/i915: the great header refactoring, part one Jani Nikula
2019-04-04 21:14 ` [PATCH 01/25] drm/i915: make intel_frontbuffer.h self-contained Jani Nikula
2019-04-04 21:14 ` [PATCH 02/25] drm/i915: extract intel_audio.h from intel_drv.h Jani Nikula
2019-04-04 21:14 ` [PATCH 03/25] drm/i915: extract intel_crt.h " Jani Nikula
2019-04-04 21:22   ` Jani Nikula
2019-04-04 21:14 ` [PATCH 04/25] drm/i915: extract intel_ddi.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 05/25] drm/i915: extract intel_connector.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 06/25] drm/i915: extract intel_csr.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 07/25] drm/i915: extract intel_fbc.h " Jani Nikula
2019-04-04 21:22   ` Chris Wilson
2019-04-04 21:14 ` [PATCH 08/25] drm/i915: extract intel_psr.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 09/25] drm/i915: extract intel_color.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 10/25] drm/i915: extract intel_lspcon.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 11/25] drm/i915: extract intel_sdvo.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 12/25] drm/i915: extract intel_hdcp.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 13/25] drm/i915: extract intel_panel.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 14/25] drm/i915: extract intel_pm.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 15/25] drm/i915: extract intel_fbdev.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 16/25] drm/i915: extract intel_dp.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 17/25] drm/i915: extract intel_hdmi.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 18/25] drm/i915: extract intel_atomic_plane.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 19/25] drm/i915: extract intel_pipe_crc.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 20/25] drm/i915: extract intel_tv.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 21/25] drm/i915: extract intel_lvds.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 22/25] drm/i915: extract intel_dvo.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 23/25] drm/i915: extract intel_sprite.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 24/25] drm/i915: extract intel_cdclk.h " Jani Nikula
2019-04-04 21:14 ` [PATCH 25/25] drm/i915/cdclk: have only one init/uninit function Jani Nikula
2019-04-04 21:32 ` [PATCH 00/25] drm/i915: the great header refactoring, part one Chris Wilson
2019-04-05  7:50   ` Joonas Lahtinen [this message]
2019-04-04 21:48 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-04-04 22:01 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-04-04 22:07 ` ✓ Fi.CI.BAT: success " Patchwork

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=155445063144.5448.7682624923536730022@jlahtine-desk.ger.corp.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.