Repository navigation
media: apple: scaler: fill alpha for XRGB32 like ARGB32 - #3217
Conversation
A Y'CbCr source converted to XRGB32 had the alpha fill (0x8c bit 31) off, while the same source converted to ARGB32 has it on. The engine writes four bytes per pixel for both formats. Without source alpha and with the fill off, nothing supplies the fourth component, and every Y'CbCr to R'G'B' job macOS runs in our capture has the fill on. XRGB32 was the one such job the driver programmed differently, and P010 to XRGB32 at 1280x720 times out on the M4 and the A18 Pro. Turn the fill on for any R'G'B' destination whose source has no alpha. An XRGB32 destination is now programmed write for write like ARGB32, and its fourth byte is 0xff like ARGB32's alpha. Every traced job keeps its register values: Y'CbCr destinations and sources with alpha leave the fill off as before. Add a KUnit case: for NV12, NV12M, P010, ARGB32 and XRGB32 sources, the XRGB32 job equals the ARGB32 job write for write, and the fill is on exactly when the source has no alpha. Refs: #3216 Signed-off-by: DjDeveloperr <[email protected]>
|
J773g (M4 Mac mini, T8132 scaler, MSR hardware-version 20) at How it was run: one boot of kernel main
So OLD and NEW differ only by this PR. Tools:
Kernel log over the A/B:
NEW was unloaded afterwards and the kernel's module reloaded. Then the Mac went back to the stock kernel, and the modules and kit were removed from it. |
|
Verdict at Blockers: none Checked:
Evidence
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 781c65a2
Blockers:
- Merge conflict (
CONFLICTING) againstmain; rebase onto currentmainand re-run CI (12 checks were cancelled at781c65a2). - Missing hardware row at head (
needs-hw-row).
Checked:
- Verified mergeability (
CONFLICTING), cancelled CI checks, andneeds-hw-rowstatus. - Deferred final approval until rebased cleanly onto
mainwith green CI and an exact-head hardware row.
Evidence
- Head
781c65a2vsmain:CONFLICTING; CI 7 passed, 12 cancelled.
Resolve apple-scaler-test.c: keep the XRGB32 job case from this branch beside the cases main added. Signed-off-by: DjDeveloperr <[email protected]>
There was a problem hiding this comment.
The forward merge retains the XRGB32 job test alongside main’s format additions. The earlier J700 and J773g results address the reported timeout and cover the unchanged XRGB32 conversion. Current build and KUnit checks remain pending. I am not asking for another hardware platform for this fix.
RyanTheTide
left a comment
There was a problem hiding this comment.
Reviewed the conflict-pass merge commit 6917308 only: single-file union, no hand edits. The resolution keeps what each side had and adds nothing outside the conflict. Approved for the merge-up; merging still waits on CI and the rows at this head.
There was a problem hiding this comment.
Verdict: MERGE at 691730862531
Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.
Checked: Code reviewed in the earlier App review at this head (6122660605).
Follow-ups (not blocking): current build and KUnit checks
|
J616s (MacBook Pro 14", M4 Pro, T6040) at |
|
Merging at |
What: XRGB32 output from a Y'CbCr source had the alpha fill off, unlike ARGB32. Every Y'CbCr to R'G'B' job macOS runs in our capture has the fill on, and P010 to XRGB32 at 1280x720 times out on the M4 and the A18 Pro (#3216). An XRGB32 destination is now programmed write for write like ARGB32. Fixes #3216.
Tested: the module and the KUnit object build W=1-clean (clang, arm64). The new KUnit case
asc_test_job_xrgbchecks the job against ARGB32 for five source formats. J700 (Neo) atf65e84d956d1, with #3204, in the combined candidate 7.3.0-neo-combined1126, which carries it unchanged: P010 to XRGB32 at 1280x720 completes (it times out on base). NV12 and P010 to XRGB32 give the same CRCs as to ARGB32, the other conversions match base, and nothing times out. 0 DART faults.Risk: two-way · M1 and M4 families and the Neo. Only XRGB32 output from a source without alpha changes (one register bit); every traced job keeps its register values.
Not yet: the M4 mini row (the same matrix with the old and new module).
Details
0x8cbit 31 is the alpha fill. It was set only when the destination has alpha and the source has none, so a Y'CbCr source written as XRGB32 had it off. The engine writes four bytes per pixel for XRGB32 as for ARGB32, and XRGB32 and ARGB32 share layout, code, sampling and swizzle words.asc_test_job,asc_test_job_lossless): NV12 to ARGB32 and P010 to ARGB32 have the fill on (0x8000ffff); ARGB32 to NV12 and NV12 to and from lossless have it off (0x0000ffff). The new rule, fill on for an R'G'B' destination whose source has no alpha, keeps all of them.0xff, as ARGB32's alpha is. So an XRGB32 conversion now has the same CRC as the ARGB32 conversion of the same input, which the row checks.Evidence
make M=drivers/media/platform/apple/scaler LLVM=1 W=1 modulesandapple-scaler-test.oagainst a configured 7.3 tree: no warnings.apple-scaler: CI at this head.