Skip to contentSkip to conversation

drm: document connector margin properties

PATCH In review Simon Ser 3 participants 3 messages Feb 28, 2023

Subsystems (2)
lore
Share & tools
lore

Simon Ser

author
#0 lore raw

PATCH v2 1/1 drm: document connector margin properties

Add docs for "{left,right,top,bottom} margin" properties.

v2:
- Mention the purpose: mitigate underscan on TVs
- Move out of analog TV section into standard props (Pekka)
- Mention HDMI AVI InfoFrames (Pekka, Ville)

Cc Maxime Ripard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Pekka Paalanen <[email protected]>
Cc Noralf Trønnes <[email protected]>
Cc Mateusz Kwiatkowski <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_connector.c +14 -4
index ffd65eddce42..a180f541736a 100644
@@ -1446,6 +1446,20 @@ static const struct drm_prop_enum_list dp_colorspaces[] = {
  *	a firmware handled hotkey. Therefor userspace must not include the
  *	privacy-screen sw-state in an atomic commit unless it wants to change
  *	its value.
+ *
+ * left margin, right margin, top margin, bottom margin:
+ *	Add margins to the connector's viewport. This is typically used to
+ *	mitigate underscan on TVs.
+ *
+ *	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.
+ *
+ *	The margins configuration might be sent to the sink, e.g. via HDMI AVI
+ *	InfoFrames.
+ *
+ *	Drivers can set up these properties by calling
+ *	drm_mode_create_tv_margin_properties().
  */
 
 int drm_connector_create_standard_properties(struct drm_device *dev)
@@ -1590,10 +1604,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
Signature · 1 line
2.39.2
#1 lore raw
Quoted 23 lines · Simon Ser

Add docs for "{left,right,top,bottom} margin" properties.

v2:
- Mention the purpose: mitigate underscan on TVs
- Move out of analog TV section into standard props (Pekka)
- Mention HDMI AVI InfoFrames (Pekka, Ville)

Cc Maxime Ripard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Pekka Paalanen <[email protected]>
Cc Noralf Trønnes <[email protected]>
Cc Mateusz Kwiatkowski <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -0
index ffd65eddce42..a180f541736a 100644

drivers/gpu/drm/drm_connector.c static const struct drm_prop_enum_list dp_colorspaces[] = { · line 1452

Quoted 7 lines
drivers/gpu/drm/drm_connector.c +4 -0
@@ -1446,6 +1446,20 @@ static const struct drm_prop_enum_list dp_colorspaces[] = {
  *	a firmware handled hotkey. Therefor userspace must not include the
  *	privacy-screen sw-state in an atomic commit unless it wants to change
  *	its value.
+ *
+ * left margin, right margin, top margin, bottom margin:
+ *	Add margins to the connector's viewport. This is typically used to
+ *	mitigate underscan on TVs.

"used to mitigate overscan" or "used to underscan" would make more sense to me.

drivers/gpu/drm/drm_connector.c static const struct drm_prop_enum_list dp_colorspaces[] = { · line 1456

Quoted 4 lines
drivers/gpu/drm/drm_connector.c +4 -0
+ *
+ *	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.

Dunno if there should be something even more explicit here about the CRTCs viewport/canvas/<whatever you call it> size remaining unchaned, ie. still 'hdisplay x vdisplay'?

Another very open question is how these would interact with the 'scaling mode' property/connectors that already scale the passed in mode to whatever fixed size the panel needs. In my i915 patches I totally sidestepped that question by not registering the margin properties for eDP at all.

Signature · 2 lines
Ville Syrjälä
Intel
Acked-by on v2 1/1
#2 lore raw
In reply to Simon Ser
Quoted 23 lines · On Tue, 28 Feb 2023 12:32:04 +0000 Simon Ser <[email protected]> wrote:

Add docs for "{left,right,top,bottom} margin" properties.

v2:
- Mention the purpose: mitigate underscan on TVs
- Move out of analog TV section into standard props (Pekka)
- Mention HDMI AVI InfoFrames (Pekka, Ville)

Cc Maxime Ripard <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Pekka Paalanen <[email protected]>
Cc Noralf Trønnes <[email protected]>
Cc Mateusz Kwiatkowski <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_connector.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -0
index ffd65eddce42..a180f541736a 100644

drivers/gpu/drm/drm_connector.c static const struct drm_prop_enum_list dp_colorspaces[] = { · line 1452

Quoted 7 lines
drivers/gpu/drm/drm_connector.c +4 -0
@@ -1446,6 +1446,20 @@ static const struct drm_prop_enum_list dp_colorspaces[] = {
  *	a firmware handled hotkey. Therefor userspace must not include the
  *	privacy-screen sw-state in an atomic commit unless it wants to change
  *	its value.
+ *
+ * left margin, right margin, top margin, bottom margin:
+ *	Add margins to the connector's viewport. This is typically used to
+ *	mitigate underscan on TVs.

I think it's overscan: scanning over and beyond the phosphor grid.

Quoted 14 lines
drivers/gpu/drm/drm_connector.c +10 -0
+ *
+ *	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.
+ *
+ *	The margins configuration might be sent to the sink, e.g. via HDMI AVI
+ *	InfoFrames.
+ *
+ *	Drivers can set up these properties by calling
+ *	drm_mode_create_tv_margin_properties().
  */
 
 int drm_connector_create_standard_properties(struct drm_device *dev)

drivers/gpu/drm/drm_connector.c EXPORT_SYMBOL(drm_connector_attach_dp_subconnector_property); · line 1609

Quoted 10 lines
drivers/gpu/drm/drm_connector.c +0 -4
@@ -1590,10 +1604,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

With that one typo'ish fixed:

Thanks,
pq