2015-04-30 14:39:36

by Boris Brezillon

[permalink] [raw]
Subject: [PATCH] drm: panel: simple-panel: set appropriate mode type

All modes exposed by simple panels should be tagged as driver defined
modes.
Moreover, if a panel supports only one mode, this mode is obviously the
preferred one.

Doing this also fix a problem occurring when a 'video=' parameter is passed
on the kernel cmdline. In some cases the user provided mode is preferred
over the simple panel ones, which might result in unpredictable behavior.

Signed-off-by: Boris Brezillon <[email protected]>
---
drivers/gpu/drm/panel/panel-simple.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index d14b904..95ae390 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -111,6 +111,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
continue;
}

+ mode->type |= DRM_MODE_TYPE_DRIVER;
+ if (panel->desc->num_modes == 1)
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
+
drm_display_mode_from_videomode(&vm, mode);

drm_mode_probed_add(connector, mode);
@@ -127,6 +131,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
continue;
}

+ mode->type |= DRM_MODE_TYPE_DRIVER;
+ if (panel->desc->num_modes == 1)
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
+
drm_mode_set_name(mode);

drm_mode_probed_add(connector, mode);
--
1.9.1


2015-04-30 14:47:53

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH] drm: panel: simple-panel: set appropriate mode type

Le 30/04/2015 16:39, Boris Brezillon a ?crit :
> All modes exposed by simple panels should be tagged as driver defined
> modes.
> Moreover, if a panel supports only one mode, this mode is obviously the
> preferred one.
>
> Doing this also fix a problem occurring when a 'video=' parameter is passed
> on the kernel cmdline. In some cases the user provided mode is preferred
> over the simple panel ones, which might result in unpredictable behavior.
>
> Signed-off-by: Boris Brezillon <[email protected]>

Tested-by: Nicolas Ferre <[email protected]>
On Atmel sama5d3xek board.

> ---
> drivers/gpu/drm/panel/panel-simple.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index d14b904..95ae390 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -111,6 +111,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
> continue;
> }
>
> + mode->type |= DRM_MODE_TYPE_DRIVER;
> + if (panel->desc->num_modes == 1)
> + mode->type |= DRM_MODE_TYPE_PREFERRED;
> +
> drm_display_mode_from_videomode(&vm, mode);
>
> drm_mode_probed_add(connector, mode);
> @@ -127,6 +131,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
> continue;
> }
>
> + mode->type |= DRM_MODE_TYPE_DRIVER;
> + if (panel->desc->num_modes == 1)
> + mode->type |= DRM_MODE_TYPE_PREFERRED;
> +
> drm_mode_set_name(mode);
>
> drm_mode_probed_add(connector, mode);
>


--
Nicolas Ferre

2016-04-15 16:04:24

by Nicolas Ferre

[permalink] [raw]
Subject: Re: [PATCH] drm: panel: simple-panel: set appropriate mode type

Le 28/05/2015 16:25, Boris Brezillon a ?crit :
> Hi Thierry,
>
> Could you have a look at this patch (a.k.a. ping) ?

It's been a long time and... It seems that this patch doesn't apply
anymore but:

Reviewed-by: Nicolas Ferre <[email protected]>

So, I'm updating it and resending right now.

Bye,

> On Thu, 30 Apr 2015 16:39:30 +0200
> Boris Brezillon <[email protected]> wrote:
>
>> All modes exposed by simple panels should be tagged as driver defined
>> modes.
>> Moreover, if a panel supports only one mode, this mode is obviously the
>> preferred one.
>>
>> Doing this also fix a problem occurring when a 'video=' parameter is passed
>> on the kernel cmdline. In some cases the user provided mode is preferred
>> over the simple panel ones, which might result in unpredictable behavior.
>>
>> Signed-off-by: Boris Brezillon <[email protected]>
>> ---
>> drivers/gpu/drm/panel/panel-simple.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
>> index d14b904..95ae390 100644
>> --- a/drivers/gpu/drm/panel/panel-simple.c
>> +++ b/drivers/gpu/drm/panel/panel-simple.c
>> @@ -111,6 +111,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
>> continue;
>> }
>>
>> + mode->type |= DRM_MODE_TYPE_DRIVER;
>> + if (panel->desc->num_modes == 1)
>> + mode->type |= DRM_MODE_TYPE_PREFERRED;
>> +
>> drm_display_mode_from_videomode(&vm, mode);
>>
>> drm_mode_probed_add(connector, mode);
>> @@ -127,6 +131,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
>> continue;
>> }
>>
>> + mode->type |= DRM_MODE_TYPE_DRIVER;
>> + if (panel->desc->num_modes == 1)
>> + mode->type |= DRM_MODE_TYPE_PREFERRED;
>> +
>> drm_mode_set_name(mode);
>>
>> drm_mode_probed_add(connector, mode);
>
>
>


--
Nicolas Ferre

2016-04-15 16:23:04

by Nicolas Ferre

[permalink] [raw]
Subject: [RESEND PATCH] drm/panel: simple-panel: set appropriate mode type

From: Boris Brezillon <[email protected]>

All modes exposed by simple panels should be tagged as driver defined
modes.
Moreover, if a panel supports only one mode, this mode is obviously the
preferred one.

Doing this also fix a problem occurring when a 'video=' parameter is passed
on the kernel cmdline. In some cases the user provided mode is preferred
over the simple panel ones, which might result in unpredictable behavior.

Signed-off-by: Boris Brezillon <[email protected]>
Reviewed-by: Nicolas Ferre <[email protected]>
Tested-by: Nicolas Ferre <[email protected]>
---
drivers/gpu/drm/panel/panel-simple.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index ceb20486dacf..45b924ebed57 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -115,6 +115,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
continue;
}

+ mode->type |= DRM_MODE_TYPE_DRIVER;
+ if (panel->desc->num_modes == 1)
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
+
drm_display_mode_from_videomode(&vm, mode);
drm_mode_set_name(mode);

@@ -132,6 +136,10 @@ static int panel_simple_get_fixed_modes(struct panel_simple *panel)
continue;
}

+ mode->type |= DRM_MODE_TYPE_DRIVER;
+ if (panel->desc->num_modes == 1)
+ mode->type |= DRM_MODE_TYPE_PREFERRED;
+
drm_mode_set_name(mode);

drm_mode_probed_add(connector, mode);
--
2.1.3

2016-04-18 07:05:34

by Thierry Reding

[permalink] [raw]
Subject: Re: [RESEND PATCH] drm/panel: simple-panel: set appropriate mode type

On Fri, Apr 15, 2016 at 06:23:33PM +0200, Nicolas Ferre wrote:
> From: Boris Brezillon <[email protected]>
>
> All modes exposed by simple panels should be tagged as driver defined
> modes.
> Moreover, if a panel supports only one mode, this mode is obviously the
> preferred one.
>
> Doing this also fix a problem occurring when a 'video=' parameter is passed
> on the kernel cmdline. In some cases the user provided mode is preferred
> over the simple panel ones, which might result in unpredictable behavior.
>
> Signed-off-by: Boris Brezillon <[email protected]>
> Reviewed-by: Nicolas Ferre <[email protected]>
> Tested-by: Nicolas Ferre <[email protected]>
> ---
> drivers/gpu/drm/panel/panel-simple.c | 8 ++++++++
> 1 file changed, 8 insertions(+)

Applied, thanks.

Thierry


Attachments:
(No filename) (833.00 B)
signature.asc (819.00 B)
Download all attachments