public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 3/5] arm: tegra30: video: integrate display driver for t30
@ 2015-08-20 23:46 Marcel Ziswiler
  2015-08-21  9:27 ` Thierry Reding
  0 siblings, 1 reply; 15+ messages in thread
From: Marcel Ziswiler @ 2015-08-20 23:46 UTC (permalink / raw)
  To: u-boot

On 20 Aug 2015 22:09, Stephen Warren <swarren@wwwdotorg.org> wrote:

> Hopefully the process was to copy the Linux Tegra30 DT verbatim?

No, the T20 one is far from verbatim neither. So I just did the adjustments analogous by comparing the T20 and T30 Linux DTs.

> That's
> far more likely to yield a correct DT than copying the Tegra20 DT to
> Tegra30 and then patching it until it works.

I guess U-Boot has anyway about zero functionality dependency on that part of the device trees.

> If this DT doesn't exactly
> match the Linux kernel, this needs to be fixed.

Well, then any Tegra device tree currently in U-Boot needs serious fixing. I usually tend to at least not make the mess any worse.

> > diff --git a/arch/arm/mach-tegra/tegra30/Makefile b/arch/arm/mach-tegra/tegra30/Makefile
>
> > -obj-$(CONFIG_SPL_BUILD) += cpu.o
> > +ifdef CONFIG_SPL_BUILD
> > +obj-y        += cpu.o
>
>
> I don't think there's any need to edit the cpu.o line. While you can
> move it into the ifdef like that, I don't see a need.

I can sure revert this then.

> > diff --git a/arch/arm/mach-tegra/tegra30/display.c b/arch/arm/mach-tegra/tegra30/display.c
>
> I didn't review this file in detail; I'll leave that to Thierry since he
> knows the display HW.
>
> However, one question: Is this file a complete cut/paste of
> tegra20/display.c, or does it just replace some parts of it? Hopefully
> this patch doesn't simply duplicate the whole driver?

Yes, for now this is  an exact one-to-one copy but I lack the detailed knowledge about Tegra graphics to know whether this is much sane.

On first sight to me the current split between hardware agnostic (e.g. driver/video/tegra.c) and hardware specific (e.g. mach-tegra/<SoC>/display.c) seems rather arbitrary. Downstream [1] I actually took a more radical approach and if that is rather accepted I'm happy to rework this patch set in that direction as well. But then actually completely merging tegra.c and display.c might even make more sense. I'm open to suggestions really.

[1] http://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=2015.04-toradex-next&id=5a472ddd7a2a017747d6c05c65eba2cd3804c02f

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 3/5] arm: tegra30: video: integrate display driver for t30
@ 2015-08-24 22:13 Marcel Ziswiler
  0 siblings, 0 replies; 15+ messages in thread
From: Marcel Ziswiler @ 2015-08-24 22:13 UTC (permalink / raw)
  To: u-boot

On 22 Aug 2015 02:38, Simon Glass <sjg@chromium.org> wrote:

> Please take a look at tegra124's display driver for an
> example.

You mean that second copy of the existing Tegra stuff I find myself now certainly in the middle of having to clean up? Thank you!

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 3/5] arm: tegra30: video: integrate display driver for t30
@ 2015-08-24 22:03 Marcel Ziswiler
  2015-08-26  7:39 ` Thierry Reding
  0 siblings, 1 reply; 15+ messages in thread
From: Marcel Ziswiler @ 2015-08-24 22:03 UTC (permalink / raw)
  To: u-boot

On 21 Aug 2015 11:29, Thierry Reding <treding@nvidia.com> wrote:

> I agree with Stephen that U-Boot should use an exact copy of the DTS
> files in the kernel. The bits in the kernel get much more review and
> have been known to work well for a number of years.

I do not oppose however I doubt this has ever been the case. At least for the Tegras this is far from the truth.

> U-Boot depending on the device tree or not is really an orthogonal
> issue. If we keep a delta between U-Boot and Linux DTS files, we'll risk
> breaking things badly if we ever do end up putting device tree sources
> into a common source tree, because we'd be exposing U-Boot to something
> that it wasn't tested against.

I'm not even that sure whether using device trees in U-Boot is really that smart at all especially considering SPL and such. But that's a different thematic...

> That's certainly a true statement. There really should never have been
> such a disconnect as we currently have. If we can't agree on using the
> very same DTS files for both U-Boot and Linux we might as well not use
> device tree at all (in U-Boot).

Exactly.

> Perhaps a good idea would be to simply copy what we have in the kernel
> and see where (if at all) U-Boot breaks down and fix it to work properly
> with "upstream" DTBs.

I can certainly give this a try on our hardware however most NVIDIA boards are far or at least were far from public so I can't test those as I don't have any access.

> I can't obviously force you to do all that work to fix past mistakes,
> but I'd like to see at least new DTS content in U-Boot deviate from what
> we have upstream in the kernel.

OK, fair enough.

> It looks to me like this adds even a third copy. There's already a
> duplicate of the display controller bits in drivers/video/tegra124 along
> with some new code to support eDP.

Me wondering how that came along then?

> There really isn't much reason for
> duplicating the drivers since the display controllers haven't changed
> very much over the various SoC generations. And especially in U-Boot I
> don't think you'll need fancy features like color conversion or gamma
> correction, or smart dimming, which are really the only areas where
> there have been changes.
>
> If you look at the Linux kernel driver we get away with very minimal
> parameterization, and I think the same should be possible for U-Boot.

Agreed, just wondering about the lack of any documentation thereof.

> In a similar vein I think it should be possible to write unified drivers
> for each type of output (RGB, HDMI, DSI, SOR). Those require even less
> parameterization since there have been almost no changes to those since
> their introduction, the rare exception being fancy features that I don't
> think would be needed for U-Boot.
>
> Granted, U-Boot doesn't give you much of a framework to work with, so
> there's a lot of code that would need to be written to abstract things,
> but I think that's effort well spent, much better than simply
> duplicating for each new generation.

As mentioned before my doubts go as deep as the actual functional split thereof.

> Frankly I think it should all move into a separate "tegra" subdirectory
> in drivers/video/. There's likely going to be quite a few files if we
> want to support several types of outputs, and a subdirectory will help
> keep things organized.
>
> I think a framework for U-Boot could be fairly simple and doesn't have
> to have the complexity of DRM/KMS in the kernel. I'd expect the U-Boot
> configuration to be statically defined, and if the "framework" is Tegra
> specific it doesn't need to be as generic either.
>
> Perhaps something as simple as:
>
>         struct tegra_dc {
>                 ...
>                 int (*enable)(struct tegra_dc *dc, const struct display_mode *mode);
>                 void (*disable)(struct tegra_dc *dc);
>                 ...
>         };
>
>         struct tegra_output {
>                 ...
>                 struct tegra_dc *dc;
>                 ...
>                 int (*enable)(struct tegra_output *output, const struct display_mode *mode);
>                 void (*disable)(struct tegra_output *output);
>                 ...
>         };
>
> would work fine. That's roughly how drivers are implemented in the
> kernel. Setting up display on an output would be done by determining the
> mode (typically by parsing EDID if available, or using a hard-coded mode
> otherwise) and then calling:
>
>         output->dc = dc;
>         dc->enable(dc, mode);
>         output->enable(output, mode);
>
> You might want to add in an abstraction for panels as well to make sure
> you have enough flexibility to enable and disable those, too. In that
> case you'd probably want to complement the above sequence with:
>
>         panel->enable(panel);
>
> Which should work for everything, except maybe DSI, where you may need
> some sort of inbetween step for panels that need additional setup using
> DCS commands or the like. But I suspect that's a bridge that can be
> crossed when we get to it.
>
> That said, I don't forsee myself having any time to devote to this, but
> if anyone ends up spending work on this, feel free to Cc me on patches
> or ask if you have questions about the display hardware or the framework
> design. I'm sure I can find the time to provide feedback.

I also doubt finding that kind of time. My goal was simply to make T30 usable to the same extend as the T20 before it gets completely lost.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 0/5] arm: tegra: apalis/colibri_t30: video: add display driver
@ 2015-08-20 11:29 Marcel Ziswiler
  2015-08-20 11:29 ` [U-Boot] [PATCH 3/5] arm: tegra30: video: integrate display driver for t30 Marcel Ziswiler
  0 siblings, 1 reply; 15+ messages in thread
From: Marcel Ziswiler @ 2015-08-20 11:29 UTC (permalink / raw)
  To: u-boot

On popular request this series integrates the display driver from T20
to work on T30 as well and enables it for our Apalis/Colibri T30
computer/system on modules. Enjoy.

Marcel Ziswiler (5):
  arm: tegra20: video: rename display header ifdef gating
  arm: tegra20: video: ifdef gate hard-coded ugly Tegra20 pin muxing
  arm: tegra30: video: integrate display driver for t30
  colibri_t30: enable display driver
  apalis_t30: enable display driver

 arch/arm/dts/tegra30-apalis.dts                    |  29 ++
 arch/arm/dts/tegra30-colibri.dts                   |  29 ++
 arch/arm/dts/tegra30.dtsi                          | 104 ++++++
 arch/arm/include/asm/arch-tegra20/display.h        |   6 +-
 arch/arm/include/asm/arch-tegra30/display.h        |  13 +
 arch/arm/include/asm/arch-tegra30/pwm.h            |  14 +
 arch/arm/mach-tegra/tegra30/Makefile               |   6 +-
 arch/arm/mach-tegra/tegra30/display.c              | 394 +++++++++++++++++++++
 .../toradex/apalis_t30/pinmux-config-apalis_t30.h  |   9 +-
 .../colibri_t30/pinmux-config-colibri_t30.h        |   8 +-
 drivers/video/tegra.c                              |   2 +
 include/configs/apalis_t30.h                       |  10 +
 include/configs/colibri_t30.h                      |  10 +
 include/configs/tegra30-common.h                   |   3 +
 14 files changed, 625 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra30/display.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/pwm.h
 create mode 100644 arch/arm/mach-tegra/tegra30/display.c

-- 
2.4.3

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-08-26 13:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20 23:46 [U-Boot] [PATCH 3/5] arm: tegra30: video: integrate display driver for t30 Marcel Ziswiler
2015-08-21  9:27 ` Thierry Reding
2015-08-22  0:37   ` Simon Glass
2015-08-24 10:12     ` Thierry Reding
2015-08-24 16:58       ` Simon Glass
2015-08-25 11:02         ` Thierry Reding
2015-08-25 16:03           ` Simon Glass
2015-08-26  7:29             ` Thierry Reding
2015-08-26 13:32               ` Simon Glass
  -- strict thread matches above, loose matches on Subject: below --
2015-08-24 22:13 Marcel Ziswiler
2015-08-24 22:03 Marcel Ziswiler
2015-08-26  7:39 ` Thierry Reding
2015-08-26 13:32   ` Simon Glass
2015-08-20 11:29 [U-Boot] [PATCH 0/5] arm: tegra: apalis/colibri_t30: video: add display driver Marcel Ziswiler
2015-08-20 11:29 ` [U-Boot] [PATCH 3/5] arm: tegra30: video: integrate display driver for t30 Marcel Ziswiler
2015-08-20 20:10   ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox