From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Ben Widawsky <ben@bwidawsk.net>,
intel-gfx@lists.freedesktop.org,
Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: Re: [PATCH 0/4] Reduce intel_display.c
Date: Wed, 16 Apr 2014 19:37:16 +0300 [thread overview]
Message-ID: <20140416163716.GM18465@intel.com> (raw)
In-Reply-To: <20140415192544.GE1023@phenom.ffwll.local>
On Tue, Apr 15, 2014 at 09:25:44PM +0200, Daniel Vetter wrote:
> On Fri, Apr 11, 2014 at 10:21:59AM +0300, Jani Nikula wrote:
> > On Fri, 11 Apr 2014, Ben Widawsky <ben@bwidawsk.net> wrote:
> > > On Wed, Apr 09, 2014 at 06:44:29PM -0300, Paulo Zanoni wrote:
> > >> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
> > >>
> > >> Hi
> > >>
> > >> We always talk about how intel_display.c is a giant file and how we would like
> > >> to reduce it, so this is my attempt. Currently the file has 12090 lines, and
> > >> after my patch series it has 8850 lines.
> > >>
> > >> I don't know if right now is the appropriate time to merge patches like this. I
> > >> don't remember seeing too many patches on the list touching cursor/fdi/eld/pll
> > >> functions, but I know there is never an appropriate time for huge changes.
> > >>
> > >> Also, this change will obviously make the lives of people who backport our
> > >> patches more complicated. So if we don't want this series at all, feel free to
> > >> NACK it.
> > >
> > > I am only responding because it seems nobody else really said much. I
> > > never touch this code, and I shouldn't be the authority. I really
> > > quickly glanced at the patches.
> > >
> > > 1. +LOC: It sucks that you ended up adding 220 lines. I assume half of it is the
> > > copyright header, but still, considering there are no actual refactors,
> > > cleanups, or functional changes - adding lines makes me unhappy.
> > >
> > > 2. necessary? I personally haven't heard from anyone that we need to shrink
> > > intel_display.c (again, I am the furthest from being an expert). I doubt
> > > anyone isn't using some form of tags, or grep to navigate anyway. My
> > > problem has never been the file size itself, but just the structure of
> > > the display code interacting with the core KMS was hard to follow.
> > >
> > > 3. conflicts: Like you said, it's likely nobody touches this code, but we should
> > > keep in mind we do have several people working on older branches, and
> > > this kind of thing makes any sort of backport hard.
> > >
> > > On the other hand:
> > > 1. If more than one person finds the results more readable/consumable, I
> > > think it's worth it, and probably mostly justifies doing it. You've also
> > > shrunk the file by quite a bit, so it's somewhat useful churn.
> > >
> > > 2. intel_pll.c sounds like a good idea
> >
> > I'm in favour of reducing the size of intel_display.c. I did not look at
> > the patches though, because I've sent a few patches to this effect in
> > the past (limits/pll and quirks at least), but they were stalled because
> > they were in the collision course with the Grand Plans Daniel has. So
> > Daniel, I expect you to chime in on this one too. ;)
>
> Chiming in now ;-)
>
> I've seen a few "extract stuff" patches float by and occasionally also
> merged some, but thus far I' haven't been terribly convinced. I don't mind
> the conflicts these patches cause, but if we want to reorg the driver the
> goal shouldn't be to just make files smaller (cscope can cope) but
> actually improve the organization of all this.
>
> Often these patches just grab a bag of functions with related names, throw
> them all into a new file and then add forward and header declaration until
> the damn thing compiles again. What we want instead are real code modules
> where interactions within one file are high and the number of exported
> functions fairly low.
>
> Two examples:
> - Extracting the pageflip helpers and related code would mean that we also
> should extract a new pageflip_init functions, so that all the platform
> functions don't need to be exported. We've done similar things when
> creating intel_unocore.c.
>
> - I've just stumbled around in the haswell code and noticed that pretty
> much all the lpt and hsw fdi code could be moved into intel_crt.c with a
> new hsw specific crt encoder. In the pre_enable and post_disable hooks
> we could then do the ddi setup, fdi link training. And all the ltp
> handling code could mostly be moved away too. With this we could also
> remove a lot (if not all) of the has_pch_encoder checks and I think also
> many type == INTEL_OUTPUT_ANALOG checks in the haswell code.
>
> I haven't actually checked whether it'll all nicely work out, but my gut
> feeling says it'll be fewer forward declarations than just shoveling all
> the fdi related functions (including the lpt stuff) into a new
> intel_fdi.c.
I'm not sure I'd like the code for one pch platform to have a totally
different structure than the other platforms. I guess I can't really say
w/o seeing the result. And this is hsw after all where the code likes be
different just because, which usually makes it the last platform I think
about. And my last hsw related patches got stuck in limbo anyway, so I
now prefer to keep my distance.
--
Ville Syrjälä
Intel OTC
next prev parent reply other threads:[~2014-04-16 16:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-09 21:44 [PATCH 0/4] Reduce intel_display.c Paulo Zanoni
2014-04-09 21:44 ` [PATCH 1/4] drm/i915: extract intel_eld.c from intel_display.c Paulo Zanoni
2014-04-09 21:44 ` [PATCH 2/4] drm/i915: extract intel_cursor.c " Paulo Zanoni
2014-04-09 21:44 ` [PATCH 3/4] drm/i915: extract intel_fdi.c " Paulo Zanoni
2014-04-09 21:44 ` [PATCH 4/4] drm/i915: extract intel_pll.c " Paulo Zanoni
2014-04-09 21:49 ` [PATCH 0/4] Reduce intel_display.c Eric Anholt
2014-04-11 6:59 ` Ben Widawsky
2014-04-11 7:21 ` Jani Nikula
2014-04-15 19:25 ` Daniel Vetter
2014-04-16 16:37 ` Ville Syrjälä [this message]
2014-04-16 16:47 ` Daniel Vetter
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=20140416163716.GM18465@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ben@bwidawsk.net \
--cc=daniel@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@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