Skip to content

drm/apple: T6050: no DSC modes on an external engine without its provider clock - #4501

Merged
RyanTheTide merged 4 commits into
aurora-silicon:mainfrom
rolotrealanis98:pr/t6050-dcpext-unclocked-dsc-v2
Dec 5, 2026
Merged

RyanTheTide merged 4 commits into
aurora-silicon:mainfrom
rolotrealanis98:pr/t6050-dcpext-unclocked-dsc-v2

Conversation

@rolotrealanis98

@rolotrealanis98 rolotrealanis98 commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

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: at becfc13: KUnit dcp-display 349/350 (1 skipped), including the new full-cache case, which fails at the previous head; W=1 for drivers/gpu/drm/apple. J716s rows were taken at #3922's heads (HDMI at 86202c6, USB-C at 1660f80, in that PR); a row at this head follows.
Risk: two-way door. T6050 (M5) apple,t6050-dcpext engines without clock-ids only; engines with a clock table, internal panels and other SoCs keep their color selection.
Not yet: a J716s row at this head (USB-C and HDMI 2560x1600).

This replaces #3922 on a fresh branch from current main (that branch's history isn't rewritten), with the last review's finding fixed in the new top commit:

  • The no-DSC checks looked the default and PQ elements up in colors[], which keeps only the best 64 elements by score. A DSC-required default scored below 64 uncompressed SDR elements was missing from it, so the lookup said "no DSC" and the fast path handed it to the clockless engine. parse_mode() now records from the timing's own DSCRequiredColorElementIDs whether the default element (color_mode_dsc) and the PQ element (pq_dsc) need DSC, and the checks read those flags.
  • KUnit color_no_dsc_survives_full_cache builds exactly that case (64 uncompressed SDR elements, the DSC-required default and PQ elements outside the cache). With the old lookup it fails three expectations; with this commit it passes. parser_tiled_size_keeps_dsc_modes also checks color_mode_dsc follows the timing's list.

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 and flags those elements. On an apple,t6050-dcpext without firmware clocks, the color request carries no_dsc: the selection never picks a DSC-required element, so a timing whose default is 10-bit RGB but which also lists 8-bit RGB uncompressed runs on 8-bit RGB, and dcp_mode_valid() refuses a timing only when none of its SDR elements runs uncompressed (dcp_mode_has_dsc_free_sdr()). Whether the default and PQ elements need DSC is taken from the timing's own list at parse time (color_mode_dsc, pq_dsc). 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 replaced the cap with the firmware's list, the third moved from refusing a mode by its default element to keeping the selection off DSC-required elements (the HDMI 2560x1600@165 case), and the fourth fixes the color-cache lookup above. It also checks external_processor before the compatible string: with the cap, parser_internal_v27_only_120hz oopsed 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:

Port Link 2560x1600 offered Mode run bpc DSC Picture
front-left (ATC 1) HBR3 (0x1e), 4 lanes 180, 165, 144, 120, 60 Hz 165 Hz, then 180 Hz 8 (RGB, color element 81) no yes (owner)
right (ATC 2) HBR3 (0x1e), 4 lanes 180, 165, 144, 120, 60 Hz 165 Hz 8 (RGB, color element 81) no yes (owner)
  • 260 Hz (and 240 Hz) are no longer offered at 2560x1600. On both ports the firmware's DSCRequiredColorElementIDs lists 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.
  • Link rate and lane count are from the dptxport_call_set_link_rate tracepoint and the SET_ACTIVE_LANE_COUNT debug line on each plug. bpc is the color element the firmware set (set_digital_out_mode ... colorID: 81) and mode_set_gated ... DSC=NO.
  • Clock errors: on this engine the firmware logs getClockFrequency(0) (0) < videoClock ... Giving up on frequencies at 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.
  • The 2-lane and HDMI routes follow the same list. I haven't run a 2-lane link here; HDMI on this kernel was not retested.
  • KUnit drivers/gpu/drm/apple/tests/display.kunitconfig (arm64 QEMU, LLVM): 206 passed, 1 skipped, 0 failed, including the new parser_color_needs_dsc and parser_internal_v27_only_120hz.
  • iomfb.o and parser.o with W=1: 0 warnings.

…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>
…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>
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.

Signed-off-by: Rolando Trevino <122947376+rolotrealanis98@users.noreply.github.com>
…ming, not the color cache

