All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	od@zcrc.me, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/panel: NT39016: Add support for multiple modes
Date: Wed, 8 Apr 2020 12:27:53 +0200	[thread overview]
Message-ID: <20200408102753.GA25805@ravnborg.org> (raw)
In-Reply-To: <QCSG8Q.N40UK3F20OVT2@crapouillou.net>

On Wed, Apr 08, 2020 at 12:12:26PM +0200, Paul Cercueil wrote:
> Hi Sam,
> 
> 
> Le mer. 8 avril 2020 à 12:04, Sam Ravnborg <sam@ravnborg.org> a écrit :
> > Hi Paul.
> > 
> > On Wed, Apr 08, 2020 at 11:58:29AM +0200, Paul Cercueil wrote:
> > >  Add support for multiple drm_display_mode entries. This will allow
> > > to
> > >  add a 50 Hz mode later.
> > > 
> > >  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > Patch looks good.
> > 
> > Could we please use lower case in the $subject?
> 
> You mean 's/Add/add/' or the panel name as well?

The panel name. We are not consistent if we start sentences in $subject
with lower or upper case - so Add and add are both fine.
But the panel name is (almost) always with lower case.

	Sam
> 
> -Paul
> 
> > Acked-by: Sam Ravnborg <sam@ravnborg.org>
> > 
> > I asume you will apply yourself.
> > 
> > 	Sam
> > 
> > >  ---
> > >   drivers/gpu/drm/panel/panel-novatek-nt39016.c | 33
> > > +++++++++++++------
> > >   1 file changed, 23 insertions(+), 10 deletions(-)
> > > 
> > >  diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > > b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > >  index a470810f7dbe..f1286cf6528b 100644
> > >  --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > >  +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > >  @@ -49,7 +49,8 @@ enum nt39016_regs {
> > >   #define NT39016_SYSTEM_STANDBY	BIT(1)
> > > 
> > >   struct nt39016_panel_info {
> > >  -	struct drm_display_mode display_mode;
> > >  +	const struct drm_display_mode *display_modes;
> > >  +	unsigned int num_modes;
> > >   	u16 width_mm, height_mm;
> > >   	u32 bus_format, bus_flags;
> > >   };
> > >  @@ -212,15 +213,22 @@ static int nt39016_get_modes(struct drm_panel
> > > *drm_panel,
> > >   	struct nt39016 *panel = to_nt39016(drm_panel);
> > >   	const struct nt39016_panel_info *panel_info = panel->panel_info;
> > >   	struct drm_display_mode *mode;
> > >  +	unsigned int i;
> > > 
> > >  -	mode = drm_mode_duplicate(connector->dev,
> > > &panel_info->display_mode);
> > >  -	if (!mode)
> > >  -		return -ENOMEM;
> > >  +	for (i = 0; i < panel_info->num_modes; i++) {
> > >  +		mode = drm_mode_duplicate(connector->dev,
> > >  +					  &panel_info->display_modes[i]);
> > >  +		if (!mode)
> > >  +			return -ENOMEM;
> > >  +
> > >  +		drm_mode_set_name(mode);
> > > 
> > >  -	drm_mode_set_name(mode);
> > >  +		mode->type = DRM_MODE_TYPE_DRIVER;
> > >  +		if (panel_info->num_modes == 1)
> > >  +			mode->type |= DRM_MODE_TYPE_PREFERRED;
> > > 
> > >  -	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> > >  -	drm_mode_probed_add(connector, mode);
> > >  +		drm_mode_probed_add(connector, mode);
> > >  +	}
> > > 
> > >   	connector->display_info.bpc = 8;
> > >   	connector->display_info.width_mm = panel_info->width_mm;
> > >  @@ -230,7 +238,7 @@ static int nt39016_get_modes(struct drm_panel
> > > *drm_panel,
> > >   					 &panel_info->bus_format, 1);
> > >   	connector->display_info.bus_flags = panel_info->bus_flags;
> > > 
> > >  -	return 1;
> > >  +	return panel_info->num_modes;
> > >   }
> > > 
> > >   static const struct drm_panel_funcs nt39016_funcs = {
> > >  @@ -316,8 +324,8 @@ static int nt39016_remove(struct spi_device
> > > *spi)
> > >   	return 0;
> > >   }
> > > 
> > >  -static const struct nt39016_panel_info kd035g6_info = {
> > >  -	.display_mode = {
> > >  +static const struct drm_display_mode kd035g6_display_modes[] = {
> > >  +	{
> > >   		.clock = 6000,
> > >   		.hdisplay = 320,
> > >   		.hsync_start = 320 + 10,
> > >  @@ -330,6 +338,11 @@ static const struct nt39016_panel_info
> > > kd035g6_info = {
> > >   		.vrefresh = 60,
> > >   		.flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
> > >   	},
> > >  +};
> > >  +
> > >  +static const struct nt39016_panel_info kd035g6_info = {
> > >  +	.display_modes = kd035g6_display_modes,
> > >  +	.num_modes = ARRAY_SIZE(kd035g6_display_modes),
> > >   	.width_mm = 71,
> > >   	.height_mm = 53,
> > >   	.bus_format = MEDIA_BUS_FMT_RGB888_1X24,
> > >  --
> > >  2.25.1
> 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Paul Cercueil <paul@crapouillou.net>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	od@zcrc.me, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/panel: NT39016: Add support for multiple modes
Date: Wed, 8 Apr 2020 12:27:53 +0200	[thread overview]
Message-ID: <20200408102753.GA25805@ravnborg.org> (raw)
In-Reply-To: <QCSG8Q.N40UK3F20OVT2@crapouillou.net>

On Wed, Apr 08, 2020 at 12:12:26PM +0200, Paul Cercueil wrote:
> Hi Sam,
> 
> 
> Le mer. 8 avril 2020 à 12:04, Sam Ravnborg <sam@ravnborg.org> a écrit :
> > Hi Paul.
> > 
> > On Wed, Apr 08, 2020 at 11:58:29AM +0200, Paul Cercueil wrote:
> > >  Add support for multiple drm_display_mode entries. This will allow
> > > to
> > >  add a 50 Hz mode later.
> > > 
> > >  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > Patch looks good.
> > 
> > Could we please use lower case in the $subject?
> 
> You mean 's/Add/add/' or the panel name as well?

The panel name. We are not consistent if we start sentences in $subject
with lower or upper case - so Add and add are both fine.
But the panel name is (almost) always with lower case.

	Sam
> 
> -Paul
> 
> > Acked-by: Sam Ravnborg <sam@ravnborg.org>
> > 
> > I asume you will apply yourself.
> > 
> > 	Sam
> > 
> > >  ---
> > >   drivers/gpu/drm/panel/panel-novatek-nt39016.c | 33
> > > +++++++++++++------
> > >   1 file changed, 23 insertions(+), 10 deletions(-)
> > > 
> > >  diff --git a/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > > b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > >  index a470810f7dbe..f1286cf6528b 100644
> > >  --- a/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > >  +++ b/drivers/gpu/drm/panel/panel-novatek-nt39016.c
> > >  @@ -49,7 +49,8 @@ enum nt39016_regs {
> > >   #define NT39016_SYSTEM_STANDBY	BIT(1)
> > > 
> > >   struct nt39016_panel_info {
> > >  -	struct drm_display_mode display_mode;
> > >  +	const struct drm_display_mode *display_modes;
> > >  +	unsigned int num_modes;
> > >   	u16 width_mm, height_mm;
> > >   	u32 bus_format, bus_flags;
> > >   };
> > >  @@ -212,15 +213,22 @@ static int nt39016_get_modes(struct drm_panel
> > > *drm_panel,
> > >   	struct nt39016 *panel = to_nt39016(drm_panel);
> > >   	const struct nt39016_panel_info *panel_info = panel->panel_info;
> > >   	struct drm_display_mode *mode;
> > >  +	unsigned int i;
> > > 
> > >  -	mode = drm_mode_duplicate(connector->dev,
> > > &panel_info->display_mode);
> > >  -	if (!mode)
> > >  -		return -ENOMEM;
> > >  +	for (i = 0; i < panel_info->num_modes; i++) {
> > >  +		mode = drm_mode_duplicate(connector->dev,
> > >  +					  &panel_info->display_modes[i]);
> > >  +		if (!mode)
> > >  +			return -ENOMEM;
> > >  +
> > >  +		drm_mode_set_name(mode);
> > > 
> > >  -	drm_mode_set_name(mode);
> > >  +		mode->type = DRM_MODE_TYPE_DRIVER;
> > >  +		if (panel_info->num_modes == 1)
> > >  +			mode->type |= DRM_MODE_TYPE_PREFERRED;
> > > 
> > >  -	mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> > >  -	drm_mode_probed_add(connector, mode);
> > >  +		drm_mode_probed_add(connector, mode);
> > >  +	}
> > > 
> > >   	connector->display_info.bpc = 8;
> > >   	connector->display_info.width_mm = panel_info->width_mm;
> > >  @@ -230,7 +238,7 @@ static int nt39016_get_modes(struct drm_panel
> > > *drm_panel,
> > >   					 &panel_info->bus_format, 1);
> > >   	connector->display_info.bus_flags = panel_info->bus_flags;
> > > 
> > >  -	return 1;
> > >  +	return panel_info->num_modes;
> > >   }
> > > 
> > >   static const struct drm_panel_funcs nt39016_funcs = {
> > >  @@ -316,8 +324,8 @@ static int nt39016_remove(struct spi_device
> > > *spi)
> > >   	return 0;
> > >   }
> > > 
> > >  -static const struct nt39016_panel_info kd035g6_info = {
> > >  -	.display_mode = {
> > >  +static const struct drm_display_mode kd035g6_display_modes[] = {
> > >  +	{
> > >   		.clock = 6000,
> > >   		.hdisplay = 320,
> > >   		.hsync_start = 320 + 10,
> > >  @@ -330,6 +338,11 @@ static const struct nt39016_panel_info
> > > kd035g6_info = {
> > >   		.vrefresh = 60,
> > >   		.flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_NVSYNC,
> > >   	},
> > >  +};
> > >  +
> > >  +static const struct nt39016_panel_info kd035g6_info = {
> > >  +	.display_modes = kd035g6_display_modes,
> > >  +	.num_modes = ARRAY_SIZE(kd035g6_display_modes),
> > >   	.width_mm = 71,
> > >   	.height_mm = 53,
> > >   	.bus_format = MEDIA_BUS_FMT_RGB888_1X24,
> > >  --
> > >  2.25.1
> 

  reply	other threads:[~2020-04-08 10:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-08  9:58 [PATCH 1/2] drm/panel: NT39016: Add support for multiple modes Paul Cercueil
2020-04-08  9:58 ` Paul Cercueil
2020-04-08  9:58 ` [PATCH 2/2] drm/panel: NT39016: Add support for 50 Hz refresh rate Paul Cercueil
2020-04-08  9:58   ` Paul Cercueil
2020-04-08 10:05   ` Sam Ravnborg
2020-04-08 10:05     ` Sam Ravnborg
2020-04-08 10:04 ` [PATCH 1/2] drm/panel: NT39016: Add support for multiple modes Sam Ravnborg
2020-04-08 10:04   ` Sam Ravnborg
2020-04-08 10:12   ` Paul Cercueil
2020-04-08 10:12     ` Paul Cercueil
2020-04-08 10:27     ` Sam Ravnborg [this message]
2020-04-08 10:27       ` Sam Ravnborg

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=20200408102753.GA25805@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=od@zcrc.me \
    --cc=paul@crapouillou.net \
    --cc=thierry.reding@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.