Skip to content

Commit 3a25a49

Browse files
committed
drm: apple: Only use swap timestamps if VRR is actually active
macOS is inconsistent with how it uses DCP timestamps. Some swaps don't use them at all. We know they are required for VRR display modes to work properly, so let's just turn them on when we are connected to a VRR display. This includes the 120 Hz mode on the 14" and 16" MacBook Pros. Signed-off-by: James Calligeros <[email protected]>
1 parent 952c976 commit 3a25a49

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/drm/apple/iomfb_template.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,8 +1248,8 @@ int DCP_FW_NAME(iomfb_modeset)(struct apple_dcp *dcp,
12481248
.timing_mode_id = mode->timing_mode_id
12491249
};
12501250

1251-
/* Keep track of suspected vrr modes */
1252-
dcp->use_timestamps = mode->vrr;
1251+
/* Use DCP swap timestamps on MacBook Pros with VRR */
1252+
dcp->use_timestamps = mode->vrr && dcp->main_display;
12531253

12541254
cookie = kzalloc(sizeof(*cookie), GFP_KERNEL);
12551255
if (!cookie) {
@@ -1422,7 +1422,7 @@ void DCP_FW_NAME(iomfb_flush)(struct apple_dcp *dcp, struct drm_crtc *crtc, stru
14221422
req->clear = 1;
14231423
}
14241424

1425-
if (has_surface && dcp->use_timestamps) {
1425+
if (has_surface && (dcp->use_timestamps || crtc_state->vrr_enabled)) {
14261426
/*
14271427
* TODO: ascertain with certainty what these timestamps
14281428
* are. These names are guesses based on what macOS populates

0 commit comments

Comments
 (0)