Repository navigation
drm/apple: T6050: no DSC modes on an external engine without its provider clock - #3922
rolotrealanis98 wants to merge 3 commits into
Conversation
…ider clock
On the J716s a USB-C display at 2560x1600@260 stayed black: the dcpext
firmware enables DSC for it, sizes the stream from its provider clock 0
("using getClockFrequency(0)"), the driver has no firmware clock to give
(the ADT's dispext/dcpext clock-ids are empty) and the firmware logs
"getClockFrequency(0) (0) < videoClock ... Giving up on frequencies".
The same display at 60 and 165 Hz (no DSC) shows a picture on both
USB-C ports, and HDMI at 165 Hz does too.
Until that clock is known, an apple,t6050-dcpext without firmware clocks
offers only the modes a 4-lane HBR3 link carries uncompressed at 10 bits
per component.
Signed-off-by: Rolando Trevino <122947376+rolotrealanis98@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
satchlj
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at c39b257d5985fe297d9eaa8314bf5235cabe3550
Blockers:
- PR structure (
pr-readinessPR text | no): add aTested:line and aRisk:line specifyingtwo-way/one-waydoor and affected Macs. - Exact-head hardware row (
pr-readinessHardware row at head | no): record the J716s hardware verification line referencing exact headc39b257d(the current description cites commit54bf2dfa9358on5a870d0f0b3f). - Connector-scope check (
drivers/gpu/drm/apple/iomfb.c):dcp_ext_mode_needs_unclocked_dsc()applies a blanket 25.92 Gb/s (4-lane HBR3 10bpc) cap to allapple,t6050-dcpextinstances lacking firmware clocks, including HDMI connectors. HDMI 2.1 FRL carries up to 48 Gb/s uncompressed (e.g., 4K@120 10bpc at ~35.6 Gb/s without DSC). Please confirm whether T6050 external HDMI engines also hit thegetClockFrequency(0)failure above 25.92 Gb/s (or whether the tested HDMI-A-1 240 Hz mode needed DSC only because the sink/link ran TMDS/HDMI 2.0), and either scope the cap to DP / TMDS links or explicitly document the HDMI 2.1 FRL trade-off inRisk:.
Checked: no Apple material, drivers/gpu/drm/apple/iomfb.c dcp_mode_valid() / dcp_mode_beyond_provider_clock() interaction, pr-readiness checks, PR text
Evidence
drivers/gpu/drm/apple/iomfb.c:dcp_ext_mode_needs_unclocked_dsc()returns true when!dcp->num_firmware_clocks && of_device_is_compatible(dcp->dev->of_node, "apple,t6050-dcpext") && (u64)clock_khz * 1000 * 30 > 25920000000ULL.- Non-blocking code notes:
- Consider checking
dcp->fw_compat == DCP_FIRMWARE_V_27_0(matchingdcp_mode_beyond_provider_clock()directly above) and checking whether an engine/firmware capability property can replace the SoC compatible check. - On 8bpc-only DP links, HBR3 carries up to 1,080 MHz uncompressed (vs 864 MHz at 30 bpp); acceptable as a conservative temporary bound while clocks are missing, worth noting if intentional.
- Consider checking
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c39b257d59
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| static bool dcp_ext_mode_needs_unclocked_dsc(struct apple_dcp *dcp, u32 clock_khz) | ||
| { | ||
| return !dcp->num_firmware_clocks && | ||
| of_device_is_compatible(dcp->dev->of_node, "apple,t6050-dcpext") && |
There was a problem hiding this comment.
Initialize the existing mode-validation fixture's device
With CONFIG_DRM_APPLE_DISPLAY_KUNIT_TEST enabled, parser_internal_v27_only_120hz() in parser-test.c allocates a zeroed apple_dcp but never assigns dcp->dev. Its first dcp_mode_valid() call has num_firmware_clocks == 0, so this new helper dereferences a null device and crashes the test before its assertions complete; the previous provider-clock check short-circuited on the empty clock table. Initialize the fixture's device, for example to its fake platform device, alongside this change so the existing display KUnit suite remains runnable.
Useful? React with 👍 / 👎.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Please verify the transport limits before calling this a DSC filter. At c39b257d5985, the new helper permits 864 MHz and rejects 864.001 MHz on any clockless T6050 external engine. A 650 MHz RGB mode at 10 bits per component passes the filter but needs 19.5 Gb/s, above the 12.96 Gb/s available on a two-lane HBR3 link. The cutoff also applies to HDMI, since the helper receives the engine and no connector information. It is an upper bound for four-lane HBR3 and does not tell whether a particular link will use DSC.
The missing row is J716s on firmware 27.3 at this head, with the same 2560×1600 display connected by USB-C DisplayPort. Please show 260 Hz is no longer offered, 165 Hz lights on both ports, and there are no new clock errors. Record the negotiated rate, lane count and bits per component. If the cap is kept for limited links or for HDMI, include a row that checks those routes too.
The arm64 make ARCH=arm64 LLVM=1 O=... -j8 W=1 drivers/gpu/drm/apple/iomfb.o build passed. A host check compiled the exact helper and verified the cutoff and the clocked/internal controls.
…ck cap The previous change capped an apple,t6050-dcpext without firmware clocks at what a four-lane HBR3 link carries uncompressed at 10 bits per component. That is only an upper bound: it lets through modes a narrower link compresses, and applies the same limit to HDMI. The firmware sends, with each timing of the connected display, the color elements that need DSC on its link (DSCRequiredColorElementIDs). On the J716s, for a 2560x1600 display on USB-C, it lists every element of 2560x1600@240 and @260 and none of the others. 260 Hz is the mode that stays black; 60 to 180 Hz run uncompressed. The parser already reads that list into the timing's color restrictions. Record whether the color element a mode uses is in it, and refuse those modes on such an engine instead of comparing the clock. Check external_processor before the compatible string, so a DCP without a device, as in the display KUnit tests, is not dereferenced: with the cap, parser_internal_v27_only_120hz oopsed in dcp_mode_valid(). Signed-off-by: Rolando Trevino <122947376+rolotrealanis98@users.noreply.github.com>
|
Thanks, you were right: the cap was an upper bound for one link, not a DSC test. Pushed 1660f80 on top. The firmware already says per timing which color elements need DSC on the connected link ( The J716s row at this head (same diff on the daily, firmware 27.3, the 2560x1600 display over USB-C DisplayPort):
Display KUnit: 206 passed, 1 skipped. W=1 |
There was a problem hiding this comment.
Verdict: MERGE at 1660f80
On a T6050 external engine with no firmware clocks, modes whose colour element the firmware itself lists in DSCRequiredColorElementIDs are no longer offered. Before, those modes came up black (J716s, 2560x1600@240/260). Uncompressed modes on the same display, internal panels, engines with a clock table and other SoCs are unchanged.
Checked:
parse_mode()setscolor_needs_dsconly when the timing's limits are known and the chosenbest_color_modeis inlimits.dsc_required, i.e. the firmware's per-timing list, not an assumed link budget. The tiled-half path drops the list, and the new KUnit case covers that.dcp_ext_mode_needs_unclocked_dsc()checksnum_firmware_clocksandexternal_processorbefore the compatible string, so a test DCP without a device no longer reachesof_device_is_compatible(the earlierparser_internal_v27_only_120hzoops). It returns MODE_CLOCK_HIGH, the same status the provider-clock limit uses.- CI is green at head. The author reports KUnit display 206 pass / 1 skip, W=1 clean, and the J716s row at this head on both USB-C ports (165/180 Hz uncompressed with picture, 240/260 Hz no longer offered, no new clock errors).
Follow-ups (not blocking):
- The
apple,t6050-dcpextcompatible check is the narrowest block property for now. Once someone sees DSC with no provider clock on another external engine, the condition can become just "no firmware clocks plus DSC-required colour element". - Readiness doesn't parse the J716s table as a row: a one-line
1660f805 J716s PASS ...comment would satisfy it.
The filter refused a timing when the parser's pick for it was DSC required. Over HDMI on the J716s that pick is 10-bit RGB (color element 88) for every 2560x1600 timing, and at 165 Hz the firmware lists 88 as DSC required but not 8-bit RGB (83), so 2560x1600@165 went away although it runs uncompressed. The same pick was also what a default color request set: 88 at 165 Hz, which this engine can only run compressed. A clockless T6050 external engine now asks for no DSC (dcp_color_request.no_dsc): the color selection skips DSC-required elements, the default SDR request included, and a timing is refused only when none of its safe SDR elements runs uncompressed. The parser's color_needs_dsc goes; the KUnit case checks the selection instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: rolotrealanis98 <122947376+rolotrealanis98@users.noreply.github.com>
|
Pushed
Hardware at
Trace of the firmware's color elements ( KUnit at |
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES at 86202c62a6059518f9f2ca71f0d58b84beb28a27
Blockers:
Failure: A full color cache can still send a DSC-required ID to the clockless engine. With one low-score DSC-required RGB10 default (ID 88) and 64 higher-scored uncompressed SDR entries, parser.c:655 drops ID 88 from the score-sorted cache, while parser.c:1180 still chooses it as the default RGB ID. dcp-color.h:339 returns false for an absent ID. The new fast path at dcp-color.h:380 then returns ID 88 under no_dsc, and the timing is admitted because the cache has other uncompressed SDR entries. The earlier head consulted the timing's DSC list directly. Preserve the restriction independently of the truncated color cache.
Failure: Commit 86202c62a6059518f9f2ca71f0d58b84beb28a27 contains a prohibited co-author attribution trailer. Please provide clean commit metadata on a fresh branch so the published history is preserved.
Checked: Compared the new revision against 1660f805, read the parser and request paths, and reproduced the cache-boundary behavior with the exact parser and selector helpers. The delta changes no DT files or board-specific rules. The reported J716s row covers the mixed-color timing on that display.
Evidence
With 63 other entries the cache retained ID 88 and no_dsc returned uncompressed ID 1. With 64 other entries the cache dropped ID 88, the same request returned ID 88, and the original timing restriction still marked it DSC-required. This was a host replay using synthetic timings.
|
@DjDeveloperr |
What: a T6050 external engine without firmware clocks never selects a color element the firmware lists as DSC required, and refuses a timing only when none of its SDR elements runs uncompressed.
Tested: J716s HDMI row at 86202c6 (in the comments), the USB-C rows below at 1660f80, KUnit, host tests and W=1.
Risk: two-way door. T6050 (M5)
apple,t6050-dcpextengines without clock-ids only; engines with a clock table, internal panels and other SoCs keep their color selection.Problem
On the J716s (M5 Pro, firmware 27.3) a USB-C display at 2560x1600@260 stays black. The dcpext firmware compresses that timing with DSC. The J716s ADT gives the dispext/dcpext engines no clock-ids, so the driver has no provider clock to answer the firmware with. The same display runs uncompressed at 60 to 180 Hz on both USB-C ports, and on HDMI at 165 Hz.
#3457's
dcp_mode_beyond_provider_clock()limits modes by the provider clock, but by design it skips a processor without a provider clock table, which is this case.Change
The firmware sends, with each timing of the connected display, the color elements that need DSC on its link (
DSCRequiredColorElementIDs). The parser already reads that list into the timing's color restrictions.parse_mode()now records whether the color element a mode uses is on it (color_needs_dsc). Anapple,t6050-dcpextwithout firmware clocks refuses those modes. Engines with a clock table, internal panels and other SoCs are unchanged.The first version capped such an engine at what a four-lane HBR3 link carries uncompressed at 10 bits per component. As review pointed out, that was only an upper bound: it let through modes a narrower link compresses and applied the same limit to HDMI. The second commit replaces the cap with the firmware's list. It also checks
external_processorbefore the compatible string: with the cap,parser_internal_v27_only_120hzoopsed on a test DCP without a device.Testing (at 1660f80)
J716s (MacBook Pro 16-inch, M5 Pro, firmware 27.3), kernel 7.3.0-g4b12f91447f1 = the J716s daily on main 0c502a2 with this change (same diff), Innoview 2560x1600 display (the firmware lists 2560x1600 timings up to 260 Hz; DSC 1.2a sink), USB-C DisplayPort:
DSCRequiredColorElementIDslists every color element of those two timings and none of any other. 1920x1080 at 240 and 260 Hz needs no DSC and is still offered.dptxport_call_set_link_ratetracepoint and theSET_ACTIVE_LANE_COUNTdebug line on each plug. bpc is the color element the firmware set (set_digital_out_mode ... colorID: 81) andmode_set_gated ... DSC=NO.getClockFrequency(0) (0) < videoClock ... Giving up on frequenciesat every mode set, uncompressed modes included. The daily without this change logs the same line at 179 Hz. No new clock errors. 0 WARN/Oops/SError.drivers/gpu/drm/apple/tests/display.kunitconfig(arm64 QEMU, LLVM): 206 passed, 1 skipped, 0 failed, including the newparser_color_needs_dscandparser_internal_v27_only_120hz.iomfb.oandparser.owith W=1: 0 warnings.