sm8150-common: Patch kona codec2 for legacy 128x32 alignment

Note: values were taken from stock msmnile codec2 using ghidra.

on kona platforms or newer or older, if IsCameraCustomFormat fails c2 enforces 512x512 alignment.
after this patch with IsCameraCustomFormat disabled on legacy CamX,
incoming buffers retain standard Venus 128x32 alignment.

ONCE again patched using my shitty py script instead of extract-files.py

1. qc2::QC2Buffer::Graphic::GetAlignedHeight
   - File_Offset: 0x138D2
   - Assembly:
     0x138D2: 00 F2 FF 11 -> 00 F2 1F 01  ; addw r1, r0, #0x1f
     0x138D6: 40 F2 FF 12 -> 40 F2 1F 02  ; movw r2, #0x1f
   - ALIGN(h, 512) -> ALIGN(h, 32)

2. qc2::QC2Buffer::Graphic::GetAlignedWidth
   - File_Offset: 0x1397C
   - Assembly:
     0x1397C: 00 F2 FF 11 -> 00 F2 7F 01  ; addw r1, r0, #0x7f
     0x13980: 40 F2 FF 12 -> 40 F2 7F 02  ; movw r2, #0x7f
   - ALIGN(w, 512) -> ALIGN(w, 128)

Change-Id: I154b556cbefdbbd47a6c315d38fb468aed39f1b7
Signed-off-by: duckyduckg <duckyduckg65@gmail.com>
This commit is contained in:
duckyduckg committed 2026-09-29 04:20:57 +05:00
1 parent ea25de8f25
commit 6dd86febf6
1 file changed
Vendored Regular → Executable
BIN
View File
Binary file not shown.