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

plymouth-lite: add bilinear interpolation patch #353

Closed
wants to merge 1 commit into from

Conversation

Kwiboo
Copy link
Member

@Kwiboo Kwiboo commented May 16, 2016

This PR should enhance boot splash image resize quality (makes our RasPlex boot splash look better when resized)

  • Use bilinear interpolation when resizing image (backport from plymouth)
  • Only resize image when image and frame buffer has different size

@popcornmix
Copy link
Contributor

Might be worth timing this on a slow platform like Pi 1.
Looks quite expensive.

@Kwiboo
Copy link
Member Author

Kwiboo commented May 16, 2016

@popcornmix You are correct, it is quite expensive on Pi 1, running with arm_freq=950:

# time ./ply-image ./splash-full.png
real    0m 0.37s
user    0m 0.32s
sys     0m 0.04s

# time ./ply-image-bilinear ./splash-full.png
real    0m 2.72s
user    0m 2.67s
sys     0m 0.04s

@popcornmix
Copy link
Contributor

There is an alternative to this.
If, say, splash screen is 1024x768 and display resolution is 1920x1080,
then running:

fbset -xres 1024 -yres 768 -depth 32
./ply-image ./splash-full.png

Should get you a resized splash screen using high quality (cubic) hardware resizing, and will be much faster.

@Kwiboo
Copy link
Member Author

Kwiboo commented May 16, 2016

Thanks, I will change frame buffer size to match image in RasPlex.
Using the change to skip resize when image match frame buffer also makes it faster:

# fbset -xres 1280 -yres 720 -depth 32

# time ./ply-image ./splash-full.png
real    0m 0.22s
user    0m 0.19s
sys     0m 0.02s

# time ./ply-image-bilinear ./splash-full.png
real    0m 0.15s
user    0m 0.12s
sys     0m 0.02s

@Kwiboo
Copy link
Member Author

Kwiboo commented May 17, 2016

Using a distributions/RasPlex/splash/splash.conf-file containing fbset -xres 1280 -yres 720 -depth 32 together with this patch worked out great for our RasPlex splash needs.
This lets our Pi distro use fast hardware resizing while our other distro/projects uses software bilinear.

A projects/RPi/splash/splash.conf with fbset -xres 1920 -yres 1080 -depth 32 could be useful for LibreELEC to make use of the faster hardware resizing for the RPi project. Or is it a bad idea to force the frame buffer size?

@MilhouseVH
Copy link
Contributor

MilhouseVH commented May 17, 2016

Or is it a bad idea to force the frame buffer size?

Yes, I think so - you could be forcing the framebuffer to a resolution the display/monitor doesn't support, which would either fail (leaving you with the default resolution, which may require scaling) or worst case no working display/frame buffer at all.

I think if bilinear resizing is too slow on low-end hardware then it shouldn't be used, ie. disable at compile time.

@popcornmix
Copy link
Contributor

On Pi forcing fbset framebuffer to match the size of the splash should be fine.
Even if the framebuffer is 1920x1080 and the display is 640x480 it will work just fine, with the hardware resizing the image down.

@lrusak
Copy link
Member

lrusak commented May 20, 2016

any updates here?

@chewitt
Copy link
Member

chewitt commented Jun 1, 2016

Has this been tweaked to avoid performance issues on pi and is a safe/good thing to merge? ..or?

@MilhouseVH
Copy link
Contributor

After #381 is this still required?

After reviewing the earlier conversation, one thing I notice is that if splash.conf is to be used to force a specific frame buffer resolution then we might want to move the resolution parsing added by #381 so that it occurs after splash.conf is loaded.

I can PR this change if kwiboo requires it, otherwise setting SPLASHIMAGE in splash.conf should work.

@Kwiboo
Copy link
Member Author

Kwiboo commented Jun 1, 2016

It is possible that #381 will solve my resize issue but I haven't had time to test it out yet.

The rasplelx distro due to be released next week is based on libreelec-7.0 where I use the patch from this PR together with a custom splash.conf to solve our resizing issue.

We can close this PR for now, I will revisit this once I rebase our distro on master.

@MilhouseVH MilhouseVH closed this Jun 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants