From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Rob Herring <robherring2@gmail.com>
Cc: linux-fbdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org,
dri-devel@lists.freedesktop.org, kernel@pengutronix.de,
Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: Re: [PATCH v4] of: Add videomode helper
Date: Tue, 25 Sep 2012 11:23:39 +0000 [thread overview]
Message-ID: <1378654.FmcPtcTNE1@avalon> (raw)
In-Reply-To: <50606334.7030902@gmail.com>
Hi Rob,
On Monday 24 September 2012 08:42:12 Rob Herring wrote:
> On 09/19/2012 03:20 AM, Steffen Trumtrar wrote:
> > This patch adds a helper function for parsing videomodes from the
> > devicetree. The videomode can be either converted to a struct
> > drm_display_mode or a struct fb_videomode.
> >
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> > ---
> >
> > Hi!
> >
> > changes since v3:
> > - print error messages
> > - free alloced memory
> > - general cleanup
> >
> > Regards
> > Steffen
> >
> > .../devicetree/bindings/video/displaymode | 74 +++++
> > drivers/of/Kconfig | 5 +
> > drivers/of/Makefile | 1 +
> > drivers/of/of_videomode.c | 283
> > ++++++++++++++++++++ include/linux/of_videomode.h
> > | 56 ++++
> > 5 files changed, 419 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/video/displaymode
> > create mode 100644 drivers/of/of_videomode.c
> > create mode 100644 include/linux/of_videomode.h
> >
> > diff --git a/Documentation/devicetree/bindings/video/displaymode
> > b/Documentation/devicetree/bindings/video/displaymode new file mode
> > 100644
> > index 0000000..990ca52
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/video/displaymode
> > @@ -0,0 +1,74 @@
> > +videomode bindings
> > +=========
> > +
> > +Required properties:
> > + - hactive, vactive: Display resolution
> > + - hfront-porch, hback-porch, hsync-len: Horizontal Display timing
> > parameters + in pixels
> > + vfront-porch, vback-porch, vsync-len: Vertical display timing
> > parameters in + lines
> > + - clock: displayclock in Hz
>
> A major piece missing is the LCD controller to display interface width
> and component ordering.
>
> > +
> > +Optional properties:
> > + - width-mm, height-mm: Display dimensions in mm
> > + - hsync-active-high (bool): Hsync pulse is active high
> > + - vsync-active-high (bool): Vsync pulse is active high
> > + - interlaced (bool): This is an interlaced mode
> > + - doublescan (bool): This is a doublescan mode
> > +
> > +There are different ways of describing a display mode. The devicetree
> > representation
> > +corresponds to the one commonly found in datasheets for displays.
> > +The description of the display and its mode is split in two parts: first
> > the display
> > +properties like size in mm and (optionally) multiple subnodes with the
> > supported modes.
> > +
> > +Example:
> > +
> > + display@0 {
>
> It would be useful to have a compatible string here. We may not always
> know the panel type or have a fixed panel though. We could define
> "generic-lcd" or something for cases where the panel type is unknown.
I'm working on a generic panel framework (see
http://lwn.net/Articles/512363/). DT bindings are not there yet, but they're
certainly a hot topic. A compatible string here will definitely be needed
here.
The exact properties required in the display node will likely be panel-
dependent. width-mm, height-mm and modes sound like a good baseline to me.
> > + width-mm = <800>;
> > + height-mm = <480>;
> > + modes {
> > + mode0: mode@0 {
> > + /* 1920x1080p24 */
> > + clock = <52000000>;
> > + hactive = <1920>;
> > + vactive = <1080>;
> > + hfront-porch = <25>;
> > + hback-porch = <25>;
> > + hsync-len = <25>;
> > + vback-porch = <2>;
> > + vfront-porch = <2>;
> > + vsync-len = <2>;
> > + hsync-active-high;
> > + };
> > + };
> > + };
> > +
> > +Every property also supports the use of ranges, so the commonly used
> > datasheet +description with <min typ max>-tuples can be used.
> > +
> > +Example:
> > +
> > + mode1: mode@1 {
> > + /* 1920x1080p24 */
> > + clock = <148500000>;
> > + hactive = <1920>;
> > + vactive = <1080>;
> > + hsync-len = <0 44 60>;
> > + hfront-porch = <80 88 95>;
> > + hback-porch = <100 148 160>;
> > + vfront-porch = <0 4 6>;
> > + vback-porch = <0 36 50>;
> > + vsync-len = <0 5 6>;
> > + };
> > +
> > +The videomode can be linked to a connector via phandles. The connector
> > has to
> > +support the display- and default-mode-property to link to and select a
> > mode.
>
> Could also be phandle in the lcd controller node? What are the '-' for?
> Is "display-blah" a valid name or something?
>
> "default-mode" is pretty generic. How about display-mode or
> display-default-mode?
>
> Rob
>
> > +
> > +Example:
> > +
> > + hdmi@00120000 {
> > + status = "okay";
> > + display = <&benq>;
> > + default-mode = <&mode1>;
> > + };
> > +
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2012-09-25 11:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 8:20 [PATCH v4] of: Add videomode helper Steffen Trumtrar
2012-09-21 13:07 ` Hans Verkuil
[not found] ` <1348042843-24673-1-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-09-19 9:19 ` Tomi Valkeinen
2012-09-20 21:29 ` Laurent Pinchart
2012-09-21 12:47 ` Steffen Trumtrar
2012-09-24 13:42 ` Rob Herring
[not found] ` <50606334.7030902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-09-24 14:12 ` Sascha Hauer
[not found] ` <20120924141233.GN1322-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-09-24 15:18 ` Rob Herring
[not found] ` <506079CF.40902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-09-24 19:16 ` Sascha Hauer
[not found] ` <20120924191628.GR1322-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-09-25 7:51 ` Steffen Trumtrar
2012-09-24 15:45 ` Stephen Warren
[not found] ` <50608000.6050007-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-24 18:26 ` Rob Herring
[not found] ` <5060A5D5.7040908-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-09-24 23:09 ` Stephen Warren
[not found] ` <5060E82A.3030404-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-09-25 8:03 ` Steffen Trumtrar
2012-09-25 11:23 ` Laurent Pinchart [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=1378654.FmcPtcTNE1@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@pengutronix.de \
--cc=linux-fbdev@vger.kernel.org \
--cc=robherring2@gmail.com \
--cc=s.trumtrar@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).