From 73a06ffae663e9fb78c5dff4b6bd01a637296a69 Mon Sep 17 00:00:00 2001 From: Philip Langdale Date: Sun, 3 Apr 2022 20:08:33 -0700 Subject: drm: context_drm_egl: add support for enabling VRR Variable Refresh Rate (VRR), aka Freesync or Adaptive Sync can be used with DRM by setting the VRR_ENABLED property on a crtc if the connector reports that it is VRR_CAPABLE. This is a useful feature for us as it is common to play 24/25/50 fps content on displays that are nominally locked to 60Hz. VRR can allow this content to play at native framerates. This is a simple change as we just need to check the capability and set the enabled property if requested by the user. I've defaulted it to disabled for now, but it might make sense to default to auto in the long term. --- video/out/drm_common.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'video/out/drm_common.c') diff --git a/video/out/drm_common.c b/video/out/drm_common.c index aa86b7750b..dad9aaf2fb 100644 --- a/video/out/drm_common.c +++ b/video/out/drm_common.c @@ -98,6 +98,8 @@ const struct m_sub_options drm_conf = { {"drm-osd-plane-id", OPT_REPLACED("drm-draw-plane")}, {"drm-video-plane-id", OPT_REPLACED("drm-drmprime-video-plane")}, {"drm-osd-size", OPT_REPLACED("drm-draw-surface-size")}, + {"drm-vrr-enabled", OPT_CHOICE(drm_vrr_enabled, + {"no", 0}, {"yes", 1}, {"auto", -1})}, {0}, }, .defaults = &(const struct drm_opts) { @@ -105,6 +107,7 @@ const struct m_sub_options drm_conf = { .drm_atomic = 1, .drm_draw_plane = DRM_OPTS_PRIMARY_PLANE, .drm_drmprime_video_plane = DRM_OPTS_OVERLAY_PLANE, + .drm_vrr_enabled = 0, }, .size = sizeof(struct drm_opts), }; -- cgit v1.2.3