Skip to content

Comments

drm/vc4: Correct arithmetic for shifting between columns of SAND images#6730

Merged
pelwell merged 1 commit intoraspberrypi:rpi-6.12.yfrom
6by9:rpi-6.12.y-drm2
Mar 19, 2025
Merged

drm/vc4: Correct arithmetic for shifting between columns of SAND images#6730
pelwell merged 1 commit intoraspberrypi:rpi-6.12.yfrom
6by9:rpi-6.12.y-drm2

Conversation

@6by9
Copy link
Contributor

@6by9 6by9 commented Mar 19, 2025

Commit 69dbba7 ("drm/vc4: Add algorithmic handling for SAND") lost a multiplication by the tile width when doing the pointer arithmetic for cropping off columns for vc6.

Correct that computation.

@popcornmix - fixes your Kodi zooming on Pi5.

@popcornmix
Copy link
Collaborator

What about this line:

offsets[i] += pitch[i] * tile;

@HiassofT
Copy link
Contributor

A quick test on RPi5 shows that zooming the Interstellar trailer up to 1.10 works fine, but the display craps out with dlist errors when increasing to 1.11 zoom

@6by9
Copy link
Contributor Author

6by9 commented Mar 19, 2025

What about this line:

offsets[i] += pitch[i] * tile;

I was going to test Pi4 (which this line would affect), but checking the thread it had been reported as working fine there.
I'll test now.

@6by9
Copy link
Contributor Author

6by9 commented Mar 19, 2025

OK, so it does affect Pi4 too, but it just doesn't crash.
I'll update.

Commit 69dbba7 ("drm/vc4: Add algorithmic handling for SAND")
lost a multiplication by the tile width when doing the pointer arithmetic
for cropping off columns for vc6.

Correct that computation.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
@6by9 6by9 force-pushed the rpi-6.12.y-drm2 branch from c5098b3 to a3f6b48 Compare March 19, 2025 17:23
@HiassofT
Copy link
Contributor

Thanks, zooming on RPi4 looks fine now after the update.

But RPi5 still has the dlist issue.

Working: Zoom set to 1.10

rpi5:~ # cat "/sys/kernel/debug/dri/axi:gpu/hvs_dlist_allocs"
Allocated nodes:
node [00000020 + 0000000b]
node [0000002b + 0000000b]
node [00000036 + 00000024]
node [0000005a + 00000024]
node [0000007e + 00000024]
node [000000a2 + 00000024]
Stale nodes:
node [00000036 + 00000024] channel 0 frcnt 43
node [0000005a + 00000024] channel 0 frcnt 44

Not working, zoom set to 1.11, dmesg shows dlist errors

[  146.530547] vc4-drm axi:gpu: [drm] *ERROR* Failed to allocate DLIST entry. Requested size=36. ret=-28. DISPCTRL is 00002453
[  148.379828] vc4-drm axi:gpu: [drm] *ERROR* Failed to allocate DLIST entry. Requested size=36. ret=-28. DISPCTRL is 00002453
[  284.880697] vc4-drm axi:gpu: [drm] *ERROR* Failed to allocate DLIST entry. Requested size=10. ret=-28. DISPCTRL is 00002453
rpi5:~ # cat "/sys/kernel/debug/dri/axi:gpu/hvs_dlist_allocs"
Allocated nodes:
node [00000020 + 0000000b]
node [0000002b + 0000000b]
node [00000036 + 00000024]
node [0000005a + 00000024]
node [0000007e + 00000024]
node [000000a2 + 00000024]
node [000000c6 + 00000024]
node [000000ea + 00000024]
node [0000010e + 00000024]
node [00000132 + 00000024]
node [00000156 + 00000024]
node [0000017a + 00000024]
node [0000019e + 00000024]
node [000001c2 + 00000024]
node [000001e6 + 00000024]
node [0000020a + 00000024]
node [0000022e + 00000024]
node [00000252 + 00000024]
node [00000276 + 00000024]
node [0000029a + 00000024]
node [000002be + 00000024]
node [000002e2 + 00000024]
node [00000306 + 00000024]
node [0000032a + 00000024]
node [0000034e + 00000024]
node [00000372 + 00000024]
node [00000396 + 00000024]
node [000003ba + 00000024]
node [000003de + 00000024]
node [00000402 + 00000024]
node [00000426 + 00000024]
node [0000044a + 00000024]
node [0000046e + 00000024]
node [00000492 + 00000024]
node [000004b6 + 00000024]
node [000004da + 00000024]
node [000004fe + 00000024]
node [00000522 + 00000024]
node [00000546 + 00000024]
node [0000056a + 00000024]
node [0000058e + 00000024]
node [000005b2 + 00000024]
node [000005d6 + 00000024]
node [000005fa + 00000024]
node [0000061e + 00000024]
node [00000642 + 00000024]
node [00000666 + 00000024]
node [0000068a + 00000024]
node [000006ae + 00000024]
node [000006d2 + 00000024]
node [000006f6 + 00000024]
node [0000071a + 00000024]
node [0000073e + 00000024]
node [00000762 + 00000024]
node [00000786 + 00000024]
node [000007aa + 00000024]
node [000007ce + 00000024]
node [000007f2 + 00000024]
node [00000816 + 00000024]
node [0000083a + 00000024]
node [00000fd2 + 00000024]
Stale nodes:
node [00000fd2 + 00000024] channel 0 frcnt 2
node [00000036 + 00000024] channel 0 frcnt 3
node [0000005a + 00000024] channel 0 frcnt 4
node [0000007e + 00000024] channel 0 frcnt 5
node [000000a2 + 00000024] channel 0 frcnt 6
node [000000c6 + 00000024] channel 0 frcnt 7
node [000000ea + 00000024] channel 0 frcnt 8
node [0000010e + 00000024] channel 0 frcnt 9
node [00000132 + 00000024] channel 0 frcnt 10
node [00000156 + 00000024] channel 0 frcnt 11
node [0000017a + 00000024] channel 0 frcnt 12
node [0000019e + 00000024] channel 0 frcnt 13
node [000001c2 + 00000024] channel 0 frcnt 14
node [000001e6 + 00000024] channel 0 frcnt 15
node [0000020a + 00000024] channel 0 frcnt 16
node [0000022e + 00000024] channel 0 frcnt 17
node [00000252 + 00000024] channel 0 frcnt 18
node [00000276 + 00000024] channel 0 frcnt 19
node [0000029a + 00000024] channel 0 frcnt 20
node [000002be + 00000024] channel 0 frcnt 21
node [000002e2 + 00000024] channel 0 frcnt 22
node [00000306 + 00000024] channel 0 frcnt 23
node [0000032a + 00000024] channel 0 frcnt 24
node [0000034e + 00000024] channel 0 frcnt 25
node [00000372 + 00000024] channel 0 frcnt 26
node [00000396 + 00000024] channel 0 frcnt 27
node [000003ba + 00000024] channel 0 frcnt 28
node [000003de + 00000024] channel 0 frcnt 29
node [00000402 + 00000024] channel 0 frcnt 30
node [00000426 + 00000024] channel 0 frcnt 31
node [0000044a + 00000024] channel 0 frcnt 32
node [0000046e + 00000024] channel 0 frcnt 33
node [00000492 + 00000024] channel 0 frcnt 34
node [000004b6 + 00000024] channel 0 frcnt 35
node [000004da + 00000024] channel 0 frcnt 36
node [000004fe + 00000024] channel 0 frcnt 37
node [00000522 + 00000024] channel 0 frcnt 38
node [00000546 + 00000024] channel 0 frcnt 39
node [0000056a + 00000024] channel 0 frcnt 40
node [0000058e + 00000024] channel 0 frcnt 41
node [000005b2 + 00000024] channel 0 frcnt 42
node [000005d6 + 00000024] channel 0 frcnt 43
node [000005fa + 00000024] channel 0 frcnt 44
node [0000061e + 00000024] channel 0 frcnt 45
node [00000642 + 00000024] channel 0 frcnt 46
node [00000666 + 00000024] channel 0 frcnt 47
node [0000068a + 00000024] channel 0 frcnt 48
node [000006ae + 00000024] channel 0 frcnt 49
node [000006d2 + 00000024] channel 0 frcnt 50
node [000006f6 + 00000024] channel 0 frcnt 51
node [0000071a + 00000024] channel 0 frcnt 52
node [0000073e + 00000024] channel 0 frcnt 53
node [00000762 + 00000024] channel 0 frcnt 54
node [00000786 + 00000024] channel 0 frcnt 55
node [000007aa + 00000024] channel 0 frcnt 56
node [000007ce + 00000024] channel 0 frcnt 57
node [000007f2 + 00000024] channel 0 frcnt 58

@popcornmix
Copy link
Collaborator

But RPi5 still has the dlist issue.

Yes. But this PR fixes a clear bug and so is worth merging.
There is another bug, that hasn't been identified yet (I don't think it's related to the code altered here).

@HiassofT
Copy link
Contributor

Sure, I just noticed during testing that the dlist issue is still present and that the maximum working zoom seems to have changed from 1.20 before to 1.10 with this change and thought it's worth mentioning.

@6by9
Copy link
Contributor Author

6by9 commented Mar 19, 2025

As I wrote on Slack, I'm suspecting that the dlist issue is HVS underruns resulting in no EOF interrupts, and therefore no cleanup. That's nothing to do with this PR.

On Raspberry Pi OS I was zooming across the full range whilst playing Interstellar on a Pi5 8GB (C1), and had no issues.

@pelwell pelwell merged commit 8b62d7a into raspberrypi:rpi-6.12.y Mar 19, 2025
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Mar 25, 2025
kernel: fixup! dmaengine: dw-axi-dmac: Fixes for RP1
See: raspberrypi/linux#6729

kernel: drm/vc4: Correct arithmetic for shifting between columns of SAND images
See: raspberrypi/linux#6730

kernel: Adding Pisound Micro kernel module based on rpi-6.12.y
See: raspberrypi/linux#6731

kernel: Fix two more RP1 DMA bugs
See: raspberrypi/linux#6734

kernel: dts: bcm2712-rpi: Add uart0_nodma
See: raspberrypi/linux#6365
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Mar 25, 2025
kernel: fixup! dmaengine: dw-axi-dmac: Fixes for RP1
See: raspberrypi/linux#6729

kernel: drm/vc4: Correct arithmetic for shifting between columns of SAND images
See: raspberrypi/linux#6730

kernel: Adding Pisound Micro kernel module based on rpi-6.12.y
See: raspberrypi/linux#6731

kernel: Fix two more RP1 DMA bugs
See: raspberrypi/linux#6734

kernel: dts: bcm2712-rpi: Add uart0_nodma
See: raspberrypi/linux#6365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants