DSC outputs garbage over DSI on SM8[12]50 boards
Context
After an initial batch of fixes Display Stream Compression works flawlessly on SDM845 with command mode panels. Unfortunately the same cannot be said for SM8[12]50-based boards/phones.
Even a second set of fixes (which doesn't affect SDM845) doesn't address the issues that we're seeing. On SM8150 the output is garbled, and it is unclear whether DPU is sending the wrong thing or the panel is configured wrongly to interpret it.
Source
The tree used for these devices lives at https://github.com/SoMainline/linux/commits/marijn/longbois-next, sometimes with various commits on top while testing possible solutions. This branch is frequently (force-)pushed to.
SM8150 (Sony Xperia 1)
(Note that DPU DTS for this platform hasn't yet been upstreamed; see https://github.com/SoMainline/linux/commits/33e40a4dd5b9a948742d2cc2e0ef3ee3bef317bf for an example. It does work flawlessly on the Xperia 5 including GPU, which is the same board but a smaller non-DSC screen)
The panel driver lives at https://github.com/SoMainline/linux/blob/marijn/longbois-next/drivers/gpu/drm/panel/panel-sony-griffin-samsung-4k-oled.c and its DTS with panel configuration at https://github.com/SoMainline/linux/blob/marijn/longbois-next/arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi.
This is what it looks like when booting into framebuffer console until it switched to msmdrmfb
. The first keypress is starting modetest -M msm -v -s 32:1096x2560
, the second is ctrl+c to make it clear and exit (note how it blanks the whole screen, which would have been half the screen before https://lore.kernel.org/linux-arm-msm/20221213232207.113607-5-marijn.suijten@somainline.org/).
20221221_174903_6624340978503571533
The DCS PPS sent to our panel is:
DSC params:11 00 00 89 30 80 0a 00 04 48 00 20 02 24 02 24
DSC params:02 00 02 13 00 20 03 1b 00 07 00 0c 03 19 03 1b
DSC params:18 00 10 e0 03 0c 20 00 06 0b 0b 33 0e 1c 2a 38
DSC params:46 54 62 69 70 77 79 7b 7d 7e 01 02 01 00 09 40
DSC params:09 be 19 fc 19 fa 19 f8 1a 38 1a 78 1a b6 2a f6
DSC params:2b 34 2b 74 3b 74 63 f4 00 00 00 00 00 00 00 00
DSC params:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
DSC params:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
(TODO: Compare this to downstream)
DPU immediately issues a timeout:
[ 0.986502] Console: switching to colour frame buffer device 137x160
[ 1.085300] [drm:dpu_encoder_frame_done_timeout:2402] [dpu error]enc31 frame done timeout
[ 1.085404] [drm:_dpu_encoder_phys_cmd_wait_for_idle] *ERROR* id:31 pp:0 kickoff timeout 2 cnt 1 koff_cnt 1
[ 1.085453] [drm:dpu_encoder_phys_cmd_prepare_for_kickoff] *ERROR* failed wait_for_idle: id:31 ret:-110 pp:0
[ 1.127538] msm_dpu ae01000.display-controller: [drm] fb0: msmdrmfb frame buffer device
And including an occasional dsi_err_worker: status=c
.
Full dmesg including MSM_DISP_SNAPSHOT_DUMP_IN_CONSOLE
from the first corrupted msmdrmfb
frame:
SM8250 (Sony Xperia 5II)
Will fill this in later. The panel driver Samsung SOFEF03-M) cannot be trusted yet, where I'm always left with a random combination of:
- Black screen;
- Frozen screen with the last framebuffer console;
- Frozen screen with a few red lines from top to bottom;
- Single DSC slice (half width of the screen, ~30 pixels high) somewhere on the screen atop the framebuffer console;
- Single-height DSC slices updating the topmost row (~30 pixels) of the panel;
- Screen times out on DCS commands (like brightness changes); or it replies and visually changes when the (OLED) screen isn't black;
Most of this is affected by playing with how we reset this panel, and whether or not to send the PPS and compression mode.
The DCS PPS sent to our panel is:
DSC params:11 00 00 89 30 80 09 d8 04 38 00 1e 02 1c 02 1c
DSC params:02 00 02 0e 00 20 02 e3 00 07 00 0c 03 50 03 64
DSC params:18 00 10 f0 03 0c 20 00 06 0b 0b 33 0e 1c 2a 38
DSC params:46 54 62 69 70 77 79 7b 7d 7e 01 02 01 00 09 40
DSC params:09 be 19 fc 19 fa 19 f8 1a 38 1a 78 1a b6 2a f6
DSC params:2b 34 2b 74 3b 74 63 f4 00 00 00 00 00 00 00 00
DSC params:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
DSC params:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
This is identical to downstream.
Full dmesg including MSM_DISP_SNAPSHOT_DUMP_IN_CONSOLE
, likely from the first msmdrmfb
frame but the panel remains black:
Bonus: tearcheck in INTF instead of PP block
Note that I am also finalizing my patches that bring INTF_TE support to DPU; these have been part of my tree at various stages of testing DSC but have not had any effect. As mentioned above they do fix tearing and odd framerates on all DPU >= 5.0.0 platforms including a Sony Xperia 5 (SM8150) with a regular non-DSC commandmode panel (same for SM6125 and a bunch of other boards/devices).