Repository navigation
tgl-display: the DMC's program loaded, PG3-PG5 down and DC6 allowed (stage 2) - #1132
Conversation
…stage 2) The display engine can enter DC5 and DC6 only with its context save and restore program loaded and every power well above PG2 off (Vol 12-12.21 "Sequences for Display C5 and C6"). The T14's GOP leaves PG1-PG4 requested and DC_STATE_EN at 0. `toyos-tgl-display` now embeds Intel's Tiger Lake DMC package, `i915/tgl_dmc_ver2_12.bin` from linux-firmware tag 20261019, unmodified and pinned by sha256 in NOTICE and the licence gate. LICENSE.i915 permits binary redistribution without modification, so an image that builds tgl-display carries its text under /system/share/licenses/. `dmc::Package::parse` reads the CSS header, the package header and every program the entries name, by the layouts Vol 12 "DMC Firmware Package" gives. It refuses a file that does not hold together, and a main program whose storage or header writes fall outside 80000h-8FFFFh. The main program is chosen for the display stepping that Vol 4 "Steppings and Device IDs" gives the function's PCI revision (9A49: 1h is C0, 3h is D0), with exceptions listed before defaults. `allow_display_c6` runs after the watermarks, on the one-plane scan-out `scanout` found: - it refuses a transcoder A on a DDI outside PG1, and VGA display on, since both need PG3; - it disallows DC states already allowed, since a DC5/DC6 switch goes through Disable and a reload; - it stores the payload, reads it back and makes the header's writes; - it withdraws the PG5, PG4 and PG3 requests and awaits each state (20 us, Vol 12 "Power Well"); - it sets 45520h[1:0] and allows up to DC6. Every refusal is by name, and DC6 is never allowed after one. Loading is MMIO in the iGPU's own BAR, with no DMA. The CSS header's key, modulus and exponent fields are "Not used" and 0 in this file, so nothing on record shows the engine verifies the program (issues/nothing-shows-the-tiger-lake-display-engine-verifies-its-dmc-program.md). With the pipe lit, DC5 is entered only while PSR is active, so this stage alone saves at most what PG3 and PG4 cost. The track now orders the compositor's present/damage piece of `display-output` before PSR, by the orchestrator's ruling, rather than an interim signal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review r1 of #1132 at
|
…ine, and the audio buffer off after PG3 - DC6 is allowed only with transcoder A on DDI A. Vol 12 "Sequence to Allow DC5 or DC6": "Ports A IO/PHY programming is preserved when DC6 is enabled. The programming for other combo PHY ports may not be." A panel on DDI B or C is refused by name. The DDI select read is logged with the allow, beside pipe A's frame counter, so a later reading shows the timing generator ran through it. - A power well's wait takes its verdict from a read made after the deadline. Before, a wait preempted past 20 µs while the well was still turning off was called held, and DC6 stayed disallowed under a false name. - AUDIO_PIN_BUF_CTL's enable is cleared after PG3 goes down, the step Vol 12 "Audio Bios Programming Sequence" pairs with it. The link-wakeup sequence also has the audio driver stop the iDisp link first. That needs `hda` and this driver to coordinate, so the track records it under display audio, with PG3's sharing. - The comments claimed every refusal leaves the firmware's state as found. What holds: a refusal before the load writes nothing, and none leaves DC6 allowed. - `allow_display_c6` drops its `Scanout` argument, which proved nothing. Its doc names the AUX and mode-set contract PSR will need. The DMC package doc no longer claims a version check it does not make, and a duplicate comment in main goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ugh it Review r1 of #1132 asks for one T14 boot showing `hda` and the panel unharmed by stage 2. This row's metalcase boot already runs tgl-display beside `hda`; what it lacked was order and the panel. - `tone_after_dc6` waits in this boot's log for tgl-display's DC6 allow, then plays `audio_tone`'s muted tone through `hda` to its end, so the analog codec is shown playing with PG3 down. A refusal of DC6 fails it by name. metalcase's test-runner now receives `volume`, which the muted tone needs. - tgl-display logs pipe A's frame counter at its first answered present. The judge holds it past the counter logged with the allow: the timing generator ran on after DC6 was allowed. - The judge requires DC6 allowed on DDI A with DC_STATE_EN 2. It says whether `hda` walked its codecs before or after PG3 went down. - `audio::tone_played` is `tone_on_metal` for any job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review r1, addressed at Required
Optional, all taken:
Checks: |
Review r2 of #1132 at
|
…owed A refusal before any write (a panel off DDI A, VGA on) leaves DC6 allowed where the firmware allowed it, so "no refusal leaves DC6 allowed" contradicted the sentence before it. What holds is that no refusal allows DC6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ugh it Review r1 of #1132 asks for one T14 boot showing `hda` and the panel unharmed by stage 2. This row's metalcase boot already runs tgl-display beside `hda`; what it lacked was order and the panel. - `tone_after_dc6` waits in this boot's log for tgl-display's DC6 allow, then plays `audio_tone`'s muted tone through `hda` to its end, so the analog codec is shown playing with PG3 down. A refusal of DC6 fails it by name. metalcase's test-runner now receives `volume`, which the muted tone needs. - tgl-display logs pipe A's frame counter at its first answered present. The judge holds it past the counter logged with the allow: the timing generator ran on after DC6 was allowed. - The judge requires DC6 allowed on DDI A with DC_STATE_EN 2. It says whether `hda` walked its codecs before or after PG3 went down. - `audio::tone_played` is `tone_on_metal` for any job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
The T14's display engine never enters DC5 or DC6. The GOP leaves:
0xff, so PG1-PG4 are requested and on, PG3 and PG4 for pipes that are off;Vol 12-12.21 "Sequences for Display C5 and C6" allows DC5/DC6 only when three things hold: the CSR program is loaded, PG3 and above are off, and 45520h[1:0] are set.
What this PR does
Stage 2 of
issues/each-gpu-drives-its-displays-from-a-userland-driver.md.i915/tgl_dmc_ver2_12.bin, from linux-firmware tag 20261019 (commita2dcb924f), unmodified.3c013ef0…f325afca, pinned inNOTICEand in the licence gate's row (LicenseRef-Intel-i915-Firmware, firmware-only).LICENSE.i915permits binary redistribution without modification, so an image that buildstgl-displaycarries the licence text under/system/share/licenses/.NOTICErecords that.dmc::Package::parsereads the CSS header, the package header and every program the entries name, by Vol 12 "DMC Firmware Package".allow_display_c6runs after the watermarks, on the one-plane scan-outscanout()found. It:nothing-shows-the-tiger-lake-display-engine-verifies-its-dmc-program.md: the CSSkeySize,modulusSizeandexponentSizeare "Not used" (Vol 12) and 0 in this file, and its CSSsizecovers the whole file. Nothing on record shows the engine verifies the program.display-outputis now ordered before PSR, rather than an interim signal.Decisions
0c004040 00010002, which are this payload's first two words. So the storage reads back, and the platform firmware had already loaded this program (an inference from two words).projectbytes read00 0c 00 00, while Vol 12's table prints0x000C0000. The byte order is ambiguous, so it is not checked.Checks
Review r1's fixes, at
aa618bbb7: host CI exit 0, 107 steps green;--build-onlyexit 0; 33 tests (2 new); three controls, exit 101 each. Evidence: https://github.com/ToyOSOrg/evidence/blob/41dbdb5c47719577570035a2f8a3acea8a1c1f33/r3/README.md. The T14 boot for hda and the panel is #1134'sdisplay_output_presents, staged on this head.At
b0c58dc88:All rerun at
b0c58dc88, after the session's first logs were lost. Evidence: https://github.com/ToyOSOrg/evidence/blob/20e336cae02e7fbff288325d326121f9792c23f2/r1/README.mdcargo run -- --ci host: exit 0, 107 steps green.cargo test -p toyos-tgl-display: 31 pass (12 new). The new tests cover:cargo run -- --build-only: exit 0. The image's bytes nameIntel-i915-firmware-license.txtonce.T14 boot
display-stage2-abdf14d21d6is this branch plus stage 1's named-only rowdisplay_energy, onbenchcase-display.toml. Image sha256d269de8b…ff95ea3b. The orchestrator ran it: exit 0, verdict passed. It is compared with stage 1's B rerun (d0dc7c34a). Evidence: https://github.com/ToyOSOrg/evidence/blob/0ba93921bc9556d74aa5359cd0eee1bef7502bbf/r2/README.mdtgl-display: DMC package 0002000c, main program 00010002 at 0x80000 for revision 0x01(C0).Risks
hdaand the display codec. PG3 holds audio, and the T14's HDA walks the display codec at address 2.hdareports a silent codec per codec without ending the link, so the analog codec should be unaffected (inference from code). The bench image has nohda, so this boot cannot show it. A boot of the system image with both drivers would. This risk stays open until display-output: the compositor presents to the display driver, and tgl-display answers at vblank (stage 3) #1134'sdisplay_output_presentsboot shows hda's tone played after DC6 is allowed. Vol 12's link-wakeup order (the audio driver stops the iDisp link before the pin buffer is cleared) needs hda's coordination, and is recorded under display audio.PowerWellHeld) and leaves DC6 disallowed.Integration tests
T14 only: this is the Tiger Lake display engine. The boot is the
display_energyrow from a measurement branch, because the driver holds its claim for the boot.🤖 Generated with Claude Code