[PATCH] drm: document TV margin properties

Pekka Paalanen ppaalanen at gmail.com
Tue Feb 28 08:46:42 UTC 2023


On Mon, 27 Feb 2023 12:21:16 +0000
Simon Ser <contact at emersion.fr> wrote:

> Add docs for "{left,right,top,bottom} margin" properties.
> 
> Signed-off-by: Simon Ser <contact at emersion.fr>
> Cc: Maxime Ripard <maxime at cerno.tech>
> Cc: Daniel Vetter <daniel at ffwll.ch>
> Cc: Pekka Paalanen <ppaalanen at gmail.com>
> Cc: Noralf Trønnes <noralf at tronnes.org>
> Cc: Mateusz Kwiatkowski <kfyatek+publicgit at gmail.com>
> ---
>  drivers/gpu/drm/drm_connector.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c
> index 9d0250c28e9b..65a586680940 100644
> --- a/drivers/gpu/drm/drm_connector.c
> +++ b/drivers/gpu/drm/drm_connector.c
> @@ -1590,10 +1590,6 @@ EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property);
>  
>  /*
>   * TODO: Document the properties:
> - *   - left margin
> - *   - right margin
> - *   - top margin
> - *   - bottom margin
>   *   - brightness
>   *   - contrast
>   *   - flicker reduction
> @@ -1651,6 +1647,16 @@ EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property);
>   *
>   *	Drivers can set up this property by calling
>   *	drm_mode_create_tv_properties().
> + *
> + * left margin, right margin, top margin, bottom margin:
> + *	Add margins to the connector's viewport.
> + *
> + *	The value is the size in pixels of the black border which will be
> + *	added. The attached CRTC's content will be scaled to fill the whole
> + *	area inside the margin.
> + *
> + *	Drivers can set up these properties by calling
> + *	drm_mode_create_tv_margin_properties().
>   */
>  
>  /**

Hi Simon,

can these be negative as well, to achieve overscan and not just
underscan? Did I get overscan and underscan right... these are related
to under/overscan, aren't they?

Hmm, no, I guess that doesn't make sense, there is no room in the
signal to have negative margins, it would result in clipping the
framebuffer while scaling up. So this can only be used to scale
framebuffer *down*, add borders, and the TV then scales it back up
again?

Looks like neither my Intel nor AMD cards support these, I don't see
the properties. More things to the list of KMS properties Weston needs
to explicitly control. Oh, it seems vc4 exclusive for now.

Where does this text appear in the HTML kernel docs? I tried to look at
drm_connector.c but I cannot find the spot where this patch applies.

Is this actually a connector property? How does that work, should this
not be a CRTC property?

Is this instead not scaling anything but simply sending metadata
through the connector?

Or are there underlying requirements that this connector property is
actually affecting the CRTC, which means that it is fundamentally
impossible to use multiple connectors with different values on the same
CRTC? And drivers will reject any attempt, so there is no need to
define what conflicting settings will do?

IOW, does simply the existence of these properties on a connector
guarantee that the connector must be the only one on a CRTC?


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20230228/fe87e4cd/attachment.sig>


More information about the dri-devel mailing list