Comment 2 for bug 824506

Revision history for this message
Fathi Boudra (fboudra) wrote :

Here's the relevant thread on linaro-dev mailing list:

1. http://lists.linaro.org/pipermail/linaro-dev/2011-August/006962.html

There could be mis-use of the framebuffer's FBIOPUT_VSCREENINFO as a
way to update the screen instead of using FBIOPAN_DISPLAY. The former
ioctl could take significant amount of time re-calculating the timing
assuming resolution/color depth changes, and re-initializing the controller
for a new mode, and that could result in screen blinking. Please check
your Android code against this theory.

2. http://lists.linaro.org/pipermail/linaro-dev/2011-August/006965.html
> There could be mis-use of the framebuffer's FBIOPUT_VSCREENINFO as a
> way to update the screen instead of using FBIOPAN_DISPLAY.

That's exactly what Android does in a couple of places, e.g.
system/core/init/logo.c, function fb_update() [that one actually calls
FBIOPUT_VSCREENINFO _twice_ to update the screen]
hardware/libhardware/modules/gralloc/framebuffer.cpp, function fb_post

This should be fairly easy to fix, but googling it, I found an
explanation from an upstream engineer on why they're doing it that way
-- apparently on some graphics drivers, FBIOPAN_DISPLAY does smooth
panning, which obviously isn't what you want for a simple screen
refresh.

I'm definitely going to change it to see whether or not this is the
problem (and also to probably get a bit of a performance boost on
Panda) - but I wonder what hardware we're going to break with that.

Given other pieces of code (e.g. SDL) use FBIOPAN_DISPLAY for screen
refreshes, I think using that ioctl should be mostly safe.

> The former
> ioctl could take significant amount of time re-calculating the timing
> assuming resolution/color depth changes, and re-initializing the controller
> for a new mode, and that could result in screen blinking.

That is consistent with the messages I'm seeing in dmesg output.
Maybe (in addition to fixing userland) the driver should be a bit
smarter and not reinitialize the controller if it realizes the old and
new modes are actually the same, given Android is probably not the
only piece of code that uses FBIOPUT_VSCREENINFO, given apparently
some fb drivers interpret FBIOPAN_DISPLAY as something different...

3. http://lists.linaro.org/pipermail/linaro-dev/2011-August/006971.html

On 27 August 2011 21:45, Bernhard Rosenkranzer
<bernhard.rosenkranzer at linaro.org> wrote:
> That's exactly what Android does in a couple of places, e.g.
> system/core/init/logo.c, function fb_update() [that one actually calls
> FBIOPUT_VSCREENINFO _twice_ to update the screen]
> hardware/libhardware/modules/gralloc/framebuffer.cpp, function fb_post

I just changed it, and it works! We now have a really working display
on iMX53 Android. Thanks to everyone who helped!