Skip to content

Commit b18c283

Browse files
Lawstorant1Naim
authored andcommitted
drm: Add passive_vrr_disabled property to crtc
Many TVs and other HDMI sinks suffer from blanking and possibly other glitches when VRR is toggled. With VRR present on such sinks and vrr_on_desktop enabled, they behave like the signal is always variable, even in fixed refresh rate situations. DisplayPort and eDP enforce seamless VRR transitions but HDMI unfortunately doesn't. Keep VRR toggled if it's supported and not explicitly disabled. It can be used for any VRR sinks, but this is mainly targeted for HDMI. Functionally, for an end user, this is the same as normal, fixed refresh rate mode. The only difference is that sink is kept in VRR state which enables seamless transitions into/out of variable refresh rate. Basically, the driver shouldn't change it's behavior around VRR_ENABLED set to false, jut keep sending info packets/frames with VRR/FreeSync/ G-Sync/HDMI VRR active. Enabled by default for sinks that claim it's support Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
1 parent abb749b commit b18c283

5 files changed

Lines changed: 27 additions & 0 deletions

File tree

drivers/gpu/drm/drm_atomic_uapi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ static int drm_atomic_crtc_set_property(struct drm_crtc *crtc,
412412
return ret;
413413
} else if (property == config->prop_vrr_enabled) {
414414
state->vrr_enabled = val;
415+
} else if (property == config->prop_passive_vrr_disabled) {
416+
state->passive_vrr_disabled = val;
415417
} else if (property == config->degamma_lut_property) {
416418
const size_t elem_size = sizeof(struct drm_color_lut);
417419
u64 lut_size;
@@ -495,6 +497,8 @@ drm_atomic_crtc_get_property(struct drm_crtc *crtc,
495497
*val = (state->mode_blob) ? state->mode_blob->base.id : 0;
496498
else if (property == config->prop_vrr_enabled)
497499
*val = state->vrr_enabled;
500+
else if (property == config->prop_passive_vrr_disabled)
501+
*val = state->passive_vrr_disabled;
498502
else if (property == config->degamma_lut_property)
499503
*val = (state->degamma_lut) ? state->degamma_lut->base.id : 0;
500504
else if (property == config->ctm_property)

drivers/gpu/drm/drm_crtc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ static int __drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *
322322
config->prop_out_fence_ptr, 0);
323323
drm_object_attach_property(&crtc->base,
324324
config->prop_vrr_enabled, 0);
325+
drm_object_attach_property(&crtc->base,
326+
config->prop_passive_vrr_disabled, 0);
325327
}
326328

327329
return 0;

drivers/gpu/drm/drm_mode_config.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ static int drm_mode_create_standard_properties(struct drm_device *dev)
345345
return -ENOMEM;
346346
dev->mode_config.prop_vrr_enabled = prop;
347347

348+
prop = drm_property_create_bool(dev, 0,
349+
"PASSIVE_VRR_DISABLED");
350+
if (!prop)
351+
return -ENOMEM;
352+
dev->mode_config.prop_passive_vrr_disabled = prop;
353+
348354
prop = drm_property_create(dev,
349355
DRM_MODE_PROP_BLOB,
350356
"DEGAMMA_LUT", 0);

include/drm/drm_crtc.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,15 @@ struct drm_crtc_state {
299299
*/
300300
bool vrr_enabled;
301301

302+
/**
303+
* @passive_vrr_disabled:
304+
*
305+
* Indicates if variable refresh rate on desktop should be enabled for
306+
* the CRTC. Support for the requested state will depend on driver and
307+
* hardware capabiltiy - lacking support is not treated as failure.
308+
*/
309+
bool passive_vrr_disabled;
310+
302311
/**
303312
* @self_refresh_active:
304313
*

include/drm/drm_mode_config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,12 @@ struct drm_mode_config {
697697
* whether variable refresh rate should be enabled on the CRTC.
698698
*/
699699
struct drm_property *prop_vrr_enabled;
700+
/**
701+
* @prop_passive_vrr_disabled: Default atomic CRTC property to indicate
702+
* whether passive variable refresh rate should be disabled
703+
* on the CRTC.
704+
*/
705+
struct drm_property *prop_passive_vrr_disabled;
700706

701707
/**
702708
* @dvi_i_subconnector_property: Optional DVI-I property to

0 commit comments

Comments
 (0)