Skip to contentSkip to conversation

drm: Fix timestamp docs for variable refresh properties.

PATCH Applied Mario Kleiner 4 participants 5 messages Apr 18, 2019 – May 7, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Fix timestamp docs for variable refresh properties.

As discussed with Nicholas and Daniel Vetter (patchwork link to discussion below), the VRR timestamping behaviour produced utterly useless and bogus vblank/pageflip timestamps. We have found a way to fix this and provide sane behaviour.

As of Linux 5.2, the amdgpu driver will be able to provide exactly the same vblank / pageflip timestamp semantic in variable refresh rate mode as in standard fixed refresh rate mode. This is achieved by deferring core vblank handling (drm_crtc_handle_vblank()) until the end of front porch, and also defer the sending of pageflip completion events until end of front porch, when we can safely compute correct pageflip/vblank timestamps.

The same approach will be possible for other VRR capable kms drivers, so we can actually have sane and useful timestamps in VRR mode.

This patch removes the section of the docs that describes the broken timestamp behaviour present in Linux 5.0/5.1.

Fixes ab7a664f7a2d ("drm: Document variable refresh properties")
---
 drivers/gpu/drm/drm_connector.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -6
index 2355124849db..b34c3d38bf15 100644
@@ -1416,12 +1416,6 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property);
  *
  *	The driver may place further restrictions within these minimum
  *	and maximum bounds.
- *
- *	The semantics for the vertical blank timestamp differ when
- *	variable refresh rate is active. The vertical blank timestamp
- *	is defined to be an estimate using the current mode's fixed
- *	refresh rate timings. The semantics for the page-flip event
- *	timestamp remain the same.
  */
 
 /**
Signature · 6 lines
2.20.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Mario Kleiner

As discussed with Nicholas and Daniel Vetter (patchwork link to discussion below), the VRR timestamping behaviour produced utterly useless and bogus vblank/pageflip timestamps. We have found a way to fix this and provide sane behaviour.

As of Linux 5.2, the amdgpu driver will be able to provide exactly the same vblank / pageflip timestamp semantic in variable refresh rate mode as in standard fixed refresh rate mode. This is achieved by deferring core vblank handling (drm_crtc_handle_vblank()) until the end of front porch, and also defer the sending of pageflip completion events until end of front porch, when we can safely compute correct pageflip/vblank timestamps.

The same approach will be possible for other VRR capable kms drivers, so we can actually have sane and useful timestamps in VRR mode.

This patch removes the section of the docs that describes the broken timestamp behaviour present in Linux 5.0/5.1.

Fixes ab7a664f7a2d ("drm: Document variable refresh properties")
---
 drivers/gpu/drm/drm_connector.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -0
index 2355124849db..b34c3d38bf15 100644

drivers/gpu/drm/drm_connector.c EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); · line 1424

Quoted 9 lines
drivers/gpu/drm/drm_connector.c +0 -6
@@ -1416,12 +1416,6 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property);
  *
  *	The driver may place further restrictions within these minimum
  *	and maximum bounds.
- *
- *	The semantics for the vertical blank timestamp differ when
- *	variable refresh rate is active. The vertical blank timestamp
- *	is defined to be an estimate using the current mode's fixed
- *	refresh rate timings. The semantics for the page-flip event
- *	timestamp remain the same.

Yay! Thanks for all your work to polish VRR in linux.

Quoted 6 lines
drivers/gpu/drm/drm_connector.c +0 -0
  */
 
 /**
Signature · 1 line
2.20.1
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#2 lore raw
In reply to Mario Kleiner
Quoted 20 lines · Mario Kleiner

As discussed with Nicholas and Daniel Vetter (patchwork link to discussion below), the VRR timestamping behaviour produced utterly useless and bogus vblank/pageflip timestamps. We have found a way to fix this and provide sane behaviour.

As of Linux 5.2, the amdgpu driver will be able to provide exactly the same vblank / pageflip timestamp semantic in variable refresh rate mode as in standard fixed refresh rate mode. This is achieved by deferring core vblank handling (drm_crtc_handle_vblank()) until the end of front porch, and also defer the sending of pageflip completion events until end of front porch, when we can safely compute correct pageflip/vblank timestamps.

The same approach will be possible for other VRR capable kms drivers, so we can actually have sane and useful timestamps in VRR mode.

Quoted 7 lines

This patch removes the section of the docs that describes the broken timestamp behaviour present in Linux 5.0/5.1.

Fixes ab7a664f7a2d ("drm: Document variable refresh properties")

Someone else can feel free to push this as I don't have commit rights for DRM.

Thanks!

Nicholas Kazlauskas

Quoted 12 lines
---
  drivers/gpu/drm/drm_connector.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -0
index 2355124849db..b34c3d38bf15 100644
@@ -1416,12 +1416,6 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property);
   *
   *	The driver may place further restrictions within these minimum

drivers/gpu/drm/drm_connector.c EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); · line 1421

Quoted 10 lines
drivers/gpu/drm/drm_connector.c +0 -6
   *	and maximum bounds.
- *
- *	The semantics for the vertical blank timestamp differ when
- *	variable refresh rate is active. The vertical blank timestamp
- *	is defined to be an estimate using the current mode's fixed
- *	refresh rate timings. The semantics for the page-flip event
- *	timestamp remain the same.
   */
 
  /**

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Nag nag: The below documentation patch, acked-by Daniel and r-b'd by Nicholas seems to not have made it into drm-next yet?

thanks,
-mario

Quoted 59 lines · Nicholas
Quoted 20 lines · Mario Kleiner

As discussed with Nicholas and Daniel Vetter (patchwork link to discussion below), the VRR timestamping behaviour produced utterly useless and bogus vblank/pageflip timestamps. We have found a way to fix this and provide sane behaviour.

As of Linux 5.2, the amdgpu driver will be able to provide exactly the same vblank / pageflip timestamp semantic in variable refresh rate mode as in standard fixed refresh rate mode. This is achieved by deferring core vblank handling (drm_crtc_handle_vblank()) until the end of front porch, and also defer the sending of pageflip completion events until end of front porch, when we can safely compute correct pageflip/vblank timestamps.

The same approach will be possible for other VRR capable kms drivers, so we can actually have sane and useful timestamps in VRR mode.

Quoted 7 lines

This patch removes the section of the docs that describes the broken timestamp behaviour present in Linux 5.0/5.1.

Fixes ab7a664f7a2d ("drm: Document variable refresh properties")

Someone else can feel free to push this as I don't have commit rights for DRM.

Thanks!

Nicholas Kazlauskas

Quoted 20 lines
---
  drivers/gpu/drm/drm_connector.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -6
index 2355124849db..b34c3d38bf15 100644
@@ -1416,12 +1416,6 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property);
   *
   *  The driver may place further restrictions within these minimum
   *  and maximum bounds.
- *
- *   The semantics for the vertical blank timestamp differ when
- *   variable refresh rate is active. The vertical blank timestamp
- *   is defined to be an estimate using the current mode's fixed
- *   refresh rate timings. The semantics for the page-flip event
- *   timestamp remain the same.
   */
 
Quoted 3 lines

drivers/gpu/drm/drm_connector.c EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); · line 1421

Quoted 2 lines
drivers/gpu/drm/drm_connector.c +0 -0
  /**

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#4 lore raw
Quoted 3 lines · Mario Kleiner

Nag nag: The below documentation patch, acked-by Daniel and r-b'd by Nicholas seems to not have made it into drm-next yet?

Pushed to drm-misc-next-fixes

Thanks!

Alex

Quoted 65 lines

thanks,
-mario

Quoted 59 lines · Nicholas
Quoted 20 lines · Mario Kleiner

As discussed with Nicholas and Daniel Vetter (patchwork link to discussion below), the VRR timestamping behaviour produced utterly useless and bogus vblank/pageflip timestamps. We have found a way to fix this and provide sane behaviour.

As of Linux 5.2, the amdgpu driver will be able to provide exactly the same vblank / pageflip timestamp semantic in variable refresh rate mode as in standard fixed refresh rate mode. This is achieved by deferring core vblank handling (drm_crtc_handle_vblank()) until the end of front porch, and also defer the sending of pageflip completion events until end of front porch, when we can safely compute correct pageflip/vblank timestamps.

The same approach will be possible for other VRR capable kms drivers, so we can actually have sane and useful timestamps in VRR mode.

Quoted 7 lines

This patch removes the section of the docs that describes the broken timestamp behaviour present in Linux 5.0/5.1.

Fixes ab7a664f7a2d ("drm: Document variable refresh properties")

Someone else can feel free to push this as I don't have commit rights for DRM.

Thanks!

Nicholas Kazlauskas

Quoted 20 lines
---
  drivers/gpu/drm/drm_connector.c | 6 ------
  1 file changed, 6 deletions(-)
drivers/gpu/drm/drm_connector.c +0 -6
index 2355124849db..b34c3d38bf15 100644
@@ -1416,12 +1416,6 @@ EXPORT_SYMBOL(drm_mode_create_scaling_mode_property);
   *
   *  The driver may place further restrictions within these minimum
   *  and maximum bounds.
- *
- *   The semantics for the vertical blank timestamp differ when
- *   variable refresh rate is active. The vertical blank timestamp
- *   is defined to be an estimate using the current mode's fixed
- *   refresh rate timings. The semantics for the page-flip event
- *   timestamp remain the same.
   */
 
Quoted 7 lines
Quoted 3 lines

drivers/gpu/drm/drm_connector.c EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); · line 1421

Quoted 2 lines
drivers/gpu/drm/drm_connector.c +0 -0
  /**

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel