Thread (29 messages) flat view 29 messages, 2 authors, 3h ago
HOTtoday

[PATCH RFC 00/25] VRR Target Rate Limiter KMS uAPI and Implementation

From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Date: 2026-09-21 15:52:13
Also in: dri-devel, linux-fbdev, linux-rockchip, lkml

This series defines a proposed new userspace API for specifying frame
rate targets for variable refresh rate (VRR) mechanisms. This includes
specifying both a constrained range in which VRR should operate, as well
as a fixed target, and a new connector property for QMS (Quick Media
Switching).

The reason for wanting such an uAPI is mainly to avoid the imperfection
of the real world. By constraining VRR to a limited range or a fixed
point entirely, we get the benefits of judder-free (or low-latency)
presentation for content within an expected range of frame rates,
without dipping into ones that cause visible brightness flicker. The
addition of QMS furthermore allows the connector to signal an upcoming
rate change ahead of time for media playback scenarios, such that
advanced processing algorithms in e.g. TVs don't have to be disabled to
meet the need to be able to present at full rates with no notice.

Aside from the uAPI, there's the EDID parsing and an implementation for
drivers that use the common HDMI state helpers, with it wired up for
Rockchip (tested and developed on RK3588).

The first ~11 patches implement "game mode" VRR for the HDMI state
helpers, and wire it up for RK3588. For the people who care about the
uAPI, this part may not be super interesting.

The uAPI consists of 4 new CRTC properties for the frame rate
minimum/maximum target, and 1 new connector property for enabling QMS
signalling. The qms_enabled property is present when the connector
supports QMS signalling; Whether or not a *display* supports QMS
signalling is determined by the EDID, and userspace can do the necessary
EDID parsing by itself. (i.e., there is no qms_capable property that
exposes the kernel's own EDID parsing results to userspace.)

For some background on why the uAPI uses numerator/denominator frame
rate pairs as opposed to frame intervals or microhertz, my slides from
Display Next Hackfest 2026 give an explanation:

https://gitlab.freedesktop.org/-/project/2891/uploads/9db8886701e2598271a8c4c6dc4dc2b1/display_next_hackfest_2026.pdf

In short: for QMS, we have a very limited set of frame rate targets that
signalling is supported for. This includes both rates such as 24 Hz, and
24/1.001 Hz. Making userspace give us a frame rate as a rational
expression rather than as the output of some rounding calculations
spares us the pain and suffering of then having to correctly guess which
frame rate was originally meant as a target with a <0.1% accuracy
requirement.

There is also a set of IGT tests for exercising the new uAPI on actual
hardware:

https://gitlab.freedesktop.org/CounterPillow/igt-gpu-tools/-/tree/vrr-limiter

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---
Derek Foreman (5):
      drm/edid: Add a query for vrr range
      video/hdmi: Add VTEM EMP packing
      drm/bridge: Add VTEM EMP support
      drm/connector: hdmi: Add VTEM EMP generation
      drm/bridge: synopsys: Add VTEM EMP support

Nicolas Frattaroli (20):
      drm: Add VRR state
      drm/atomic-helper: Set mode_changed on vrr_enabled change
      drm/crtc-helper: Add VRR helper functions
      drm/connector: Add drm_display_info_is_vrr_capable
      drm/rockchip: dw_hdmi_qp: Add VRR support
      drm/rockchip: vop2: Enable VRR
      drm/edid: Parse CinemaVRR flag from HDMI SCDS
      drm: Add VRR target frame rate properties
      drm: Implement VRR rate limiting
      drm/edid: Parse QMS flag from HDMI SCDS
      drm/edid: Parse QMS TFR min/max flags from HDMI SCDS
      drm/connector: Add "qms_enabled" drm property
      video/hdmi: Add support for QMS in VTEM EMP packing
      drm/connector: hdmi: Add QMS to VTEM EMP generation
      drm/connector: hdmi: Add QMS state validation and computation
      drm/rockchip: dw_hdmi_qp: Add QMS support
      drm/tests: hdmi: Add "Game Mode" VRR tests
      drm/tests: hdmi: Add Fixed/Constrained rate VRR tests
      drm/tests: hdmi: Add Quick Media Switching tests
      drm/atomic: Disable VRR in helper_set_config

 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c       |   50 +-
 drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.h       |    1 +
 drivers/gpu/drm/display/drm_bridge_connector.c     |   41 +
 drivers/gpu/drm/display/drm_hdmi_state_helper.c    |  474 +++++++
 drivers/gpu/drm/drm_atomic.c                       |    2 +
 drivers/gpu/drm/drm_atomic_helper.c                |    9 +
 drivers/gpu/drm/drm_atomic_uapi.c                  |   28 +
 drivers/gpu/drm/drm_connector.c                    |  112 ++
 drivers/gpu/drm/drm_crtc.c                         |    8 +
 drivers/gpu/drm/drm_crtc_helper.c                  |   93 ++
 drivers/gpu/drm/drm_edid.c                         |   38 +
 drivers/gpu/drm/drm_mode_config.c                  |   20 +
 drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c     |   23 +
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c       |   62 +-
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.h       |    9 +
 drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c | 1383 ++++++++++++++++++++
 drivers/gpu/drm/tests/drm_kunit_edid.h             |  279 ++++
 drivers/video/hdmi.c                               |   99 +-
 include/drm/drm_bridge.h                           |   29 +
 include/drm/drm_connector.h                        |   59 +
 include/drm/drm_crtc.h                             |   18 +
 include/drm/drm_crtc_helper.h                      |    6 +
 include/drm/drm_edid.h                             |    3 +
 include/drm/drm_mode_config.h                      |   45 +
 include/linux/hdmi.h                               |   21 +
 25 files changed, 2898 insertions(+), 14 deletions(-)
---
base-commit: ab82471ddff094939d9981e0647332562c7e1c9b
change-id: 20260919-vrr-limiter-uapi-c99ed93fe7d2

Best regards,
--  
Nicolas Frattaroli [off-list ref]

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help