Skip to content

drm: vc4: Fix pixel-wrap issue with DVP teardown - #4410

Merged
pelwell merged 1 commit into
raspberrypi:rpi-5.10.yfrom
timg236:pi4-kms-pixelwrap
Jun 25, 2021
Merged

pelwell merged 1 commit into
raspberrypi:rpi-5.10.yfrom
timg236:pi4-kms-pixelwrap

Conversation

@timg236

@timg236 timg236 commented Jun 24, 2021

Copy link
Copy Markdown
Contributor

@popcornmix @mripard @6by9

Experimental patches to avoid the dreaded pixel wraparound bug (not really a PR!)

Tweak the order of operations to match the VC firmware.
On C0 use dedicate HW assisted fix

Previously, with a Dell 4K monitor (p30) it would fail nearly every reboot. Now it only seems to fail in a mode-test when switching from an interlaced mode back to a regular mode.

Test on Pi4B 1.1

Comment thread drivers/gpu/drm/vc4/vc4_hdmi.c Outdated
VC4_HDMI_FIFO_CTL_RECENTER_DONE, 1);
WARN_ONCE(ret, "Timeout waiting for "
"VC4_HDMI_FIFO_CTL_RECENTER_DONE");
for (i = 0; i < 0; i++) { // Once again, with feeling

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's an odd looking loop. It looks more like "Really, don't bother"!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, must have pressed undo before merging. It probably is required but I guess the other changes are the sigificant ones

@popcornmix

Copy link
Copy Markdown
Collaborator

In my testing I'm using:

modetest -M vc4 -F tiles,gradient -s 32:1920x1080-60 -P91@76:3840x2160+0+0@XR24

with a desktop mode of 1920x1200@59.95.
It appears to be reliably failing (1 pixel wrap) with default kernel tree.
It looks like purely taking the diffs that affect HDMI_VID_CTL from this PR makes it reliably work (no wrap).

@popcornmix

Copy link
Copy Markdown
Collaborator

The mdelay appears to be essential. This patch is fixing my failure case (but there may be other cases)
https://paste.ubuntu.com/p/G5rhN6RGhh/

@timg236

timg236 commented Jun 24, 2021

Copy link
Copy Markdown
Contributor Author

That's interesting. I'm trying this on a Pi400 with the C0 fix nobbled and drift FIFO restored. Brain failure earlier made me save a different experimental hack!

@timg236
timg236 force-pushed the pi4-kms-pixelwrap branch from f23a7ca to f78bd48 Compare June 24, 2021 20:56
@timg236

timg236 commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

I ran the second version of my patch overnight in a mode-test loop and it fixed the wraparound issue. I suspect the HVS changes aren't required (i.e. same as patch from @popcornmix), so we should probably just merge the minimal changes and see how that goes.

mode-test.zip

Adjust the DVP enable/disable sequence to avoid a pixel getting stuck
in an internal, non resettable FIFO within PixelValve when changing
HDMI resolution.

The blank pixels features of the DVP can prevent signals back to
pixelvalve causing it to not clear the FIFO. Adjust the ordering
and timing of operations to ensure the clear signal makes it through to
pixelvalve.

Signed-off-by: Tim Gover <tim.gover@raspberrypi.com>
@timg236
timg236 force-pushed the pi4-kms-pixelwrap branch from f78bd48 to 6feeb22 Compare June 25, 2021 08:09
@timg236

timg236 commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

Removed the HVS code and retested

@timg236 timg236 changed the title WIP: drm: vc4: Reduce the likelyhood of the pixel wraparound bug drm: vc4: Fix pixel-wrap issue with DVP teardown Jun 25, 2021
@pelwell
pelwell merged commit 2be20d0 into raspberrypi:rpi-5.10.y Jun 25, 2021
@popcornmix

Copy link
Copy Markdown
Collaborator

I removed the kodi workaround last night and ran with this form of patch and didn't see the one pixel wrap.
@HiassofT could you test LE with this PR and 1 pixel workaround reverted?

@timg236

timg236 commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

N.B. I think tearing down some low-resolution interlaced modes could still fail (specifically 720x576i). However, other higher resolution interlaced modes are fine e.g. 1080i

@popcornmix

Copy link
Copy Markdown
Collaborator

Does a smaller (or larger) delay affect the low resolution modes?

@timg236

timg236 commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

Does a smaller (or larger) delay affect the low resolution modes?

No, but this exiting from 720x576i mode triggers the wrap around on FKMS as well

@alanbork

alanbork commented Jul 3, 2021

Copy link
Copy Markdown

is this only for a single pixel or the whole line? because I'm still seeing a whole line wrap around, also tending to be triggered by use of interlaced modes, with no fix as of f29ab05611eef385d17675c77190df0b87a0d456.

https://www.youtube.com/watch?v=Qc9BDV9Dssk

@popcornmix

Copy link
Copy Markdown
Collaborator

Yes, this is the same 1-pixel wrap issue, and was mentioned in @tim236's preceding post as still being present (on kms and fkms) when exiting 720x576i (and also other SD interlaced modes).
We don't have a fix for that.

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.

5 participants