Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KMS stale dlist alloc changes #5684

Merged
merged 6 commits into from
Nov 6, 2023
Merged

Conversation

6by9
Copy link
Contributor

@6by9 6by9 commented Oct 26, 2023

#5674 "ERROR Failed to allocate DLIST entry: -28"

I haven't reproduced any failures, but have noted that we were getting stale allocs stuck for some time due to issues in the logic that freed them.

I have some reservations about actually disabling the HVS channel. It could be worked around by keeping an enabled state variable, but it feels nicer to actually clear the hardware. It needs a bit more testing to ensure we don't get the stuck pixel issue (not observed so far).

Currently not tested on a Pi5, hence draft PR.

@popcornmix
Copy link
Collaborator

I've been running this on kodi system for a couple of days without issue (but I wasn't getting the dlist error before).
Code changes look okay to me.

6by9 added 5 commits November 2, 2023 18:36
When factoring out __vc4_hvs_stop_channel, the logic got inverted from
	if (condition)
	  // stop channel
to
	if (condition)
	  goto out
	//stop channel
	out:
and also changed the exact register writes used to stop the channel.

Correct the logic so that the channel is actually stopped, and revert
to the original register writes.

Fixes: 6d01a10 ("drm/vc4: crtc: Move HVS init and close to a function")
Signed-off-by: Dave Stevenson <[email protected]>
The reset condition for the EMPTY flag in DISPSTATx is 0,
so seeing as we've just reset the pipeline there is no
guarantee that the flag will denote empty if it hasn't been
enabled.

Drop the WARN.

Signed-off-by: Dave Stevenson <[email protected]>
The code handling freeing stale dlists had 2 issues:
- it disabled the interrupt as soon as the first EOF interrupt
  occurred, even if it didn't clear all stale allocations, thus
  leading to stale entries
- It didn't free stale entries from disabled channels, so eg
  "kmstest -c 0" could leave a stale alloc on channel 1 floating
  around.

Keep the interrupt enabled whilst there are any outstanding
allocs, and discard those on disabled channels. This second
channel does require us to call vc4_hvs_stop_channel from
vc4_crtc_atomic_disable so that the channel actually gets stopped.

Signed-off-by: Dave Stevenson <[email protected]>
Users are reporting running out of DLIST memory. Add a
debugfs file to dump out all the allocations.

Signed-off-by: Dave Stevenson <[email protected]>
@6by9
Copy link
Contributor Author

6by9 commented Nov 2, 2023

Rebased and updated.
I've added one extra patch that logs the size of the allocation that failed, just to give more debug should there be further problems.

@6by9 6by9 marked this pull request as ready for review November 6, 2023 11:14
@pelwell pelwell merged commit 23ea21e into raspberrypi:rpi-6.1.y Nov 6, 2023
11 of 12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Nov 21, 2023
kernel: KMS stale dlist alloc changes
See: raspberrypi/linux#5684

kernel: drm/vc4: crtc: Support odd horizontal timings on BCM2712
See: raspberrypi/linux#5679

kernel: spi: dw-dma: Get the last DMA scoop out of the FIFO
See: raspberrypi/linux#5699

kernel: defconfigs: Drop FB_UDL from all Pi defconfigs
See: raspberrypi/linux#5702

kernel: RP1 GPIO header SDIO support
See: raspberrypi/linux#5704

kernel: ASoC: bcm: audioinjector_octo: Add soundcard owner
See: raspberrypi/linux#5705

kernel: drivers: media: imx708: Tweak broken line correction parameter
See: raspberrypi/linux#5701
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Nov 21, 2023
kernel: KMS stale dlist alloc changes
See: raspberrypi/linux#5684

kernel: drm/vc4: crtc: Support odd horizontal timings on BCM2712
See: raspberrypi/linux#5679

kernel: spi: dw-dma: Get the last DMA scoop out of the FIFO
See: raspberrypi/linux#5699

kernel: defconfigs: Drop FB_UDL from all Pi defconfigs
See: raspberrypi/linux#5702

kernel: RP1 GPIO header SDIO support
See: raspberrypi/linux#5704

kernel: ASoC: bcm: audioinjector_octo: Add soundcard owner
See: raspberrypi/linux#5705

kernel: drivers: media: imx708: Tweak broken line correction parameter
See: raspberrypi/linux#5701
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.

3 participants