From: Daniel Vetter <daniel@ffwll.ch>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Make the device_info structure __initconst
Date: Fri, 11 Jul 2014 08:33:42 +0200 [thread overview]
Message-ID: <20140711063342.GQ17271@phenom.ffwll.local> (raw)
In-Reply-To: <20140710214721.GN3191@strange.ger.corp.intel.com>
On Thu, Jul 10, 2014 at 10:47:21PM +0100, Damien Lespiau wrote:
> On Thu, Jul 10, 2014 at 10:25:27PM +0200, Daniel Vetter wrote:
> > On Thu, Jul 10, 2014 at 02:52:42PM +0100, Damien Lespiau wrote:
> > > We don't need them past the module initialization as the correct
> > > structure is copied into dev_priv in ->load(), called from
> > > drm_pci_init(), called from the module init funtion.
> > >
> > > I'm always hesitant about adding new members to struct intel_device_info
> > > because it will add 30+ * sizeof(member) bytes to the driver. However,
> > > if we can discard those table after init(), it changes everything.
> > >
> > > After this change, the driver has a new .init.rodata section contains
> > > the structures in question and .rodata has now 2848 fewer bytes.
> > >
> > > lsmod shows -5425 bytes in its size field between before and after this
> > > change. Not too sure why this (Vs the 2848 bytes lost in .rodata), but
> > > that's enough for me.
> > >
> > > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> >
> > You want devinintconst which is being phased out afaik ... Currently the
> > driver gets probed synchronously but you kinda never know what the device
> > core people are up to:
> > - init = removed after the module is loaded.
> > - devinit = removed after the driver is initilialized, and never for
> > CONFIG_HOTPLUG=y.
> >
> > If we want to trim down the size of our driver, especially on specific
> > platforms we imo should have a) link time optimization b) some
> > heavy-handed macro to return a static device info c) a much more clever
> > gcc since last time I've tried this it failed to kick out large swats of
> > code like all the dvo crap. Despite that it was clearly unreachable :(
>
> Sigh, I followed the !DRIVER_MODESET code path, I am very sad now.
>
> I was thinking about having a Kconfig option to select a specific
> platform to compile the driver for and, by trying to make that work, we
> could end up with a nice per-platform split of the code. Would people be
> totally opposed to such a thing?
Not opposed if we're going to sign up the compiler for the resulting dce.
If it'll result in #ifdef hell then no.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
prev parent reply other threads:[~2014-07-11 6:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-10 13:52 [PATCH 1/2] drm/i915: Make the device_info structure __initconst Damien Lespiau
2014-07-10 13:52 ` [PATCH 2/2] drm/i915: Don't cast a pointer to void* unnecessarily Damien Lespiau
2014-07-10 19:26 ` Paulo Zanoni
2014-07-10 20:26 ` Daniel Vetter
2014-07-10 19:18 ` [PATCH 1/2] drm/i915: Make the device_info structure __initconst Paulo Zanoni
2014-07-10 20:25 ` Daniel Vetter
2014-07-10 21:47 ` Damien Lespiau
2014-07-11 6:33 ` Daniel Vetter [this message]
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=20140711063342.GQ17271@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=damien.lespiau@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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