-
Notifications
You must be signed in to change notification settings - Fork 5.2k
DRM scaling filter "Nearest Neighbor" on YU12 / NV12 framebuffers looks wrong #6362
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
Comments
Can you post the original image? I can guess at what it should look like, but would be useful to confirm. It half looks like the chroma planes are getting scaled by twice the factor desired, but it's tricky to say for definite. At a guess I'd put it down to the SCALER_PPF_NOINTERP flag at https://github.com/raspberrypi/linux/blob/rpi-6.6.y/drivers/gpu/drm/vc4/vc4_plane.c#L617 Nearest neighbour is less useful for video planes - it's good for the blocky graphics of retro games emulation, but that's all going to be RGB rather than YUV. |
Sure. Sorry. Here you go: The bar at the bottom in both screenshots is a GL RGBA overlay rendering fine.
Not sure. Might take a moment to try it out. |
Here's the result of downscaling a FullHD video to 640x360:
|
Hmm, I think something is just totally wrong. Even RGB images are being scaled incorrectly for me on Pi4. On my system with HDMI-A-1, I get weird outputs using I'm going to have to check whether the filter actually works in the firmware. |
My early guess of the SCALER_PPF_NOINTERP bit appears to be correct. If enabled, then no scaling appears to happen. YUV 420 shows more issue as the luma and chroma planes have different scaling factors, so the colours are all totally wrong. Even without that flag, a x8 scaling ( @popcornmix Do you have any further knowledge on this? It was you who pointed out the interpolate flag on the original PR. I'm tempted to just drop the interpolate flag for now rather than investigate much further. |
I could have a look. I did implement a similar feature on the firmware side, which does set But that was a while ago (git says over ten years...) so it may take a while to work out what is needed. |
4k monitor, disabling the KMS driver and using
gives me a very blocky console (as expected). Now to extract the dlist to analyse.... |
Doh, operator precendence
Time for a pair of parenthesises. |
#6364 for the fix. |
Can confirm that it now works as expected. Thanks! |
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I toyed around with the new scaling filter feature recently added. Something weird is going on when using YU12 or NV12 framebuffers. Here's how it looks for a 560x320 video on a 640x480 display:
Here's the corresponding plane configuration:
This only happens when using
"Nearest Neighbor"
as scaling filter."Default"
works fine. It also doesn't seem to happen with RGBA framebuffers.Steps to reproduce the behaviour
Apply
"Nearest Neighbor"
value to the SCALING_FILTER property for a YU12 (software decoded H264) or NV12 (HW decoded HEVC) plane.I haven't tried to reproduce this on Bookworm because kernel 6.6.51 doesn't seem to be officially available yet via APT.
Device (s)
Raspberry Pi 5
System
Logs
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: