linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Noralf Trønnes" <noralf@tronnes.org>
To: Maxime Ripard <maxime.ripard@bootlin.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>,
	Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	linux-arm-kernel@lists.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	dri-devel@lists.freedesktop.org, eben@raspberrypi.org
Subject: Re: [PATCH v4 10/12] drm/modes: Parse overscan properties
Date: Sun, 16 Jun 2019 11:54:41 +0200	[thread overview]
Message-ID: <e2790a57-02be-78e8-5ce8-00a62c1861bf@tronnes.org> (raw)
In-Reply-To: <00dfc10e-a95e-be07-0179-8cfeb6ca9908@tronnes.org>



Den 15.06.2019 17.40, skrev Noralf Trønnes:
> 
> 
> Den 14.06.2019 14.13, skrev Maxime Ripard:
>> Properly configuring the overscan properties might be needed for the
>> initial setup of the framebuffer for display that still have overscan.
>> Let's allow for more properties on the kernel command line to setup each
>> margin.
> 
> This also needs to be documented in Documentation/fb/modedb.txt
> 
>>
>> Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
>> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
>> ---
>>  drivers/gpu/drm/drm_modes.c | 44 ++++++++++++++++++++++++++++++++++++++-
>>  include/drm/drm_connector.h | 12 +++++-----
>>  2 files changed, 50 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
>> index b92b7df6784a..25d2ba595750 100644
>> --- a/drivers/gpu/drm/drm_modes.c
>> +++ b/drivers/gpu/drm/drm_modes.c
>> @@ -1609,6 +1609,50 @@ static int drm_mode_parse_cmdline_options(char *str, size_t len,
>>  		} else if (!strncmp(option, "reflect_y", delim - option)) {
>>  			rotation |= DRM_MODE_REFLECT_Y;
>>  			sep = delim;
>> +		} else if (!strncmp(option, "margin_right", delim - option)) {
> 
> I wonder if this should be called tv_margin_right to distinguish it from
> 'm' (the mode specifier) which also is a margin? Or can these margins be
> reused on other display types later on? A little stupid to have both
> 'tv_margin_right' and 'margin_right'.

And after a nights sleep I think 'margin_right' is just fine as long as
it's documented in modedb.txt as TV margins.

So with an modedb.txt entry and the struct change moved to patch 8:

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

> 
>> +			const char *value = delim + 1;
>> +			unsigned int margin;
>> +
>> +			margin = simple_strtol(value, &sep, 10);
>> +
>> +			/* Make sure we have parsed something */
>> +			if (sep == value)
>> +				return -EINVAL;
>> +
>> +			mode->tv_margins.right = margin;
>> +		} else if (!strncmp(option, "margin_left", delim - option)) {
>> +			const char *value = delim + 1;
>> +			unsigned int margin;
>> +
>> +			margin = simple_strtol(value, &sep, 10);
>> +
>> +			/* Make sure we have parsed something */
>> +			if (sep == value)
>> +				return -EINVAL;
>> +
>> +			mode->tv_margins.left = margin;
>> +		} else if (!strncmp(option, "margin_top", delim - option)) {
>> +			const char *value = delim + 1;
>> +			unsigned int margin;
>> +
>> +			margin = simple_strtol(value, &sep, 10);
>> +
>> +			/* Make sure we have parsed something */
>> +			if (sep == value)
>> +				return -EINVAL;
>> +
>> +			mode->tv_margins.top = margin;
>> +		} else if (!strncmp(option, "margin_bottom", delim - option)) {
>> +			const char *value = delim + 1;
>> +			unsigned int margin;
>> +
>> +			margin = simple_strtol(value, &sep, 10);
>> +
>> +			/* Make sure we have parsed something */
>> +			if (sep == value)
>> +				return -EINVAL;
>> +
>> +			mode->tv_margins.bottom = margin;
>>  		} else {
>>  			return -EINVAL;
>>  		}
>> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
>> index c58a35b34c1a..6841c46e6781 100644
>> --- a/include/drm/drm_connector.h
>> +++ b/include/drm/drm_connector.h
>> @@ -505,12 +505,7 @@ struct drm_connector_tv_margins {
>>   */
>>  struct drm_tv_connector_state {
>>  	enum drm_mode_subconnector subconnector;
>> -	struct {
>> -		unsigned int left;
>> -		unsigned int right;
>> -		unsigned int top;
>> -		unsigned int bottom;
>> -	} margins;
>> +	struct drm_connector_tv_margins margins;
>>  	unsigned int mode;
>>  	unsigned int brightness;
>>  	unsigned int contrast;
> 
> As mentioned this needs moving to patch 8.
> 
> Noralf.
> 
>> @@ -1039,6 +1034,11 @@ struct drm_cmdline_mode {
>>  	 * DRM_MODE_ROTATE_180 are supported at the moment.
>>  	 */
>>  	unsigned int rotation;
>> +
>> +	/**
>> +	 * @tv_margins: TV margins to apply to the mode.
>> +	 */
>> +	struct drm_connector_tv_margins tv_margins;
>>  };
>>  
>>  /**
>>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-06-16  9:55 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14 12:13 [PATCH v4 00/12] drm/vc4: Allow for more boot-time configuration Maxime Ripard
2019-06-14 12:13 ` [PATCH v4 01/12] drm/connector: Add documentation for drm_cmdline_mode Maxime Ripard
2019-06-15  8:51   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 02/12] drm/client: Restrict the plane_state scope Maxime Ripard
2019-06-14 12:28   ` Jani Nikula
2019-06-14 14:12     ` Maxime Ripard
2019-06-17  9:27       ` Jani Nikula
2019-06-15  8:52   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 03/12] drm/client: Restrict the rotation check to the rotation itself Maxime Ripard
2019-06-15  8:59   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 04/12] drm/client: Change drm_client_panel_rotation name Maxime Ripard
2019-06-15  9:01   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 05/12] drm/modes: Rewrite the command line parser Maxime Ripard
2019-06-15  9:11   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 06/12] drm/modes: Support modes names on the command line Maxime Ripard
2019-06-14 12:13 ` [PATCH v4 07/12] drm/modes: Allow to specify rotation and reflection on the commandline Maxime Ripard
2019-06-15  9:21   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 08/12] drm/connector: Introduce a TV margins structure Maxime Ripard
2019-06-15 14:54   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 09/12] drm/atomic: Add a function to reset connector TV properties Maxime Ripard
2019-06-15 15:30   ` Noralf Trønnes
2019-06-14 12:13 ` [PATCH v4 10/12] drm/modes: Parse overscan properties Maxime Ripard
2019-06-15 15:40   ` Noralf Trønnes
2019-06-16  9:54     ` Noralf Trønnes [this message]
2019-06-14 12:13 ` [PATCH v4 11/12] drm/selftests: Add command line parser selftests Maxime Ripard
2019-06-14 12:13 ` [PATCH v4 12/12] drm/vc4: hdmi: Set default state margin at reset Maxime Ripard
2019-06-15 15:43   ` Noralf Trønnes

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=e2790a57-02be-78e8-5ce8-00a62c1861bf@tronnes.org \
    --to=noralf@tronnes.org \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eben@raspberrypi.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=seanpaul@chromium.org \
    --cc=thomas.petazzoni@bootlin.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 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).