Repository navigation
drm/apple: offer a firmware 27 ProMotion panel's fixed rates as paced modes - #4059
Draft
RyanTheTide wants to merge 1 commit into
Draft
RyanTheTide wants to merge 1 commit into
RyanTheTide wants to merge 1 commit into
Conversation
… modes Firmware 27 lists the T6050 internal panel's fixed rates next to its 120 Hz timing: 60, 59.94, 50, 48 and 47.95 Hz, each marked IsPromoted, the set macOS offers. Linux offered only 120 Hz, because a mode set away from the 120 Hz timing crashes the DCP (dcp_mode_settable()). The panel does not need that mode set: it shows each swap on the first 240 Hz tick after the swap arrives (dcp_refresh_swap_paced()). So offer each fixed rate as a mode of its own that keeps the DCP on the 120 Hz timing of its size, and pace the swaps to the rate: - dcp_find_mode() gives a paced rate's 120 Hz entry, so a mode set, dcp_mode_settable() and every firmware call see that timing only. - Switching between paced rates of one timing is no mode set (apple_connector_rate_fastset()), as with the notch geometries. - iomfb_pace_hold() holds a paced swap until its due time, kept whole periods apart, so 60 and 48 Hz are whole ticks and 59.94, 50 and 47.95 Hz keep their average. A swap a period late starts again from the last swap shown. VRR_ENABLED turns the pacing off. Only while the panel runs the 120 Hz timing; a panel iBoot left at 60 Hz keeps just that. This covers every firmware 27 internal panel whose DCP sets hw.only_120hz_modes, the flag dcp_mode_settable() already keys the 120 Hz restriction on: the T6050 today, the T6031 and T6030 once their flags land. The panel EDID's range also started at its lowest timing (47 Hz), which is what compositors show as the VRR range; take the paced floor (24 Hz) instead. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Member
|
Bare-metal J516c (16-inch MacBook Pro, M3 Max
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #3693: the same change rebased on main at 13dc5a7 (that branch conflicted; this is a fresh branch, no force push).
Problem
Firmware 27 lists a ProMotion panel's fixed rates (60, 59.94, 50, 48, 47.95 Hz, each
IsPromoted) next to its 120 Hz timing, the set macOS offers. Linux offers only 120 Hz, because a mode set away from the 120 Hz timing crashes the internal DCP (dcp_mode_settable(),hw.only_120hz_modes). Compositors also show the panel's VRR range as 47-120 Hz instead of 24-120.Change
Each fixed rate becomes a mode that keeps the DCP on the 120 Hz timing of its size, and the swaps are paced to the rate in the IOMFB queue. Switching between those rates is no mode set. The synthesized panel EDID's range starts at the paced floor (24 Hz).
Scope: firmware 27 internal panels whose DCP sets
only_120hz_modes: the T6050 (M5 Pro/Max) today, the T6031 (#4049) and T6030 once their flags land.dcp_paced_rates()keys onhw.only_120hz_modes && fw_compat == 27, the same condition #4049 gives the 120 Hz restriction indcp_mode_settable(), so a SoC that gets the flag gets the paced rates with it.Real firmware mode sets to these rates are tracked separately (Dj's work); this change never sends one.
Testing
Tested: no new hardware row on this head yet (228f556). Build/unit proof on the buildbox at this head: KUnit dcp-fabric 117/117, dcp-topology 236/237 (1 skip), dcp-display 316/317 (1 skip,
apple_g17_rx_util_min_testneeds UCLAMP_TASK);tools/asahi/run-host-tests.py1032/1032; checkpatch --strict clean; arm64 LLVM=1 W=1 build ofdrivers/gpu/drm/apple/with 0 warnings. #3693's K114s and J616s rows were on the pre-rebase head 76de6e2 (details below).Risk: Two-way. K114s/T6050 internal panel (M5 Pro/Max) on firmware 27; T6031/T6030 once their
only_120hz_modesflags land. New swap pacing in the firmware 27 IOMFB queue for the non-120 Hz modes; 120 Hz and VRR swaps are not held, and every firmware mode set still uses the 120 Hz timing. Other machines:dcp_paced_rates()is false, an untaken branch.Still to run
Rebase notes
dcp.cinclude list: main dropped#include "dcpext_scanout.h"(9f5ce93, "remove the T6030 manual external-display path"); kept that removal and added onlydcp-refresh.h. The rest applied unchanged; the diff is identical to drm/apple: offer a firmware 27 ProMotion panel's fixed rates as paced modes #3693's (11 files, +242/-6).dcp_mode_settable()line this PR touches (drm_mode_vrefresh(mode)->&dcp_mode->mode), so whichever lands second has a one-line textual conflict: keep both the fw27 condition and&dcp_mode->mode.#3693 hardware rows (pre-rebase head 76de6e2)
K114s (M5 Pro 14", firmware 27), lab module on its 7.3.0 kernel: six eDP modes, EDID range 24-121, Mutter lists all six with their Variable variants. Flip-event rate per mode with a client flipping as fast as events come (349 flips each): 120.024 / 60.001 / 59.957 / 50.004 / 48.001 / 47.946 Hz; VRR still variable. Live Mutter switches through all six rates: 0 firmware mode sets, 0 DCP crashes. J616s (M4 Pro, firmware 26.6) on its Edge kernel: identical modes and Mutter list, 120.001 / 60.000 / 59.940 / 49.998 / 48.000 / 47.953 Hz, same as stock.