dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Jernej Skrabec <jernej.skrabec@siol.net>,
	Arnd Bergmann <arnd@arndb.de>,
	Naresh Kamboju <naresh.kamboju@linaro.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	Jon Hunter <jonathanh@nvidia.com>, Chen-Yu Tsai <wens@csie.org>
Subject: Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
Date: Thu, 13 Sep 2018 10:02:13 +0200	[thread overview]
Message-ID: <20180913080213.flot5eohd4k6edjm@flea> (raw)
In-Reply-To: <CAKMK7uFstSqjQnyF=9cTKtf9SKBiWSe+U+6Uk3yjJE7hcXhZjw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4338 bytes --]

On Wed, Sep 12, 2018 at 05:53:39PM +0200, Daniel Vetter wrote:
> On Wed, Sep 12, 2018 at 5:47 PM, Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> > On Wed, Sep 12, 2018 at 04:25:36PM +0200, Daniel Vetter wrote:
> >> On Wed, Sep 12, 2018 at 11:53 AM, Maxime Ripard
> >> <maxime.ripard@bootlin.com> wrote:
> >> > On Tue, Sep 11, 2018 at 10:17:02PM +0200, Daniel Vetter wrote:
> >> >> On Tue, Sep 11, 2018 at 01:33:25PM +0200, Maxime Ripard wrote:
> >> >> > Having DRM_SUN4I built-in but DRM_SUN8I_MIXER as a loadable module results in
> >> >> > a link error, as we try to access a symbol from the sun8i_tcon_top.ko module:
> >> >> >
> >> >> > ERROR: "sun8i_tcon_top_de_config" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
> >> >> > ERROR: "sun8i_tcon_top_set_hdmi_src" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
> >> >> > ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-tcon.ko] undefined!
> >> >> >
> >> >> > This solves the problem by adding a silent symbol for the tcon_top module,
> >> >> > building it as a separate module in exactly the cases that we need it,
> >> >> > but in a way that it is reachable by the other modules.
> >> >> >
> >> >> > Fixes: cf77d79b4e29 ("drm/sun4i: tcon: Add another way for matching mixers with tcon")
> >> >> > Fixes: 0305189afb32 ("drm/sun4i: tcon: Add support for R40 TCON")
> >> >> > Tested-by: Jon Hunter <jonathanh@nvidia.com>
> >> >> > Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
> >> >>
> >> >> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> >>
> >> >> But I can't help myself and drop the usual questions when I see a small
> >> >> soc driver with more Kconfigs than anything else ... is all this pain
> >> >> worth it? I know that maybe the desktop approach of stuffing half a
> >> >> million lines of driver code into one .ko might be a bit too much for
> >> >> socs, but this seems overkill.
> >> >>
> >> >> I'm also pretty sure it's not justified by any real data, compared to
> >> >> overall code size of a drm stack, that shows it's a substantial enough
> >> >> saving that it's worth it.
> >> >
> >> > I'm currently running on a project where the boot time to a qt
> >> > application from power off should be less than a second. You want to
> >> > remove anything you can spare in some situations. And yeah, DRM is the
> >> > biggest thing in the way to do that.
> >>
> >> Oh I know all about the 1s people. But is binary size really that
> >> important figure? I know it's a bit more to load&decompress, but it
> >> shouldn't have any impact on anything running at runtime.
> >
> > It really depends on the combination of the CPU speed, the storage
> > speed, and the compression algorithm. To give you a figure, a quite
> > good storage device in our case has a bandwith of 10MB/s. If you add a
> > MB, you lose a tenth of your budget, decompression excluded.
> >
> > The sole edid_cea_modes, drm_dmt_modes and edid_est_modes, combined,
> > already take around 50kB. That's around .5% of our time budget just
> > dedicated to loading structures we will never need, without the option
> > to compile them out.
> 
> Yup, if you want to make drm_edid.c optional, you need LTO. Because I
> think we've already gone way overboard with making stuff optional in
> the drm core, there's lots of silly little Kconfigs with imo
> questionable value. Also, 50kb ... what does that look like
> compressed? Should compress exceedingly well.
> 
> But that's not what I asked about really, I asked about all the
> Kconfigs in su4i. Are those worth it? Especially compared to fixing
> this for real, using something like LTO (plus making a few things
> hard-coded, per machine configuration, so that gcc can figure it all
> out).

You're asking whether a 5 minutes effort is worth it compared to a 5
weeks one (at best) to port the LTO patches, making it sure it works
ok on ARM, and then debugging whether some entry point has been
removed or not.

Plus, given that it's a driver that could or couldn't be loaded
depending on the device tree, you would have to keep that driver in
even with LTO, even though you know you have zero chance to execute
that code at runtime.

Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-09-13  8:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 11:33 [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m Maxime Ripard
2018-09-11 20:17 ` Daniel Vetter
2018-09-12  9:53   ` Maxime Ripard
2018-09-12 14:25     ` Daniel Vetter
2018-09-12 15:47       ` Maxime Ripard
2018-09-12 15:53         ` Daniel Vetter
2018-09-13  8:02           ` Maxime Ripard [this message]
2018-09-13  8:19             ` Arnd Bergmann
2018-09-12 14:02   ` Maxime Ripard
  -- strict thread matches above, loose matches on Subject: below --
2018-07-06 12:45 Arnd Bergmann
2018-07-09  8:07 ` Maxime Ripard
2018-07-09  8:58   ` Jernej Škrabec
2018-07-09  8:58   ` Chen-Yu Tsai
2018-07-09  9:15     ` Maxime Ripard
2018-07-09  9:17       ` Chen-Yu Tsai

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=20180913080213.flot5eohd4k6edjm@flea \
    --to=maxime.ripard@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@siol.net \
    --cc=jonathanh@nvidia.com \
    --cc=naresh.kamboju@linaro.org \
    --cc=wens@csie.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