Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Thu, Sep 13, 2018 at 10:02 AM Maxime Ripard wrote: > On Wed, Sep 12, 2018 at 05:53:39PM +0200, Daniel Vetter wrote: > > On Wed, Sep 12, 2018 at 5:47 PM, Maxime Ripard > > wrote: > > > On Wed, Sep 12, 2018 at 04:25:36PM +0200, Daniel Vetter wrote: > > 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. I have spent a few weeks on getting ARM kernels to build with LTO, based on earlier work from Nico and others. This requires a couple of patches for the common cases, but gets increasingly complex when you add in some other options (thumb2 kernel, XIP_KERNEL, MTD_XIP, OABI, ftrace, gcov, multi-cpu, ...) that each add their own conflicting requirements. I gave up in the end, before even trying to run any of those kernels. I think for x86-64 and arm64, we have a realistic chance of making it work in general, on arm32 the best case I can think of would be to support some of the common configurations. Arnd ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Wed, Sep 12, 2018 at 05:53:39PM +0200, Daniel Vetter wrote: > On Wed, Sep 12, 2018 at 5:47 PM, Maxime Ripard > 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 > >> 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 > >> >> > Signed-off-by: Maxime Ripard > >> >> > >> >> Reviewed-by: Daniel Vetter > >> >> > >> >> 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, 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 signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Wed, Sep 12, 2018 at 5:47 PM, Maxime Ripard 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 >> 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 >> >> > Signed-off-by: Maxime Ripard >> >> >> >> Reviewed-by: Daniel Vetter >> >> >> >> 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, 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). -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Wed, Sep 12, 2018 at 04:25:36PM +0200, Daniel Vetter wrote: > On Wed, Sep 12, 2018 at 11:53 AM, Maxime Ripard > 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 > >> > Signed-off-by: Maxime Ripard > >> > >> Reviewed-by: Daniel Vetter > >> > >> 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, 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. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Wed, Sep 12, 2018 at 11:53 AM, Maxime Ripard 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 >> > Signed-off-by: Maxime Ripard >> >> Reviewed-by: Daniel Vetter >> >> 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, but it shouldn't have any impact on anything running at runtime. >> Imo, if you really care about building a minimal driver, stuff everything >> into one .ko and then LTO out the uneeded bits. We've done these >> experiments for i915, that _actually_ saves a ton of binary size, with >> fairly minimal code and maintenance impact. Still, we decided the payoff >> is simply too small to bother making it a production thing. > > LTO isn't enabled yet in mainline, is it? Unfortunately not :-/ We've done the analysis and reported to the internal people who asked for this that "lto is what you want", but nothing thus far. I guess the price tag of making LTO work is a bit too much. Ofc doesn't just need LTO, but also needs some trickery to make sure all the optional paths are statically determined to never run. But (at least for us) that's just a few changes to the pci table, and hard-coding the device info structure. OF/DT would probably need some work, but should be doable too. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
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 > > Signed-off-by: Maxime Ripard > > Reviewed-by: Daniel Vetter It's pushed, thanks! Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
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 > > Signed-off-by: Maxime Ripard > > Reviewed-by: Daniel Vetter > > 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. > Imo, if you really care about building a minimal driver, stuff everything > into one .ko and then LTO out the uneeded bits. We've done these > experiments for i915, that _actually_ saves a ton of binary size, with > fairly minimal code and maintenance impact. Still, we decided the payoff > is simply too small to bother making it a production thing. LTO isn't enabled yet in mainline, is it? Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
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 > Signed-off-by: Maxime Ripard Reviewed-by: Daniel Vetter 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. Imo, if you really care about building a minimal driver, stuff everything into one .ko and then LTO out the uneeded bits. We've done these experiments for i915, that _actually_ saves a ton of binary size, with fairly minimal code and maintenance impact. Still, we decided the payoff is simply too small to bother making it a production thing. Cheers, Daniel > --- > drivers/gpu/drm/sun4i/sun4i_tcon.c | 14 +++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/sun4i/sun4i_tcon.c > b/drivers/gpu/drm/sun4i/sun4i_tcon.c > index 4834c90b4912..c78cd35a1294 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_tcon.c > +++ b/drivers/gpu/drm/sun4i/sun4i_tcon.c > @@ -974,7 +974,8 @@ static bool sun4i_tcon_connected_to_tcon_top(struct > device_node *node) > > remote = of_graph_get_remote_node(node, 0, -1); > if (remote) { > - ret = !!of_match_node(sun8i_tcon_top_of_table, remote); > + ret = !!(IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) && > + of_match_node(sun8i_tcon_top_of_table, remote)); > of_node_put(remote); > } > > @@ -1402,13 +1403,20 @@ static int sun8i_r40_tcon_tv_set_mux(struct > sun4i_tcon *tcon, > if (!pdev) > return -EINVAL; > > - if (encoder->encoder_type == DRM_MODE_ENCODER_TMDS) { > + if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP) && > + encoder->encoder_type == DRM_MODE_ENCODER_TMDS) { > ret = sun8i_tcon_top_set_hdmi_src(>dev, id); > if (ret) > return ret; > } > > - return sun8i_tcon_top_de_config(>dev, tcon->id, id); > + if (IS_ENABLED(CONFIG_DRM_SUN8I_TCON_TOP)) { > + ret = sun8i_tcon_top_de_config(>dev, tcon->id, id); > + if (ret) > + return ret; > + } > + > + return 0; > } > > static const struct sun4i_tcon_quirks sun4i_a10_quirks = { > -- > 2.17.1 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
Dne ponedeljek, 09. julij 2018 ob 10:07:24 CEST je Maxime Ripard napisal(a): > On Fri, Jul 06, 2018 at 02:45:53PM +0200, Arnd Bergmann 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_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] > > undefined! ERROR: "sun8i_tcon_top_of_table" > > [drivers/gpu/drm/sun4i/sun4i-drm.ko] undefined! > > > > This solves the problem by making DRM_SUN8I_MIXER a 'bool' symbol, > > building > > the sun8i_tcon_top module the same way as the core sun4i-drm module > > whenever DRM_SUN8I_MIXER is enabled, or not building it at all otherwise. > > > > Alternatively, we could always build sun8i_tcon_top.ko along with > > sun4-drm.ko and detach it from the mixer module, I could not tell which > > way is more appropriate here. > > If that's easily doable, then yeah, that would be the preferred option > I guess. Jernej? Chen-Yu? Any opinion on this? I guess that only means building sun8i_tcon_top.o with DRM_SUN4I instead of DRM_SUN8I_MIXER. While this would be simple solution, sun8i_tcon_top would be dead weight if DRM_SUN8I_MIXER is disabled. But it is really small module, so I don't see any harm. Additionally, with my follow up R40 HDMI series, there is even more calls from DRM_SUN4I enabled drivers to sun8i_tcon_top driver. So I'm also for sun8i_tcon_top.o being build with DRM_SUN4I, because it is simpler, cleaner and it's symbols (including those introduced in R40 HDMI follow up series) are used mostly by DRM_SUN4I drivers (only exception being sun8i_dw_hdmi). Best regards, Jernej ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Mon, Jul 9, 2018 at 5:15 PM, Maxime Ripard wrote: > On Mon, Jul 09, 2018 at 04:58:48PM +0800, Chen-Yu Tsai wrote: >> On Mon, Jul 9, 2018 at 4:07 PM, Maxime Ripard >> wrote: >> > On Fri, Jul 06, 2018 at 02:45:53PM +0200, Arnd Bergmann 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_of_table" >> >> [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] undefined! >> >> ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] >> >> undefined! >> >> >> >> This solves the problem by making DRM_SUN8I_MIXER a 'bool' symbol, >> >> building >> >> the sun8i_tcon_top module the same way as the core sun4i-drm module >> >> whenever >> >> DRM_SUN8I_MIXER is enabled, or not building it at all otherwise. >> >> >> >> Alternatively, we could always build sun8i_tcon_top.ko along with >> >> sun4-drm.ko >> >> and detach it from the mixer module, I could not tell which way is more >> >> appropriate here. >> > >> > If that's easily doable, then yeah, that would be the preferred option >> > I guess. Jernej? Chen-Yu? Any opinion on this? >> >> Yeah, that definitely works for me. Having TCON TOP being part of the core >> sun4i-drm makes more sense. The TCON code will likely call into it later on >> when Jernej adds the encoder muxing code. >> >> I wonder if we shouldn't just build the whole display engine code, excluding >> downstream encoders (HDMI, DSI, TV) into one module. That would also fix the >> issue that DRM_SUN4I_BACKEND has to be built-in if DRM_SUN4I is built-in. >> That might be overkill though, given that one day we should be able to get >> rid of the frontend check. > > We can't really do that (or at least without rewriting a significant > part of the driver), since we can have only one > module_init/module_exit function per module, and we have one > per-hardware block. Right. That would require some serious plumbing to register all the drivers. ChenYu ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Mon, Jul 09, 2018 at 04:58:48PM +0800, Chen-Yu Tsai wrote: > On Mon, Jul 9, 2018 at 4:07 PM, Maxime Ripard > wrote: > > On Fri, Jul 06, 2018 at 02:45:53PM +0200, Arnd Bergmann 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_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] > >> undefined! > >> ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] > >> undefined! > >> > >> This solves the problem by making DRM_SUN8I_MIXER a 'bool' symbol, building > >> the sun8i_tcon_top module the same way as the core sun4i-drm module > >> whenever > >> DRM_SUN8I_MIXER is enabled, or not building it at all otherwise. > >> > >> Alternatively, we could always build sun8i_tcon_top.ko along with > >> sun4-drm.ko > >> and detach it from the mixer module, I could not tell which way is more > >> appropriate here. > > > > If that's easily doable, then yeah, that would be the preferred option > > I guess. Jernej? Chen-Yu? Any opinion on this? > > Yeah, that definitely works for me. Having TCON TOP being part of the core > sun4i-drm makes more sense. The TCON code will likely call into it later on > when Jernej adds the encoder muxing code. > > I wonder if we shouldn't just build the whole display engine code, excluding > downstream encoders (HDMI, DSI, TV) into one module. That would also fix the > issue that DRM_SUN4I_BACKEND has to be built-in if DRM_SUN4I is built-in. > That might be overkill though, given that one day we should be able to get > rid of the frontend check. We can't really do that (or at least without rewriting a significant part of the driver), since we can have only one module_init/module_exit function per module, and we have one per-hardware block. Maxime -- Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Mon, Jul 9, 2018 at 4:07 PM, Maxime Ripard wrote: > On Fri, Jul 06, 2018 at 02:45:53PM +0200, Arnd Bergmann 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_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] >> undefined! >> ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] >> undefined! >> >> This solves the problem by making DRM_SUN8I_MIXER a 'bool' symbol, building >> the sun8i_tcon_top module the same way as the core sun4i-drm module whenever >> DRM_SUN8I_MIXER is enabled, or not building it at all otherwise. >> >> Alternatively, we could always build sun8i_tcon_top.ko along with sun4-drm.ko >> and detach it from the mixer module, I could not tell which way is more >> appropriate here. > > If that's easily doable, then yeah, that would be the preferred option > I guess. Jernej? Chen-Yu? Any opinion on this? Yeah, that definitely works for me. Having TCON TOP being part of the core sun4i-drm makes more sense. The TCON code will likely call into it later on when Jernej adds the encoder muxing code. I wonder if we shouldn't just build the whole display engine code, excluding downstream encoders (HDMI, DSI, TV) into one module. That would also fix the issue that DRM_SUN4I_BACKEND has to be built-in if DRM_SUN4I is built-in. That might be overkill though, given that one day we should be able to get rid of the frontend check. Here's a list of the size of various parts of this driver, built for ARMv7: Common stuff: textdata bss dec hex filename 5021 344 0536514f5 drivers/gpu/drm/sun4i/sun4i_drv.o 1058 0 01058 422 drivers/gpu/drm/sun4i/sun4i_layer.o 192 4 0 196 c4 drivers/gpu/drm/sun4i/sun4i_framebuffer.o 1704 0 01704 6a8 drivers/gpu/drm/sun4i/sun4i_crtc.o 1221 0 01221 4c5 drivers/gpu/drm/sun4i/sun4i_dotclock.o 1192 28 01220 4c4 drivers/gpu/drm/sun4i/sun4i_lvds.o 1583 92 01675 68b drivers/gpu/drm/sun4i/sun4i_rgb.o 10088 248 0 103362860 drivers/gpu/drm/sun4i/sun4i_tcon.o 1690 104 01794 702 drivers/gpu/drm/sun4i/sun6i_drc.o 23749 820 0 245695ff9 (TOTALS) DE 1.0: textdata bss dec hex filename 3596 248 03844 f04 drivers/gpu/drm/sun4i/sun4i_frontend.o 8735 248 089832317 drivers/gpu/drm/sun4i/sun4i_backend.o 12331 496 0 12827321b (TOTALS) DE 2.0: textdata bss dec hex filename 4040 248 0428810c0 drivers/gpu/drm/sun4i/sun8i_mixer.o 2620 28 02648 a58 drivers/gpu/drm/sun4i/sun8i_ui_layer.o 1500 0 01500 5dc drivers/gpu/drm/sun4i/sun8i_ui_scaler.o 2780 28 02808 af8 drivers/gpu/drm/sun4i/sun8i_vi_layer.o 12612 0 0 126123144 drivers/gpu/drm/sun4i/sun8i_vi_scaler.o 367 0 0 367 16f drivers/gpu/drm/sun4i/sun8i_csc.o 23919 304 0 242235e9f (TOTALS) TCON TOP: textdata bss dec hex filename 2623 104 02727 aa7 drivers/gpu/drm/sun4i/sun8i_tcon_top.o 2623 104 02727 aa7 (TOTALS) DE 1.0 HDMI: textdata bss dec hex filename 913 0 0 913 391 drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.o 5543 104 05647160f drivers/gpu/drm/sun4i/sun4i_hdmi_enc.o 2583 0 02583 a17 drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.o 1326 0 01326 52e drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.o 10365 104 0 1046928e5 (TOTALS) MIPI DSI: textdata bss dec hex filename 1990 144 02134 856 drivers/gpu/drm/sun4i/sun6i_mipi_dphy.o 5921 132 0605317a5 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.o 7911 276 081871ffb (TOTALS) DW HDMI: textdata bss dec hex filename 1774 104 01878 756 drivers/gpu/drm/sun4i/sun8i_dw_hdmi.o 1189 0 01189 4a5 drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.o 4877 144 05021139d drivers/gpu/drm/sun4i/sun8i_hdmi_phy.o 7840 248 080881f98 (TOTALS) So it seems better to keep various parts as separate modules. The "data" column makes me wonder if we've constify-ed all possible data structures yet. Regards ChenYu ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/sun4i: fix build failure with CONFIG_DRM_SUN8I_MIXER=m
On Fri, Jul 06, 2018 at 02:45:53PM +0200, Arnd Bergmann 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_of_table" [drivers/gpu/drm/sun4i/sun8i-drm-hdmi.ko] > undefined! > ERROR: "sun8i_tcon_top_of_table" [drivers/gpu/drm/sun4i/sun4i-drm.ko] > undefined! > > This solves the problem by making DRM_SUN8I_MIXER a 'bool' symbol, building > the sun8i_tcon_top module the same way as the core sun4i-drm module whenever > DRM_SUN8I_MIXER is enabled, or not building it at all otherwise. > > Alternatively, we could always build sun8i_tcon_top.ko along with sun4-drm.ko > and detach it from the mixer module, I could not tell which way is more > appropriate here. If that's easily doable, then yeah, that would be the preferred option I guess. Jernej? Chen-Yu? Any opinion on this? Maxime -- Maxime Ripard, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com signature.asc Description: PGP signature ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel