Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [RFC v2 2/5] video: panel: Add DPI panel support
From: Tomi Valkeinen @ 2012-11-27 13:02 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-fbdev, dri-devel, linux-media, Archit Taneja,
	Benjamin Gaignard, Bryan Wu, Inki Dae, Jesse Barker,
	Kyungmin Park, Marcus Lorentzon, Maxime Ripard, Philipp Zabel,
	Ragesh Radhakrishnan, Rob Clark, Sascha Hauer, Sebastien Guiriec,
	Sumit Semwal, Thomas Petazzoni, Tom Gall, Vikas Sajjan
In-Reply-To: <1353620736-6517-3-git-send-email-laurent.pinchart@ideasonboard.com>

[-- Attachment #1: Type: text/plain, Size: 2123 bytes --]

Hi,

On 2012-11-22 23:45, Laurent Pinchart wrote:

> +static void panel_dpi_release(struct display_entity *entity)
> +{
> +	struct panel_dpi *panel = to_panel_dpi(entity);
> +
> +	kfree(panel);
> +}
> +
> +static int panel_dpi_remove(struct platform_device *pdev)
> +{
> +	struct panel_dpi *panel = platform_get_drvdata(pdev);
> +
> +	platform_set_drvdata(pdev, NULL);
> +	display_entity_unregister(&panel->entity);
> +
> +	return 0;
> +}
> +
> +static int __devinit panel_dpi_probe(struct platform_device *pdev)
> +{
> +	const struct panel_dpi_platform_data *pdata = pdev->dev.platform_data;
> +	struct panel_dpi *panel;
> +	int ret;
> +
> +	if (pdata == NULL)
> +		return -ENODEV;
> +
> +	panel = kzalloc(sizeof(*panel), GFP_KERNEL);
> +	if (panel == NULL)
> +		return -ENOMEM;
> +
> +	panel->pdata = pdata;
> +	panel->entity.dev = &pdev->dev;
> +	panel->entity.release = panel_dpi_release;
> +	panel->entity.ops.ctrl = &panel_dpi_control_ops;
> +
> +	ret = display_entity_register(&panel->entity);
> +	if (ret < 0) {
> +		kfree(panel);
> +		return ret;
> +	}
> +
> +	platform_set_drvdata(pdev, panel);
> +
> +	return 0;
> +}
> +
> +static const struct dev_pm_ops panel_dpi_dev_pm_ops = {
> +};
> +
> +static struct platform_driver panel_dpi_driver = {
> +	.probe = panel_dpi_probe,
> +	.remove = panel_dpi_remove,
> +	.driver = {
> +		.name = "panel_dpi",
> +		.owner = THIS_MODULE,
> +		.pm = &panel_dpi_dev_pm_ops,
> +	},
> +};

I'm not sure of how the free/release works. The release func is called
when the ref count drops to zero. But... The object in question, the
panel_dpi struct which contains the display entity, is not only about
data, it's also about code located in this module.

So I don't see anything preventing from unloading this module, while
some other component is holding a ref for the display entity. While its
holding the ref, it's valid to call ops in the display entity, but the
code for the ops in this module is already unloaded.

I don't really know how the kref can be used properly in this use case...

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply

* Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
From: Laurent Pinchart @ 2012-11-27 11:54 UTC (permalink / raw)
  To: jg1.han
  Cc: Laurent Pinchart, akpm, linux-kernel, linux-sh@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Paul Mundt, Magnus Damm,
	Richard Purdie, Kuninori Morimoto
In-Reply-To: <33110366.44811353978636788.JavaMail.weblogic@epv6ml07>

Hi Jingoo,

On Tuesday 27 November 2012 01:10:36 Jingoo Han wrote:
> On Saturday, November 24, 2012 1:35 AM, Laurent Pinchart wrote
> 
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > 
> >  drivers/video/backlight/Kconfig          |    7 ++
> >  drivers/video/backlight/Makefile         |    1 +
> >  drivers/video/backlight/gpio_backlight.c |  158 +++++++++++++++++++++++++
> >  include/video/gpio_backlight.h           |   21 ++++
> >  4 files changed, 187 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/video/backlight/gpio_backlight.c
> >  create mode 100644 include/video/gpio_backlight.h
> 
> 
> [...]
> 
> 
> > +static int __devinit gpio_backlight_probe(struct platform_device *pdev)
> > +{
> > +	struct gpio_backlight_platform_data *pdata = pdev->dev.platform_data;
> > +	struct backlight_properties props;
> > +	struct backlight_device *bl;
> > +	struct gpio_backlight *gbl;
> > +	int ret;
> > +
> > +	gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
> > +	if (gbl = NULL)
> > +		return -ENOMEM;
> > +
> > +	gbl->dev = &pdev->dev;
> > +
> > +	if (!pdata) {
> > +		dev_err(&pdev->dev, "failed to find platform data\n");
> > +		return -ENODEV;
> > +	}
> > +
> > +	gbl->fbdev = pdata->fbdev;
> > +	gbl->gpio = pdata->gpio;
> > +	gbl->active = pdata->active_low ? 0 : 1;
> > +
> > +	ret = devm_gpio_request_one(gbl->dev, gbl->gpio, GPIOF_DIR_OUT,
> > +				    pdata->name);
> 
> 
> Please use GPIOF_INIT flags if you want to turn off GPIO backlight.
> If gbl->active is inverted, GPIOF_INIT_HIGH can be used as below:
> 
> 	ret = devm_gpio_request_one(gbl->dev, gbl->gpio,
> 				    GPIOF_DIR_OUT | (gbl->active ?
> 				    GPIOF_INIT_LOW : GPIOF_INIT_HIGH),
> 				    pdata->name);

Good point, thank you. I'll fix that.

> > +	if (ret < 0) {
> > +		dev_err(&pdev->dev, "unable to request GPIO\n");
> > +		return ret;
> > +	}
> > +
> > +	memset(&props, 0, sizeof(props));
> > +	props.type = BACKLIGHT_RAW;
> > +	props.max_brightness = 1;
> > +	bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, gbl,
> > +				       &gpio_backlight_ops, &props);
> > +	if (IS_ERR(bl)) {
> > +		dev_err(&pdev->dev, "failed to register backlight\n");
> > +		return PTR_ERR(bl);
> > +	}
> > +
> > +	bl->props.brightness = pdata->def_value;
> > +	backlight_update_status(bl);
> > +
> > +	platform_set_drvdata(pdev, bl);
> > +	return 0;
> > +}

-- 
Regards,

Laurent Pinchart


^ permalink raw reply

* Re: [GIT PULL] Exynos DP for v3.8
From: Tomi Valkeinen @ 2012-11-27  9:58 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <28517517.77811353652672706.JavaMail.weblogic@epml06>

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]

On 2012-11-23 08:37, Jingoo Han wrote:
> Hi Tomi,
> 
> Thank you for taking care of pull requests for the v3.8 merge window.
> These patches have been submitted for more than one month,
> and tested with Exynos5250.
> 
> The following changes since commit f4a75d2eb7b1e2206094b901be09adb31ba63681:
> 
>   Linux 3.7-rc6 (Fri Nov 16 17:42:40 2012 -0800)
> 
> are available in the git repository at:
>   git://github.com/jingoo/linux.git exynos-dp-next
> 
> ----------------------------------------------------------------
> Exynos DP changes for the 3.8 merge window.
> 
> - Device Tree support for Samsung Exynos DP
> - SW Link training is cleaned up.
> - HPD interrupt is supported.
> ----------------------------------------------------------------
> 
> Ajay Kumar (5):
>       video: exynos_dp: Add device tree support to DP driver
>       video: exynos_dp: device tree documentation
>       video: exynos_dp: Reset and initialize DP before requesting irq
>       video: exynos_dp: Fix incorrect setting for INT_CTL
>       video: exynos_dp: remove redundant parameters
> 
> Sean Paul (8):
>       video: exynos_dp: Check DPCD return codes
>       video: exynos_dp: Clean up SW link training
>       video: exynos_dp: Get pll lock before pattern set
>       video: exynos_dp: Improve EDID error handling
>       video: exynos_dp: Fix bug when checking dp->irq
>       video: exynos_dp: Remove sink control to D0
>       video: exynos_dp: Move hotplug into a workqueue
>       video: exynos_dp: Enable hotplug interrupts
> 
>  .../devicetree/bindings/video/exynos_dp.txt        |   80 +++
>  drivers/video/exynos/exynos_dp_core.c              |  697 ++++++++++++--------
>  drivers/video/exynos/exynos_dp_core.h              |   21 +-
>  drivers/video/exynos/exynos_dp_reg.c               |   77 ++-
>  drivers/video/exynos/exynos_dp_reg.h               |    3 +-
>  5 files changed, 583 insertions(+), 295 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/video/exynos_dp.txt

Has the DT bindings been reviewed by the device tree people? It would
good to have an ack from them.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply

* Re: Temporary fbdev maintainership for 3.8 merge window
From: Tabi Timur-B04825 @ 2012-11-27  2:23 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <50AE34DE.7030209@ti.com>

On Thu, Nov 22, 2012 at 8:21 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:

> If you have just a few patches, I can apply them directly. If you have
> more, please send a proper pull request to me.

I have a set of nine patches that I posted on October 16th:

https://patchwork.kernel.org/project/linux-fbdev/list/?submitter=timur

These are intended for 3.8.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
From: Jingoo Han @ 2012-11-27  1:24 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Jingoo Han, Laurent Pinchart, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Paul Mundt, Magnus Damm,
	Richard Purdie, Kuninori Morimoto
In-Reply-To: <1353688515-30458-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

T24gTW9uZGF5LCBOb3ZlbWJlciAyNiwgMjAxMiA3OjI1IFBNLCBMYXVyZW50IFBpbmNoYXJ0IHdy
b3RlDQo+IA0KPiBIaSBKaW5nb28sDQo+IA0KPiBPbiBNb25kYXkgMjYgTm92ZW1iZXIgMjAxMiAw
OTo0OTozNiBKaW5nb28gSGFuIHdyb3RlOg0KPiA+IE9uIFNhdHVyZGF5LCBOb3ZlbWJlciAyNCwg
MjAxMiAxOjM1IEFNLCBMYXVyZW50IFBpbmNoYXJ0IHdyb3RlDQo+ID4gPg0KPiA+ID4gU2lnbmVk
LW9mZi1ieTogTGF1cmVudCBQaW5jaGFydCA8bGF1cmVudC5waW5jaGFydEBpZGVhc29uYm9hcmQu
Y29tPg0KPiA+DQo+ID4gQ0MnZWQgQW5kcmV3IE1vcnRvbg0KPiA+DQo+ID4gSXQgbG9va3MgZ29v
ZC4gQWxzbywgSSB0ZXN0ZWQgdGhpcyBwYXRjaCB3aXRoIFNNREs0MjEwIGJvYXJkLg0KPiA+IEFj
a2VkLWJ5OiBKaW5nb28gSGFuIDxqZzEuaGFuQHNhbXN1bmcuY29tPg0KPiANCj4gVGhhbmsgeW91
Lg0KPiANCj4gVW5sZXNzIFJpY2hhcmQgd2FudHMgdG8gdGFrZSAxLzUgYW5kIDIvNSwgSSBwbGFu
IHRvIHB1c2ggdGhlbSB0aHJvdWdoIGVpdGhlcg0KPiB0aGUgUmVuZXNhcyBBUk0gb3IgUmVuZXNh
cyBTSCB0cmVlIHdpdGggdGhlIGJvYXJkIGNvZGUgcGF0Y2hlcy4NCg0KSGkgTGF1cmVudCwNCg0K
T0ssIEkgc2VlLg0KTWF5YmUgUmljaGFyZCB3b24ndCB0YWtlIDEvNSBhbmQgMi81LiBBcyB5b3Ug
bWVudGlvbmVkLCBpdCB3b3VsZCBiZSBnb29kDQp0byBwdXNoIHRoZW0gdGhyb3VnaG91dCB0aGUg
UmVuZXNhcyB0cmVlIHRvIGF2b2lkIGJpc2VjdGlvbiBicmVha2FnZXMuDQoNCkJlc3QgcmVnYXJk
cywNCkppbmdvbyBIYW4NCg0KDQo


^ permalink raw reply

* Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
From: Jingoo Han @ 2012-11-27  1:10 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: akpm, linux-kernel, linux-sh@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Paul Mundt, Magnus Damm,
	Richard Purdie, Kuninori Morimoto, Jingoo Han
In-Reply-To: <1353688515-30458-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

T24gU2F0dXJkYXksIE5vdmVtYmVyIDI0LCAyMDEyIDE6MzUgQU0sIExhdXJlbnQgUGluY2hhcnQg
d3JvdGUNCj4gDQo+IFNpZ25lZC1vZmYtYnk6IExhdXJlbnQgUGluY2hhcnQgPGxhdXJlbnQucGlu
Y2hhcnRAaWRlYXNvbmJvYXJkLmNvbT4NCj4gLS0tDQo+ICBkcml2ZXJzL3ZpZGVvL2JhY2tsaWdo
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7DQo+ICsJCXJldHVybiByZXQ7DQo+ICsJfQ0KPiArDQo+ICsJ
bWVtc2V0KCZwcm9wcywgMCwgc2l6ZW9mKHByb3BzKSk7DQo+ICsJcHJvcHMudHlwZSA9IEJBQ0tM
SUdIVF9SQVc7DQo+ICsJcHJvcHMubWF4X2JyaWdodG5lc3MgPSAxOw0KPiArCWJsID0gYmFja2xp
Z2h0X2RldmljZV9yZWdpc3RlcihkZXZfbmFtZSgmcGRldi0+ZGV2KSwgJnBkZXYtPmRldiwgZ2Js
LA0KPiArCQkJCSAgICAgICAmZ3Bpb19iYWNrbGlnaHRfb3BzLCAmcHJvcHMpOw0KPiArCWlmIChJ
U19FUlIoYmwpKSB7DQo+ICsJCWRldl9lcnIoJnBkZXYtPmRldiwgImZhaWxlZCB0byByZWdpc3Rl
ciBiYWNrbGlnaHRcbiIpOw0KPiArCQlyZXR1cm4gUFRSX0VSUihibCk7DQo+ICsJfQ0KPiArDQo+
ICsJYmwtPnByb3BzLmJyaWdodG5lc3MgPSBwZGF0YS0+ZGVmX3ZhbHVlOw0KPiArCWJhY2tsaWdo
dF91cGRhdGVfc3RhdHVzKGJsKTsNCj4gKw0KPiArCXBsYXRmb3JtX3NldF9kcnZkYXRhKHBkZXYs
IGJsKTsNCj4gKwlyZXR1cm4gMDsNCj4gK30NCg0KDQo


^ permalink raw reply

* Re: Temporary fbdev maintainership for 3.8 merge window
From: Timur Tabi @ 2012-11-26 17:16 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <50AE34DE.7030209@ti.com>

On Mon, Nov 26, 2012 at 10:57 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:

> Please send me a pull request. It's much easier for me to pull than
> apply bunch of patches.

Ok, that will take a while.  I don't have an external repository that
I can use.  I would need to create one on github first.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: Temporary fbdev maintainership for 3.8 merge window
From: Tomi Valkeinen @ 2012-11-26 16:57 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <50AE34DE.7030209@ti.com>

[-- Attachment #1: Type: text/plain, Size: 754 bytes --]

On 2012-11-26 18:48, Timur Tabi wrote:
> On Thu, Nov 22, 2012 at 8:21 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> 
>> Florian told me he's very busy for the time being, and this probably
>> last at least until sometime early December. The merge window is coming
>> near, and instead of everybody sending their fbdev related patches
>> directly to Linus, I offer my services as a temporary fbdev maintainer
>> for the next merge window.
> 
> Tomi,
> 
> I have a set of nine patches that I posted on October 16th:
> 
> https://patchwork.kernel.org/project/linux-fbdev/list/?submitter=timur
> 
> These are intended for 3.8.

Please send me a pull request. It's much easier for me to pull than
apply bunch of patches.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply

* Re: [PATCHv15 3/7] video: add of helper for display timings/videomode
From: Tomi Valkeinen @ 2012-11-26 16:56 UTC (permalink / raw)
  To: Steffen Trumtrar
  Cc: linux-fbdev, kernel, David Airlie, devicetree-discuss,
	Florian Tobias Schandinat, dri-devel, Laurent Pinchart,
	Philipp Zabel, Guennady Liakhovetski, linux-media
In-Reply-To: <20121126161055.GB30791@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 5578 bytes --]

On 2012-11-26 18:10, Steffen Trumtrar wrote:
> Hi,
> 
> On Mon, Nov 26, 2012 at 04:38:36PM +0200, Tomi Valkeinen wrote:

>>> +optional properties:
>>> + - hsync-active: hsync pulse is active low/high/ignored
>>> + - vsync-active: vsync pulse is active low/high/ignored
>>> + - de-active: data-enable pulse is active low/high/ignored
>>> + - pixelclk-inverted: pixelclock is inverted (active on falling edge)/
>>> +				non-inverted (active on rising edge)/
>>> +				     ignored (ignore property)
>>
>> I think hsync-active and vsync-active are clear, and commonly used, and
>> they are used for both drm and fb mode conversions in later patches.
>>
>> de-active is not used in drm and fb mode conversions, but I think it's
>> also clear.
>>
>> pixelclk-inverted is not used in the mode conversions. It's also a bit
>> unclear to me. What does it mean that pix clock is "active on rising
>> edge"? The pixel data is driven on rising edge? How about the sync
>> signals and DE, when are they driven? Does your HW have any settings
>> related to those?
>>
> 
> Those are properties commonly found in display specs. That is why they are here.
> If the GPU does not support the property it can be omitted.

So what does the pixelclk-inverted mean? Normally the SoC drives pixel
data on rising edge, and the panel samples it at falling edge? And
vice-versa for inverted? Or the other way around?

When is hsync/vsync set? On rising or falling edge of pclk?

My point here is that the pixelclk-inverted is not crystal clear thing,
like the hsync/vsync/de-active values are.

And while thinking about this, I realized that the meaning of
pixelclk-inverted depends on what component is it applied to. Presuming
normal pixclk means "pixel data on rising edge", the meaning of that
depends on do we consider the SoC or the panel. The panel needs to
sample the data on the other edge from the one the SoC uses to drive the
data.

Does the videomode describe the panel, or does it describe the settings
programmed to the SoC?

>> OMAP has the invert pclk setting, but it also has a setting to define
>> when the sync signals are driven. The options are:
>> - syncs are driven on rising edge of pclk
>> - syncs are driven on falling edge of pclk
>> - syncs are driven on the opposite edge of pclk compared to the pixel data
>>
>> For DE there's no setting, except the active high/low.
>>
>> And if I'm not mistaken, if the optional properties are not defined,
>> they are not ignored, but left to the default 0. Which means active low,
>> or active on rising edge(?). I think it would be good to have a
>> "undefined" value for the properties.
>>
> 
> Yes. As mentioned in my other mail, the intention of the omitted properties do
> not propagate properly. Omitted must be a value < 0, so it is clear in a later
> stage, that this property shall not be used. And isn't unintentionally considered
> to be active low.

Ok. Just note that the values are currently stored into u32, and I don't
think using negative error values with u32 is a good idea.

>> I have some of the same concerns for this series than with the
>> interpreted power sequences (on fbdev): when you publish the DT
>> bindings, it's somewhat final version then, and fixing it later will be
>> difficult. Of course, video modes are much clearer than the power
>> sequences, so it's possible there won't be any problems with the DT
>> bindings.
>>
> 
> The binding is pretty much at the bare minimum after a lot of discussion about
> the properties. Even if the binding changes, I think it will rather grow than
> shrink. Take the doubleclock property for example. It got here mistakingly,
> because we had a display that has this feature.

Right. That's why I would leave the pixelclock-inverted out for now, if
we're not totally sure how it's defined. Of course, it could be just me
who is not understanding the pixclk-inverted =).

>> However, I'd still feel safer if the series would be split to non-DT and
>> DT parts. The non-DT parts could be merged quite easily, and people
>> could start using them in their kernels. This should expose
>> bugs/problems related to the code.
>>
>> The DT part could be merged later, when there's confidence that the
>> timings are good for all platforms.
>>
>> Or, alternatively, all the non-common bindings (de-active, pck
>> invert,...) that are not used for fbdev or drm currently could be left
>> out for now. But I'd stil prefer merging it in two parts.
> 
> I don't say that I'm against it, but the whole reason for the series was
> getting the display timings from a DT into a graphics driver. And I think
> I remember seeing some other attempts at achieving this, but all specific
> to one special case. There is even already a mainline driver that uses an older
> version of the DT bindings (vt8500-fb).

I think it'd be very useful even without DT bindings. But yes, I
understand your need for it.

You're now in v15 of the series. Are you sure v16 will be good enough to
freeze the DT bindings, if 15 previous versions weren't? =). Perhaps I'm
just overly cautious with DT bindings. APIs that are exposed outside the
kernel scare me, as they should be just and not almost right.

However, I want to also point out that where ever you're going to use
the videomode DT bindings, when the common display framework is merged
and presuming you'll use it, you may need to change the DT stuff again
(for the SoC/gfx card, not the videomode bindings).

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply

* Re: Temporary fbdev maintainership for 3.8 merge window
From: Timur Tabi @ 2012-11-26 16:48 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <50AE34DE.7030209@ti.com>

On Thu, Nov 22, 2012 at 8:21 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:

> Florian told me he's very busy for the time being, and this probably
> last at least until sometime early December. The merge window is coming
> near, and instead of everybody sending their fbdev related patches
> directly to Linus, I offer my services as a temporary fbdev maintainer
> for the next merge window.

Tomi,

I have a set of nine patches that I posted on October 16th:

https://patchwork.kernel.org/project/linux-fbdev/list/?submitter=timur

These are intended for 3.8.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply

* Re: [PATCHv15 3/7] video: add of helper for display timings/videomode
From: Steffen Trumtrar @ 2012-11-26 16:10 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: linux-fbdev, kernel, David Airlie, devicetree-discuss,
	Florian Tobias Schandinat, dri-devel, Laurent Pinchart,
	Philipp Zabel, Guennady Liakhovetski, linux-media
In-Reply-To: <50B37EEC.6090808@ti.com>

Hi,

On Mon, Nov 26, 2012 at 04:38:36PM +0200, Tomi Valkeinen wrote:
> Hi,
> 
> On 2012-11-26 11:07, Steffen Trumtrar wrote:
> > This adds support for reading display timings from DT into a struct
> > display_timings. The of_display_timing implementation supports multiple
> > subnodes. All children are read into an array, that can be queried.
> > 
> > If no native mode is specified, the first subnode will be used.
> > 
> > For cases where the graphics driver knows there can be only one
> > mode description or where the driver only supports one mode, a helper
> > function of_get_videomode is added, that gets a struct videomode from DT.
> > 
> > Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Acked-by: Stephen Warren <swarren@nvidia.com>
> > Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
> > Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
> > Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
> > Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  .../devicetree/bindings/video/display-timing.txt   |  107 ++++++++++
> >  drivers/video/Kconfig                              |   15 ++
> >  drivers/video/Makefile                             |    2 +
> >  drivers/video/of_display_timing.c                  |  219 ++++++++++++++++++++
> >  drivers/video/of_videomode.c                       |   54 +++++
> >  include/linux/of_display_timing.h                  |   20 ++
> >  include/linux/of_videomode.h                       |   18 ++
> >  7 files changed, 435 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/video/display-timing.txt
> >  create mode 100644 drivers/video/of_display_timing.c
> >  create mode 100644 drivers/video/of_videomode.c
> >  create mode 100644 include/linux/of_display_timing.h
> >  create mode 100644 include/linux/of_videomode.h
> > 
> > diff --git a/Documentation/devicetree/bindings/video/display-timing.txt b/Documentation/devicetree/bindings/video/display-timing.txt
> > new file mode 100644
> > index 0000000..e238f27
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/video/display-timing.txt
> > @@ -0,0 +1,107 @@
> > +display-timing bindings
> > +===========> > +
> > +display-timings node
> > +--------------------
> > +
> > +required properties:
> > + - none
> > +
> > +optional properties:
> > + - native-mode: The native mode for the display, in case multiple modes are
> > +		provided. When omitted, assume the first node is the native.
> > +
> > +timing subnode
> > +--------------
> > +
> > +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-frequency: display clock in Hz
> > +
> > +optional properties:
> > + - hsync-active: hsync pulse is active low/high/ignored
> > + - vsync-active: vsync pulse is active low/high/ignored
> > + - de-active: data-enable pulse is active low/high/ignored
> > + - pixelclk-inverted: pixelclock is inverted (active on falling edge)/
> > +				non-inverted (active on rising edge)/
> > +				     ignored (ignore property)
> 
> I think hsync-active and vsync-active are clear, and commonly used, and
> they are used for both drm and fb mode conversions in later patches.
> 
> de-active is not used in drm and fb mode conversions, but I think it's
> also clear.
> 
> pixelclk-inverted is not used in the mode conversions. It's also a bit
> unclear to me. What does it mean that pix clock is "active on rising
> edge"? The pixel data is driven on rising edge? How about the sync
> signals and DE, when are they driven? Does your HW have any settings
> related to those?
> 

Those are properties commonly found in display specs. That is why they are here.
If the GPU does not support the property it can be omitted.

> OMAP has the invert pclk setting, but it also has a setting to define
> when the sync signals are driven. The options are:
> - syncs are driven on rising edge of pclk
> - syncs are driven on falling edge of pclk
> - syncs are driven on the opposite edge of pclk compared to the pixel data
> 
> For DE there's no setting, except the active high/low.
> 
> And if I'm not mistaken, if the optional properties are not defined,
> they are not ignored, but left to the default 0. Which means active low,
> or active on rising edge(?). I think it would be good to have a
> "undefined" value for the properties.
> 

Yes. As mentioned in my other mail, the intention of the omitted properties do
not propagate properly. Omitted must be a value < 0, so it is clear in a later
stage, that this property shall not be used. And isn't unintentionally considered
to be active low.

> > + - interlaced (bool): boolean to enable interlaced mode
> > + - doublescan (bool): boolean to enable doublescan mode
> > + - doubleclk (bool)
> 
> As I mentioned in the other mail, doubleclk is not used nor documented here.
> 

Yes. Rebase mistake I overlooked.

> > +All the optional properties that are not bool follow the following logic:
> > +    <1>: high active
> > +    <0>: low active
> > +    omitted: not used on hardware
> > +
> > +There are different ways of describing the capabilities of a display. The devicetree
> > +representation corresponds to the one commonly found in datasheets for displays.
> > +If a display supports multiple signal timings, the native-mode can be specified.
> 
> I have some of the same concerns for this series than with the
> interpreted power sequences (on fbdev): when you publish the DT
> bindings, it's somewhat final version then, and fixing it later will be
> difficult. Of course, video modes are much clearer than the power
> sequences, so it's possible there won't be any problems with the DT
> bindings.
> 

The binding is pretty much at the bare minimum after a lot of discussion about
the properties. Even if the binding changes, I think it will rather grow than
shrink. Take the doubleclock property for example. It got here mistakingly,
because we had a display that has this feature.

> However, I'd still feel safer if the series would be split to non-DT and
> DT parts. The non-DT parts could be merged quite easily, and people
> could start using them in their kernels. This should expose
> bugs/problems related to the code.
> 
> The DT part could be merged later, when there's confidence that the
> timings are good for all platforms.
> 
> Or, alternatively, all the non-common bindings (de-active, pck
> invert,...) that are not used for fbdev or drm currently could be left
> out for now. But I'd stil prefer merging it in two parts.

I don't say that I'm against it, but the whole reason for the series was
getting the display timings from a DT into a graphics driver. And I think
I remember seeing some other attempts at achieving this, but all specific
to one special case. There is even already a mainline driver that uses an older
version of the DT bindings (vt8500-fb).

Regards,
Steffen

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Re: [PATCHv15 2/7] video: add display_timing and videomode
From: Steffen Trumtrar @ 2012-11-26 15:39 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: devicetree-discuss, Rob Herring, linux-fbdev, dri-devel,
	Laurent Pinchart, Thierry Reding, Guennady Liakhovetski,
	linux-media, Stephen Warren, kernel, Florian Tobias Schandinat,
	David Airlie
In-Reply-To: <50B36286.7010704@ti.com>

On Mon, Nov 26, 2012 at 02:37:26PM +0200, Tomi Valkeinen wrote:
> On 2012-11-26 11:07, Steffen Trumtrar wrote:
> 
> > +/*
> > + * Subsystem independent description of a videomode.
> > + * Can be generated from struct display_timing.
> > + */
> > +struct videomode {
> > +	u32 pixelclock;		/* pixelclock in Hz */
> 
> I don't know if this is of any importance, but the linux clock framework
> manages clock rates with unsigned long. Would it be better to use the
> same type here?
> 

Hm, I don't know. Anyone? u32 should be large enough for a pixelclock.

> > +	u32 hactive;
> > +	u32 hfront_porch;
> > +	u32 hback_porch;
> > +	u32 hsync_len;
> > +
> > +	u32 vactive;
> > +	u32 vfront_porch;
> > +	u32 vback_porch;
> > +	u32 vsync_len;
> > +
> > +	u32 hah;		/* hsync active high */
> > +	u32 vah;		/* vsync active high */
> > +	u32 de;			/* data enable */
> > +	u32 pixelclk_pol;
> 
> What values will these 4 have? Aren't these booleans?
> 
> The data enable comment should be "data enable active high".
> 
> The next patch says in the devtree binding documentation that the values
> may be on/off/ignored. Is that represented here somehow, i.e. values are
> 0/1/2 or so? If not, what does it mean if the value is left out from
> devtree data, meaning "not used on hardware"?
>

Hm, I think you might be right here. It is no problem in the DT part of the code.
The properties are optional, left out means "not used on hardware".
But this does not propagate correctly to the videomode. I should set the fields
to -EINVAL in case they are omitted, than everything should work nicely.

> There's also a "doubleclk" value mentioned in the devtree bindings doc,
> but not shown here.
> 

Argh. That slipped through. I have patches that add this property to all
structs and the devicetree binding. But it is not supposed to be in this
series, because I want to at least have the binding stable for now.

> I think this videomode struct is the one that display drivers are going
> to use (?), in addition to the display_timing, so it would be good to
> document it well.
> 

Yes. Maybe I have to put more of the devicetree documentation in the code.

Regards,
Steffen


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

^ permalink raw reply

* Re: [PATCHv9 1/3] Runtime Interpreted Power Sequences
From: Grant Likely @ 2012-11-26 15:34 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121122214021.GA14771@avionic-0098.adnet.avionic-design.de>

On Thu, 22 Nov 2012 22:40:21 +0100, Thierry Reding <thierry.reding@avionic-design.de> wrote:
> On Thu, Nov 22, 2012 at 01:39:41PM +0000, Grant Likely wrote:
> [...]
> > I do think that each sequence should be contained within a single
> > property, but I'm open to other suggestions.
> 
> IIRC a very early prototype did implement something like that. However
> because of the resource issues this had to be string based, so that the
> sequences looked somewhat like (Alex, correct me if I'm wrong):
> 
> 	power-on = <"REGULATOR", "power", 1, "GPIO", "enable", 1>;
> 
> Instead we could possibly have something like:
> 
> 	power-on = <0 &reg 1,
> 		    1 &gpio 42 0 1>;

Yes, that would work, although I still think it would be a good idea to
split the used resources off into the gpios/pwms/regs/etc properties.

> Where the first cell in each entry defines the type (0 = regulator, 1 > GPIO) and the rest would be a regular OF specifier for the given type of
> resource along with some defined parameter such as enable/disable,
> voltage, delay in ms, ... I don't know if that sounds any better. It
> looks sort of cryptic but it is more "in the spirit of" DT, right Grant?

It is still kind of a ham-handed approach, but it does fit better with
existing conventions than the hierarchy of nodes does.

g.

^ permalink raw reply

* Re: [RFC v2 0/5] Common Display Framework
From: Alan Cox @ 2012-11-26 14:47 UTC (permalink / raw)
  To: Tomi Valkeinen
  Cc: Thierry Reding, Thomas Petazzoni, linux-fbdev, Benjamin Gaignard,
	Tom Gall, Kyungmin Park, dri-devel, Rob Clark,
	Ragesh Radhakrishnan, Laurent Pinchart, Philipp Zabel, Bryan Wu,
	Maxime Ripard, Vikas Sajjan, Sumit Semwal, Sebastien Guiriec,
	linux-media
In-Reply-To: <50B07427.1010605@ti.com>

On Sat, 24 Nov 2012 09:15:51 +0200
Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:

> On 2012-11-23 21:56, Thierry Reding wrote:
> > On Thu, Nov 22, 2012 at 10:45:31PM +0100, Laurent Pinchart wrote:
> > [...]
> >> Display entities are accessed by driver using notifiers. Any driver can
> >> register a display entity notifier with the CDF, which then calls the notifier
> >> when a matching display entity is registered.

The framebuffer layer has some similar 'anyone can' type notifier
behaviour and its not a good thing. That kind of "any one can" behaviour
leads to some really horrible messes unless the connections and the
locking are well defined IMHO.

Alan

^ permalink raw reply

* Re: [PATCHv15 3/7] video: add of helper for display timings/videomode
From: Tomi Valkeinen @ 2012-11-26 14:38 UTC (permalink / raw)
  To: Steffen Trumtrar
  Cc: linux-fbdev-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
	David Airlie, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	Florian Tobias Schandinat,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Laurent Pinchart,
	Philipp Zabel, Guennady Liakhovetski,
	linux-media-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1353920848-1705-4-git-send-email-s.trumtrar-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 5997 bytes --]

Hi,

On 2012-11-26 11:07, Steffen Trumtrar wrote:
> This adds support for reading display timings from DT into a struct
> display_timings. The of_display_timing implementation supports multiple
> subnodes. All children are read into an array, that can be queried.
> 
> If no native mode is specified, the first subnode will be used.
> 
> For cases where the graphics driver knows there can be only one
> mode description or where the driver only supports one mode, a helper
> function of_get_videomode is added, that gets a struct videomode from DT.
> 
> Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> Acked-by: Stephen Warren <swarren@nvidia.com>
> Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
> Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
> Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
> Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  .../devicetree/bindings/video/display-timing.txt   |  107 ++++++++++
>  drivers/video/Kconfig                              |   15 ++
>  drivers/video/Makefile                             |    2 +
>  drivers/video/of_display_timing.c                  |  219 ++++++++++++++++++++
>  drivers/video/of_videomode.c                       |   54 +++++
>  include/linux/of_display_timing.h                  |   20 ++
>  include/linux/of_videomode.h                       |   18 ++
>  7 files changed, 435 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/video/display-timing.txt
>  create mode 100644 drivers/video/of_display_timing.c
>  create mode 100644 drivers/video/of_videomode.c
>  create mode 100644 include/linux/of_display_timing.h
>  create mode 100644 include/linux/of_videomode.h
> 
> diff --git a/Documentation/devicetree/bindings/video/display-timing.txt b/Documentation/devicetree/bindings/video/display-timing.txt
> new file mode 100644
> index 0000000..e238f27
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/video/display-timing.txt
> @@ -0,0 +1,107 @@
> +display-timing bindings
> +=======================
> +
> +display-timings node
> +--------------------
> +
> +required properties:
> + - none
> +
> +optional properties:
> + - native-mode: The native mode for the display, in case multiple modes are
> +		provided. When omitted, assume the first node is the native.
> +
> +timing subnode
> +--------------
> +
> +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-frequency: display clock in Hz
> +
> +optional properties:
> + - hsync-active: hsync pulse is active low/high/ignored
> + - vsync-active: vsync pulse is active low/high/ignored
> + - de-active: data-enable pulse is active low/high/ignored
> + - pixelclk-inverted: pixelclock is inverted (active on falling edge)/
> +				non-inverted (active on rising edge)/
> +				     ignored (ignore property)

I think hsync-active and vsync-active are clear, and commonly used, and
they are used for both drm and fb mode conversions in later patches.

de-active is not used in drm and fb mode conversions, but I think it's
also clear.

pixelclk-inverted is not used in the mode conversions. It's also a bit
unclear to me. What does it mean that pix clock is "active on rising
edge"? The pixel data is driven on rising edge? How about the sync
signals and DE, when are they driven? Does your HW have any settings
related to those?

OMAP has the invert pclk setting, but it also has a setting to define
when the sync signals are driven. The options are:
- syncs are driven on rising edge of pclk
- syncs are driven on falling edge of pclk
- syncs are driven on the opposite edge of pclk compared to the pixel data

For DE there's no setting, except the active high/low.

And if I'm not mistaken, if the optional properties are not defined,
they are not ignored, but left to the default 0. Which means active low,
or active on rising edge(?). I think it would be good to have a
"undefined" value for the properties.

> + - interlaced (bool): boolean to enable interlaced mode
> + - doublescan (bool): boolean to enable doublescan mode
> + - doubleclk (bool)

As I mentioned in the other mail, doubleclk is not used nor documented here.

> +All the optional properties that are not bool follow the following logic:
> +    <1>: high active
> +    <0>: low active
> +    omitted: not used on hardware
> +
> +There are different ways of describing the capabilities of a display. The devicetree
> +representation corresponds to the one commonly found in datasheets for displays.
> +If a display supports multiple signal timings, the native-mode can be specified.

I have some of the same concerns for this series than with the
interpreted power sequences (on fbdev): when you publish the DT
bindings, it's somewhat final version then, and fixing it later will be
difficult. Of course, video modes are much clearer than the power
sequences, so it's possible there won't be any problems with the DT
bindings.

However, I'd still feel safer if the series would be split to non-DT and
DT parts. The non-DT parts could be merged quite easily, and people
could start using them in their kernels. This should expose
bugs/problems related to the code.

The DT part could be merged later, when there's confidence that the
timings are good for all platforms.

Or, alternatively, all the non-common bindings (de-active, pck
invert,...) that are not used for fbdev or drm currently could be left
out for now. But I'd stil prefer merging it in two parts.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply

* Re: [PATCHv15 2/7] video: add display_timing and videomode
From: Tomi Valkeinen @ 2012-11-26 12:37 UTC (permalink / raw)
  To: Steffen Trumtrar
  Cc: devicetree-discuss, Rob Herring, linux-fbdev, dri-devel,
	Laurent Pinchart, Thierry Reding, Guennady Liakhovetski,
	linux-media, Stephen Warren, kernel, Florian Tobias Schandinat,
	David Airlie
In-Reply-To: <1353920848-1705-3-git-send-email-s.trumtrar@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]

On 2012-11-26 11:07, Steffen Trumtrar wrote:

> +/*
> + * Subsystem independent description of a videomode.
> + * Can be generated from struct display_timing.
> + */
> +struct videomode {
> +	u32 pixelclock;		/* pixelclock in Hz */

I don't know if this is of any importance, but the linux clock framework
manages clock rates with unsigned long. Would it be better to use the
same type here?

> +	u32 hactive;
> +	u32 hfront_porch;
> +	u32 hback_porch;
> +	u32 hsync_len;
> +
> +	u32 vactive;
> +	u32 vfront_porch;
> +	u32 vback_porch;
> +	u32 vsync_len;
> +
> +	u32 hah;		/* hsync active high */
> +	u32 vah;		/* vsync active high */
> +	u32 de;			/* data enable */
> +	u32 pixelclk_pol;

What values will these 4 have? Aren't these booleans?

The data enable comment should be "data enable active high".

The next patch says in the devtree binding documentation that the values
may be on/off/ignored. Is that represented here somehow, i.e. values are
0/1/2 or so? If not, what does it mean if the value is left out from
devtree data, meaning "not used on hardware"?

There's also a "doubleclk" value mentioned in the devtree bindings doc,
but not shown here.

I think this videomode struct is the one that display drivers are going
to use (?), in addition to the display_timing, so it would be good to
document it well.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 899 bytes --]

^ permalink raw reply

* Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
From: Laurent Pinchart @ 2012-11-26 11:59 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Laurent Pinchart, jg1.han, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Paul Mundt, Magnus Damm,
	Richard Purdie, Kuninori Morimoto
In-Reply-To: <50B347F4.2080705@metafoo.de>

Hi Lars-Peter,

On Monday 26 November 2012 11:44:04 Lars-Peter Clausen wrote:
> On 11/26/2012 10:49 AM, Jingoo Han wrote:
> > On Saturday, November 24, 2012 1:35 AM, Laurent Pinchart wrote
> 
> [...]
> 
> >> +static int gpio_backlight_check_fb(struct backlight_device *bl,
> >> +				   struct fb_info *info)
> >> +{
> >> +	struct gpio_backlight *gbl = bl_get_data(bl);
> >> +
> >> +	return gbl->fbdev = info->dev;
> 
> I think it makes sense to return true if fbdev is NULL, to provide a simple
> fallback for systems with only one framebuffer device.

Agreed, I'll change that.

> >> +}
> >> +
> 
> [...]
> 
> >> +#ifdef CONFIG_PM
> >> +static int gpio_backlight_suspend(struct device *dev)
> >> +{
> >> +	struct backlight_device *bl = dev_get_drvdata(dev);
> >> +	struct gpio_backlight *gbl = bl_get_data(bl);
> >> +
> >> +	gpio_set_value(gbl->gpio, !gbl->active);
> >> +
> >> +	return 0;
> >> +}
> >> +
> >> +static int gpio_backlight_resume(struct device *dev)
> >> +{
> >> +	struct backlight_device *bl = dev_get_drvdata(dev);
> >> +
> >> +	backlight_update_status(bl);
> >> +	return 0;
> >> +}
> 
> If you use BL_CORE_SUSPENDRESUME you can get rid of the custom
> suspend/resume handlers.

Good point, I'll do that.

> >> +
> >> +static SIMPLE_DEV_PM_OPS(gpio_backlight_pm_ops, gpio_backlight_suspend,
> >> +			 gpio_backlight_resume);
> >> +
> >> +#endif
> >> +

-- 
Regards,

Laurent Pinchart


^ permalink raw reply

* Re: [PATCHv9 1/3] Runtime Interpreted Power Sequences
From: Alex Courbot @ 2012-11-26 11:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20121122214021.GA14771@avionic-0098.adnet.avionic-design.de>

On Friday 23 November 2012 05:40:21 Thierry Reding wrote:
> On Thu, Nov 22, 2012 at 01:39:41PM +0000, Grant Likely wrote:
> [...]
> 
> > I do think that each sequence should be contained within a single
> > property, but I'm open to other suggestions.
> 
> IIRC a very early prototype did implement something like that. However
> because of the resource issues this had to be string based, so that the
> sequences looked somewhat like (Alex, correct me if I'm wrong):
> 
> 	power-on = <"REGULATOR", "power", 1, "GPIO", "enable", 1>;

You're right. Back when the burning sun of July was beating down a little bit 
too hard on my head.

https://lkml.org/lkml/2012/7/9/30

> Instead we could possibly have something like:
> 
> 	power-on = <0 &reg 1,
> 		    1 &gpio 42 0 1>;
> 
> Where the first cell in each entry defines the type (0 = regulator, 1 > GPIO) and the rest would be a regular OF specifier for the given type of
> resource along with some defined parameter such as enable/disable,
> voltage, delay in ms, ... I don't know if that sounds any better. It
> looks sort of cryptic but it is more "in the spirit of" DT, right Grant?
> 
> Writing this down, it seems to me like even that proposal was already
> discussed at some point. Again, Alex may remember better.

The idea that we had was to use preprocessor support in DTC to use macros 
instead of strings for the step type. We also thought about using phandles 
directly in there as well, but this would require some more API support.

Anyway, at the current point we are not even sure whether we want or need 
power seqs in the DT - so let's keep this topic on hold for a while. We can 
still introduce the feature without DT support, and if it eventually turns out 
during this winter that expressing power seqs in the DT makes sense, we will 
have plenty of archives to read in front of the fire.

Alex.


^ permalink raw reply

* Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
From: Lars-Peter Clausen @ 2012-11-26 10:44 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: jg1.han, akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-fbdev@vger.kernel.org, Paul Mundt,
	Magnus Damm, Richard Purdie, Kuninori Morimoto
In-Reply-To: <32552643.33371353923376540.JavaMail.weblogic@epv6ml07>

On 11/26/2012 10:49 AM, Jingoo Han wrote:
> On Saturday, November 24, 2012 1:35 AM, Laurent Pinchart wrote
[...]
>> +static int gpio_backlight_check_fb(struct backlight_device *bl,
>> +				   struct fb_info *info)
>> +{
>> +	struct gpio_backlight *gbl = bl_get_data(bl);
>> +
>> +	return gbl->fbdev = info->dev;

I think it makes sense to return true if fbdev is NULL, to provide a simple
fallback for systems with only one framebuffer device.

>> +}
>> +
[...]
>> +#ifdef CONFIG_PM
>> +static int gpio_backlight_suspend(struct device *dev)
>> +{
>> +	struct backlight_device *bl = dev_get_drvdata(dev);
>> +	struct gpio_backlight *gbl = bl_get_data(bl);
>> +
>> +	gpio_set_value(gbl->gpio, !gbl->active);
>> +
>> +	return 0;
>> +}
>> +
>> +static int gpio_backlight_resume(struct device *dev)
>> +{
>> +	struct backlight_device *bl = dev_get_drvdata(dev);
>> +
>> +	backlight_update_status(bl);
>> +	return 0;
>> +}

If you use BL_CORE_SUSPENDRESUME you can get rid of the custom
suspend/resume handlers.

>> +
>> +static SIMPLE_DEV_PM_OPS(gpio_backlight_pm_ops, gpio_backlight_suspend,
>> +			 gpio_backlight_resume);
>> +
>> +#endif
>> +
[...]

^ permalink raw reply

* Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
From: Laurent Pinchart @ 2012-11-26 10:25 UTC (permalink / raw)
  To: jg1.han
  Cc: Laurent Pinchart, akpm@linux-foundation.org,
	linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Paul Mundt, Magnus Damm,
	Richard Purdie, Kuninori Morimoto
In-Reply-To: <32552643.33371353923376540.JavaMail.weblogic@epv6ml07>

Hi Jingoo,

On Monday 26 November 2012 09:49:36 Jingoo Han wrote:
> On Saturday, November 24, 2012 1:35 AM, Laurent Pinchart wrote
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> CC'ed Andrew Morton
> 
> It looks good. Also, I tested this patch with SMDK4210 board.
> Acked-by: Jingoo Han <jg1.han@samsung.com>

Thank you.

Unless Richard wants to take 1/5 and 2/5, I plan to push them through either 
the Renesas ARM or Renesas SH tree with the board code patches.

-- 
Regards,

Laurent Pinchart


^ permalink raw reply

* Re: [PATCH 1/5] backlight: Add GPIO-based backlight driver
From: Jingoo Han @ 2012-11-26  9:49 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-sh@vger.kernel.org, linux-fbdev@vger.kernel.org, Paul Mundt,
	Magnus Damm, Richard Purdie, Kuninori Morimoto, Jingoo Han
In-Reply-To: <1353688515-30458-2-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

T24gU2F0dXJkYXksIE5vdmVtYmVyIDI0LCAyMDEyIDE6MzUgQU0sIExhdXJlbnQgUGluY2hhcnQg
d3JvdGUNCj4gDQo+IFNpZ25lZC1vZmYtYnk6IExhdXJlbnQgUGluY2hhcnQgPGxhdXJlbnQucGlu
Y2hhcnRAaWRlYXNvbmJvYXJkLmNvbT4NCg0KQ0MnZWQgQW5kcmV3IE1vcnRvbg0KDQpJdCBsb29r
cyBnb29kLiBBbHNvLCBJIHRlc3RlZCB0aGlzIHBhdGNoIHdpdGggU01ESzQyMTAgYm9hcmQuDQpB
Y2tlZC1ieTogSmluZ29vIEhhbiA8amcxLmhhbkBzYW1zdW5nLmNvbT4NCg0KQmVzdCByZWdhcmRz
LA0KSmluZ29vIEhhbg0KDQo+IC0tLQ0KPiAgZHJpdmVycy92aWRlby9iYWNrbGlnaHQvS2NvbmZp
ZyAgICAgICAgICB8ICAgIDcgKysNCj4gIGRyaXZlcnMvdmlkZW8vYmFja2xpZ2h0L01ha2VmaWxl
ICAgICAgICAgfCAgICAxICsNCj4gIGRyaXZlcnMvdmlkZW8vYmFja2xpZ2h0L2dwaW9fYmFja2xp
Z2h0LmMgfCAgMTU4ICsrKysrKysrKysrKysrKysrKysrKysrKysrKysrKw0KPiAgaW5jbHVkZS92
aWRlby9ncGlvX2JhY2tsaWdodC5oICAgICAgICAgICB8ICAgMjEgKysrKw0KPiAgNCBmaWxlcyBj
aGFuZ2VkLCAxODcgaW5zZXJ0aW9ucygrKSwgMCBkZWxldGlvbnMoLSkNCj4gIGNyZWF0ZSBtb2Rl
IDEwMDY0NCBkcml2ZXJzL3ZpZGVvL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C9vciBtb2RpZnkNCj4gKyAqIGl0IHVuZGVyIHRoZSB0ZXJt
cyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgdmVyc2lvbiAyIGFzDQo+ICsgKiBw
dWJsaXNoZWQgYnkgdGhlIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbi4NCj4gKyAqLw0KPiArI2lm
bmRlZiBfX0dQSU9fQkFDS0xJR0hUX0hfXw0KPiArI2RlZmluZSBfX0dQSU9fQkFDS0xJR0hUX0hf
Xw0KPiArDQo+ICtzdHJ1Y3QgZGV2aWNlOw0KPiArDQo+ICtzdHJ1Y3QgZ3Bpb19iYWNrbGlnaHRf
cGxhdGZvcm1fZGF0YSB7DQo+ICsJc3RydWN0IGRldmljZSAqZmJkZXY7DQo+ICsJaW50IGdwaW87
DQo+ICsJaW50IGRlZl92YWx1ZTsNCj4gKwlib29sIGFjdGl2ZV9sb3c7DQo+ICsJY29uc3QgY2hh
ciAqbmFtZTsNCj4gK307DQo+ICsNCj4gKyNlbmRpZg0KPiAtLQ0KPiAxLjcuOC42DQo+IA0KPiAt
LQ0KPiBUbyB1bnN1YnNjcmliZSBmcm9tIHRoaXMgbGlzdDogc2VuZCB0aGUgbGluZSAidW5zdWJz
Y3JpYmUgbGludXgtZmJkZXYiIGluDQo+IHRoZSBib2R5IG9mIGEgbWVzc2FnZSB0byBtYWpvcmRv
bW9Admdlci5rZXJuZWwub3JnDQo+IE1vcmUgbWFqb3Jkb21vIGluZm8gYXQgIGh0dHA6Ly92Z2Vy
Lmtlcm5lbC5vcmcvbWFqb3Jkb21vLWluZm8uaHRtbA0K



^ permalink raw reply

* Re: [PATCH 2/5] backlight: Add Sanyo LV5207LP backlight driver
From: Jingoo Han @ 2012-11-26  9:48 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: akpm, linux-kernel, linux-sh@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Paul Mundt, Magnus Damm,
	Richard Purdie, Kuninori Morimoto, J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JdW5zaWduZWQgaW50IG1heF92YWx1ZTsNCj4gKwl1bnNpZ25lZCBp
bnQgZGVmX3ZhbHVlOw0KPiArfTsNCj4gKw0KPiArI2VuZGlmDQo+ICsNCj4gLS0NCj4gMS43Ljgu
Ng0KPiANCj4gLS0NCj4gVG8gdW5zdWJzY3JpYmUgZnJvbSB0aGlzIGxpc3Q6IHNlbmQgdGhlIGxp
bmUgInVuc3Vic2NyaWJlIGxpbnV4LWZiZGV2IiBpbg0KPiB0aGUgYm9keSBvZiBhIG1lc3NhZ2Ug
dG8gbWFqb3Jkb21vQHZnZXIua2VybmVsLm9yZw0KPiBNb3JlIG1ham9yZG9tbyBpbmZvIGF0ICBo
dHRwOi8vdmdlci5rZXJuZWwub3JnL21ham9yZG9tby1pbmZvLmh0bWwNCg=



^ permalink raw reply

* Re: [PATCH 2/5] backlight: Add Sanyo LV5207LP backlight driver
From: Jingoo Han @ 2012-11-26  9:38 UTC (permalink / raw)
  To: 'Laurent Pinchart'
  Cc: 'Andrew Morton', 'LKML', linux-sh, linux-fbdev,
	'Paul Mundt', 'Magnus Damm',
	'Richard Purdie', 'Kuninori Morimoto',
	'Jingoo Han'
In-Reply-To: <1353688515-30458-3-git-send-email-laurent.pinchart+renesas@ideasonboard.com>

On Saturday, November 24, 2012 1:35 AM, Laurent Pinchart wrote
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


CC'ed Andrew Morton


Acked-by: Jingoo Han <jg1.han@samsung.com>


Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/Kconfig        |    6 +
>  drivers/video/backlight/Makefile       |    1 +
>  drivers/video/backlight/lv5207lp.c     |  171 ++++++++++++++++++++++++++++++++
>  include/linux/platform_data/lv5207lp.h |   20 ++++
>  4 files changed, 198 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/video/backlight/lv5207lp.c
>  create mode 100644 include/linux/platform_data/lv5207lp.h
> 
> diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
> index 259442d..92ce5aa 100644
> --- a/drivers/video/backlight/Kconfig
> +++ b/drivers/video/backlight/Kconfig
> @@ -397,6 +397,12 @@ config BACKLIGHT_GPIO
>  	  If you have a LCD backlight adjustable by GPIO, say Y to enable
>  	  this driver.
> 
> +config BACKLIGHT_LV5207LP
> +	tristate "Sanyo LV5207LP Backlight"
> +	depends on I2C
> +	help
> +	  If you have a Sanyo LV5207LP say Y to enable the backlight driver.
> +
>  endif # BACKLIGHT_CLASS_DEVICE
> 
>  endif # BACKLIGHT_LCD_SUPPORT
> diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
> index ec91c4a..125b8ad 100644
> --- a/drivers/video/backlight/Makefile
> +++ b/drivers/video/backlight/Makefile
> @@ -46,3 +46,4 @@ obj-$(CONFIG_BACKLIGHT_AAT2870) += aat2870_bl.o
>  obj-$(CONFIG_BACKLIGHT_OT200) += ot200_bl.o
>  obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
>  obj-$(CONFIG_BACKLIGHT_GPIO)	+= gpio_backlight.o
> +obj-$(CONFIG_BACKLIGHT_LV5207LP)	+= lv5207lp.o
> diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c
> new file mode 100644
> index 0000000..b06f35c
> --- /dev/null
> +++ b/drivers/video/backlight/lv5207lp.c
> @@ -0,0 +1,171 @@
> +/*
> + * Sanyo LV5207LP LED Driver
> + *
> + * Copyright (C) 2012 Ideas on board SPRL
> + *
> + * Contact: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/backlight.h>
> +#include <linux/err.h>
> +#include <linux/fb.h>
> +#include <linux/i2c.h>
> +#include <linux/module.h>
> +#include <linux/slab.h>
> +#include <linux/platform_data/lv5207lp.h>
> +
> +#define LV5207LP_CTRL1			0x00
> +#define LV5207LP_CPSW			(1 << 7)
> +#define LV5207LP_SCTEN			(1 << 6)
> +#define LV5207LP_C10			(1 << 5)
> +#define LV5207LP_CKSW			(1 << 4)
> +#define LV5207LP_RSW			(1 << 3)
> +#define LV5207LP_GSW			(1 << 2)
> +#define LV5207LP_BSW			(1 << 1)
> +#define LV5207LP_CTRL2			0x01
> +#define LV5207LP_MSW			(1 << 7)
> +#define LV5207LP_MLED4			(1 << 6)
> +#define LV5207LP_RED			0x02
> +#define LV5207LP_GREEN			0x03
> +#define LV5207LP_BLUE			0x04
> +
> +#define LV5207LP_MAX_BRIGHTNESS		32
> +
> +struct lv5207lp {
> +	struct i2c_client *client;
> +	struct backlight_device *backlight;
> +	struct lv5207lp_platform_data *pdata;
> +};
> +
> +static int lv5207lp_write(struct lv5207lp *lv, u8 reg, u8 data)
> +{
> +	return i2c_smbus_write_byte_data(lv->client, reg, data);
> +}
> +
> +static int lv5207lp_backlight_update_status(struct backlight_device *backlight)
> +{
> +	struct lv5207lp *lv = bl_get_data(backlight);
> +	int brightness = backlight->props.brightness;
> +
> +	if (backlight->props.power != FB_BLANK_UNBLANK ||
> +	    backlight->props.fb_blank != FB_BLANK_UNBLANK ||
> +	    backlight->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
> +		brightness = 0;
> +
> +	if (brightness) {
> +		lv5207lp_write(lv, LV5207LP_CTRL1,
> +			       LV5207LP_CPSW | LV5207LP_C10 | LV5207LP_CKSW);
> +		lv5207lp_write(lv, LV5207LP_CTRL2,
> +			       LV5207LP_MSW | LV5207LP_MLED4 |
> +			       (brightness - 1));
> +	} else {
> +		lv5207lp_write(lv, LV5207LP_CTRL1, 0);
> +		lv5207lp_write(lv, LV5207LP_CTRL2, 0);
> +	}
> +
> +	return 0;
> +}
> +
> +static int lv5207lp_backlight_get_brightness(struct backlight_device *backlight)
> +{
> +	return backlight->props.brightness;
> +}
> +
> +static int lv5207lp_backlight_check_fb(struct backlight_device *backlight,
> +				       struct fb_info *info)
> +{
> +	struct lv5207lp *lv = bl_get_data(backlight);
> +
> +	return lv->pdata->fbdev = info->dev;
> +}
> +
> +static const struct backlight_ops lv5207lp_backlight_ops = {
> +	.options	= BL_CORE_SUSPENDRESUME,
> +	.update_status	= lv5207lp_backlight_update_status,
> +	.get_brightness	= lv5207lp_backlight_get_brightness,
> +	.check_fb	= lv5207lp_backlight_check_fb,
> +};
> +
> +static int lv5207lp_probe(struct i2c_client *client,
> +			  const struct i2c_device_id *id)
> +{
> +	struct lv5207lp_platform_data *pdata = client->dev.platform_data;
> +	struct backlight_device *backlight;
> +	struct backlight_properties props;
> +	struct lv5207lp *lv;
> +
> +	if (pdata = NULL) {
> +		dev_err(&client->dev, "No platform data supplied\n");
> +		return -EINVAL;
> +	}
> +
> +	if (!i2c_check_functionality(client->adapter,
> +				     I2C_FUNC_SMBUS_BYTE_DATA)) {
> +		dev_warn(&client->dev,
> +			 "I2C adapter doesn't support I2C_FUNC_SMBUS_BYTE\n");
> +		return -EIO;
> +	}
> +
> +	lv = devm_kzalloc(&client->dev, sizeof(*lv), GFP_KERNEL);
> +	if (!lv)
> +		return -ENOMEM;
> +
> +	lv->client = client;
> +	lv->pdata = pdata;
> +
> +	memset(&props, 0, sizeof(props));
> +	props.type = BACKLIGHT_RAW;
> +	props.max_brightness = min_t(unsigned int, pdata->max_value,
> +				     LV5207LP_MAX_BRIGHTNESS);
> +	props.brightness = clamp_t(unsigned int, pdata->def_value, 0,
> +				   props.max_brightness);
> +
> +	backlight = backlight_device_register(dev_name(&client->dev),
> +					      &lv->client->dev, lv,
> +					      &lv5207lp_backlight_ops, &props);
> +	if (IS_ERR(backlight)) {
> +		dev_err(&client->dev, "failed to register backlight\n");
> +		return PTR_ERR(backlight);
> +	}
> +
> +	backlight_update_status(backlight);
> +	i2c_set_clientdata(client, backlight);
> +
> +	return 0;
> +}
> +
> +static int lv5207lp_remove(struct i2c_client *client)
> +{
> +	struct backlight_device *backlight = i2c_get_clientdata(client);
> +
> +	backlight->props.brightness = 0;
> +	backlight_update_status(backlight);
> +	backlight_device_unregister(backlight);
> +
> +	return 0;
> +}
> +
> +static const struct i2c_device_id lv5207lp_ids[] = {
> +	{ "lv5207lp", 0 },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(i2c, lv5207lp_ids);
> +
> +static struct i2c_driver lv5207lp_driver = {
> +	.driver = {
> +		.name = "lv5207lp",
> +	},
> +	.probe = lv5207lp_probe,
> +	.remove = lv5207lp_remove,
> +	.id_table = lv5207lp_ids,
> +};
> +
> +module_i2c_driver(lv5207lp_driver);
> +
> +MODULE_DESCRIPTION("Sanyo LV5207LP Backlight Driver");
> +MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
> +MODULE_LICENSE("GPL");
> diff --git a/include/linux/platform_data/lv5207lp.h b/include/linux/platform_data/lv5207lp.h
> new file mode 100644
> index 0000000..ac95cb1
> --- /dev/null
> +++ b/include/linux/platform_data/lv5207lp.h
> @@ -0,0 +1,20 @@
> +/*
> + * lv5207lp.h - Sanyo LV5207LP LEDs Driver
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +#ifndef __LV5207LP_H__
> +#define __LV5207LP_H__
> +
> +struct device;
> +
> +struct lv5207lp_platform_data {
> +	struct device *fbdev;
> +	unsigned int max_value;
> +	unsigned int def_value;
> +};
> +
> +#endif
> +
> --
> 1.7.8.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply

* [PATCHv15 7/7] drm_modes: add of_videomode helpers
From: Steffen Trumtrar @ 2012-11-26  9:07 UTC (permalink / raw)
  To: devicetree-discuss
  Cc: Steffen Trumtrar, Rob Herring, linux-fbdev, dri-devel,
	Laurent Pinchart, Thierry Reding, Guennady Liakhovetski,
	linux-media, Tomi Valkeinen, Stephen Warren, kernel,
	Florian Tobias Schandinat, David Airlie
In-Reply-To: <1353920848-1705-1-git-send-email-s.trumtrar@pengutronix.de>

Add helper to get drm_display_mode from devicetree.

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/drm_modes.c |   33 +++++++++++++++++++++++++++++++++
 include/drm/drmP.h          |    6 ++++++
 2 files changed, 39 insertions(+)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 8263ea1..3568f0a 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -33,6 +33,7 @@
 #include <linux/list.h>
 #include <linux/list_sort.h>
 #include <linux/export.h>
+#include <linux/of_videomode.h>
 #include <linux/videomode.h>
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
@@ -541,6 +542,38 @@ int drm_display_mode_from_videomode(const struct videomode *vm,
 EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode);
 #endif
 
+#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
+/**
+ * of_get_drm_display_mode - get a drm_display_mode from devicetree
+ * @np: device_node with the timing specification
+ * @dmode: will be set to the return value
+ * @index: index into the list of display timings in devicetree
+ *
+ * This function is expensive and should only be used, if only one mode is to be
+ * read from DT. To get multiple modes start with of_get_display_timings and
+ * work with that instead.
+ */
+int of_get_drm_display_mode(struct device_node *np,
+			    struct drm_display_mode *dmode, int index)
+{
+	struct videomode vm;
+	int ret;
+
+	ret = of_get_videomode(np, &vm, index);
+	if (ret)
+		return ret;
+
+	drm_display_mode_from_videomode(&vm, dmode);
+
+	pr_info("%s: got %dx%d display mode from %s\n", __func__, vm.hactive,
+		vm.vactive, np->name);
+	drm_mode_debug_printmodeline(dmode);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
+#endif
+
 /**
  * drm_mode_set_name - set the name on a mode
  * @mode: name will be set in this mode
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2194e97..1784e55 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -85,6 +85,7 @@ struct module;
 struct drm_file;
 struct drm_device;
 
+struct device_node;
 struct videomode;
 
 #include <drm/drm_os_linux.h>
@@ -1460,6 +1461,11 @@ drm_mode_create_from_cmdline_mode(struct drm_device *dev,
 extern int drm_display_mode_from_videomode(const struct videomode *vm,
 					   struct drm_display_mode *dmode);
 #endif
+#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
+extern int of_get_drm_display_mode(struct device_node *np,
+				   struct drm_display_mode *dmode,
+				   int index);
+#endif
 
 /* Modesetting support */
 extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
-- 
1.7.10.4


^ permalink raw reply related

* [PATCHv15 6/7] drm_modes: add videomode helpers
From: Steffen Trumtrar @ 2012-11-26  9:07 UTC (permalink / raw)
  To: devicetree-discuss
  Cc: Steffen Trumtrar, Rob Herring, linux-fbdev, dri-devel,
	Laurent Pinchart, Thierry Reding, Guennady Liakhovetski,
	linux-media, Tomi Valkeinen, Stephen Warren, kernel,
	Florian Tobias Schandinat, David Airlie
In-Reply-To: <1353920848-1705-1-git-send-email-s.trumtrar@pengutronix.de>

Add conversion from videomode to drm_display_mode

Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Reviewed-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Thierry Reding <thierry.reding@avionic-design.de>
Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
---
 drivers/gpu/drm/drm_modes.c |   37 +++++++++++++++++++++++++++++++++++++
 include/drm/drmP.h          |    7 +++++++
 2 files changed, 44 insertions(+)

diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index 59450f3..8263ea1 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -33,6 +33,7 @@
 #include <linux/list.h>
 #include <linux/list_sort.h>
 #include <linux/export.h>
+#include <linux/videomode.h>
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 
@@ -504,6 +505,42 @@ drm_gtf_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh,
 }
 EXPORT_SYMBOL(drm_gtf_mode);
 
+#if IS_ENABLED(CONFIG_VIDEOMODE)
+int drm_display_mode_from_videomode(const struct videomode *vm,
+				    struct drm_display_mode *dmode)
+{
+	dmode->hdisplay = vm->hactive;
+	dmode->hsync_start = dmode->hdisplay + vm->hfront_porch;
+	dmode->hsync_end = dmode->hsync_start + vm->hsync_len;
+	dmode->htotal = dmode->hsync_end + vm->hback_porch;
+
+	dmode->vdisplay = vm->vactive;
+	dmode->vsync_start = dmode->vdisplay + vm->vfront_porch;
+	dmode->vsync_end = dmode->vsync_start + vm->vsync_len;
+	dmode->vtotal = dmode->vsync_end + vm->vback_porch;
+
+	dmode->clock = vm->pixelclock / 1000;
+
+	dmode->flags = 0;
+	if (vm->hah)
+		dmode->flags |= DRM_MODE_FLAG_PHSYNC;
+	else
+		dmode->flags |= DRM_MODE_FLAG_NHSYNC;
+	if (vm->vah)
+		dmode->flags |= DRM_MODE_FLAG_PVSYNC;
+	else
+		dmode->flags |= DRM_MODE_FLAG_NVSYNC;
+	if (vm->interlaced)
+		dmode->flags |= DRM_MODE_FLAG_INTERLACE;
+	if (vm->doublescan)
+		dmode->flags |= DRM_MODE_FLAG_DBLSCAN;
+	drm_mode_set_name(dmode);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode);
+#endif
+
 /**
  * drm_mode_set_name - set the name on a mode
  * @mode: name will be set in this mode
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 3fd8280..2194e97 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -85,6 +85,8 @@ struct module;
 struct drm_file;
 struct drm_device;
 
+struct videomode;
+
 #include <drm/drm_os_linux.h>
 #include <drm/drm_hashtab.h>
 #include <drm/drm_mm.h>
@@ -1454,6 +1456,11 @@ extern struct drm_display_mode *
 drm_mode_create_from_cmdline_mode(struct drm_device *dev,
 				  struct drm_cmdline_mode *cmd);
 
+#if IS_ENABLED(CONFIG_VIDEOMODE)
+extern int drm_display_mode_from_videomode(const struct videomode *vm,
+					   struct drm_display_mode *dmode);
+#endif
+
 /* Modesetting support */
 extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
 extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
-- 
1.7.10.4


^ permalink raw reply related


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