dcp_select_color_mode() looked the timing's default SDR element and its PQ
element up in colors[] to see whether they need DSC. colors[] keeps only
the best DCP_MAX_COLOR_ENTRIES (64) elements by score, so a low-scored
DSC-required default (10-bit RGB, ID 88) below 64 uncompressed SDR
elements was not in it, the lookup answered "no DSC", and the fast path
handed ID 88 to an engine that cannot run DSC.

parse_mode() now records whether the timing's own
DSCRequiredColorElementIDs lists the default element (color_mode_dsc) and
the PQ element (pq_dsc), and the no_dsc checks read those flags.

KUnit color_no_dsc_survives_full_cache fills colors[] with 64 uncompressed
SDR elements and leaves the DSC-required default and PQ elements out of
it: with no_dsc the default request gets one of the 64 and the PQ request
is refused; without no_dsc both get the timing's own pick. It fails at
the previous head. parser_tiled_size_keeps_dsc_modes also checks that
color_mode_dsc follows the timing's list, including a tiled size that
clears it.

Signed-off-by: Rolando Trevino <122947376+rolotrealanis98@users.noreply.github.com>
@rolotrealanis98
rolotrealanis98 requested review from a team as code owners December 5, 2026 11:20
@github-actions github-actions Bot added area:display Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 5, 2026
@github-actions

github-actions Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Merge readiness at becfc13a: not ready yet

Check Detail
CI at head ok 4 checks passed
Review ok approved by satchlj
Requested changes ok none
Hardware row at head no no line with the head SHA becfc13a, a Mac and a result in the PR body or a comment
Conflicts ok not computed yet
PR text ok Risk: two-way · . T6050 (M5) apple,t6050-dcpext engines without clock-ids only; engines with a clock table, internal panels and other SoCs keep their color selection.

Areas: area:display

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at becfc13a5599 (code review only; J716s re-row at this head pending as noted in Not yet).

  • Scoping dcp_ext_unclocked() to external apple,t6050-dcpext engines without firmware clocks (!dcp->num_firmware_clocks && dcp->hw.external_processor) leaves clocked engines, internal panels, and other SoCs unchanged while avoiding null-dev derefs on internal test DCPs.
  • Recording color_mode_dsc and pq_dsc directly from limits.dsc_required in parse_mode() avoids relying on the 64-entry colors[] cache for the default SDR and PQ fast paths, and gating both fast paths and dcp_scan_color_modes() on req->no_dsc cleanly keeps timings with an uncompressed SDR element (e.g. 8-bit RGB alongside DSC 10-bit RGB) usable while dcp_mode_valid() rejects timings with no uncompressed SDR element.
  • KUnit color_no_dsc_picks_uncompressed and color_no_dsc_survives_full_cache cover both the mixed uncompressed/DSC case and the full-cache eviction edge case cleanly.

Verdict: APPROVE.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 5, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Hardware row at exact head becfc13a5599 — PASS across 2 distinct SoC families (K114s M5 Pro T6050 live external DP + J713 M4 T8132 non-regression, Aura 1.0.0b19, sysfw 27.2).

  • K114s (T6050, M5 Pro 14" OLED, Fedora 44) — guarded one-shot 7.3.0-trb-b8 (21529f5aec8d incl. #4501 becfc13a5599), boot_id=d9a0533f, SELinux=Enforcing, failed=0, 0 oops/DCP/GPU faults; speakers silent:
    • All 4 displays up cleanly: card1-eDP-1 (3024x1986), card1-DP-2 (1920x1080, 34 modes), card1-DP-6 (2560x1440, 34 modes), card2-HDMI-A-2 (1920x1080, 24 modes).
    • External engine 302e00000.dcp modeset verified cleanly without DSC: UnifiedPipeline::mode_set_gated: 2560x1440@280 Hz DSC=NO VRR=NO link: 1.
    • gpubench-vk: render.light d4 65,864 submits, compute.edge CRC 27c79e6d == 27c79e6d (valid: true); cleanly restored (boot_id=4948fe18, SELinux=Enforcing, failed=0).
  • J713 (T8132, MBA 13" M4, Fedora 45, non-regression) — guarded one-shot 7.3.0-trb-b8, boot_id=ed62e1f4, SELinux=Enforcing, failed=0, 0 faults: eDP-1 (2560x1664) + 2/2 rtc1 s2idle + post-wake GPU 9,810 submits (status: ok); cleanly restored (boot_id=fca1ec5e).
  • Trace: /Volumes/AuroraS500/traces/kernel/20261205-test-rows-b-batch8/{k114s,j713}-targeted.log (tainted: no).

@RyanTheTide
RyanTheTide merged commit 0dd2213 into aurora-silicon:main Dec 5, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:display Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants