Skip to content

Commit 70f8061

Browse files
committed
drm: apple: Force modeset when VRR is toggled
DCP requires a "modeset" to trigger the upload of the SDP to the display. On some monitors, this is instant. On others, this seems to take as long as a real modeset. Given that in either case we still blank the display, let's just force a full modeset when VRR is toggled on or off. Signed-off-by: James Calligeros <[email protected]>
1 parent 049e881 commit 70f8061

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/gpu/drm/apple/dcp-internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ struct apple_dcp {
186186
bool during_modeset;
187187
bool valid_mode;
188188
bool use_timestamps;
189+
bool vrr_enabled;
189190
struct dcp_set_digital_out_mode_req mode;
190191

191192
/* completion for active turning true */

drivers/gpu/drm/apple/dcp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,11 @@ int dcp_crtc_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
361361
return -EINVAL;
362362
}
363363

364+
if (dcp->vrr_enabled != crtc_state->vrr_enabled) {
365+
dcp->vrr_enabled = crtc_state->vrr_enabled;
366+
crtc_state->mode_changed = true;
367+
}
368+
364369
return 0;
365370
}
366371

drivers/gpu/drm/apple/iomfb_template.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ int DCP_FW_NAME(iomfb_modeset)(struct apple_dcp *dcp,
12641264
dcp->during_modeset = true;
12651265

12661266
if (mode->vrr)
1267-
dcp_set_adaptive_sync(dcp, mode->min_vrr, cookie);
1267+
dcp_set_adaptive_sync(dcp, dcp->vrr_enabled ? mode->min_vrr : 0, cookie);
12681268
else
12691269
dcp_set_digital_out_mode(dcp, false, &dcp->mode,
12701270
complete_set_digital_out_mode, cookie);

0 commit comments

Comments
 (0)