However, swapBuffers() doesn't actually seem to support PAGE_FLIP:
uint32_t EGLDisplaySurface::swapBuffers()
{
if (!(mFlags & PAGE_FLIP)) {
return 0;
}
....
}
If I add a memcpy() in there things seem to work correctly (at least
on the neo 1973).
Do I need to add this, or should non page flip work some other way?
Cheers,
Benno
Page flipping is a little odd. It actually does a scroll which can be
very noticeable on some graphics chips. It can have severe performance
issues as well. I think it was also incomplete in that it swapped
between video memory and allocated memory when flipping isn't supported.
At times, the allocated memory appeared to not get updated. I haven't
looked to see if that was fixed.
If you disable flipping altogether and just set the 2 array values to
the same buffer, then it works just fine. There are some small issues
left, though, with the dialogs. Lots of repainting you can see when it
blurs the background and pops up the dialog.
Yeah I noticed that. I'm not sure if Linux has a better way of
performing double buffering.
>I think it was also incomplete in that it swapped
> between video memory and allocated memory when flipping isn't supported.
That is what the set up code implies, but the page flip code is
stubbed out to return zero (as far as I can tell).
> At times, the allocated memory appeared to not get updated. I haven't
> looked to see if that was fixed.
>
> If you disable flipping altogether and just set the 2 array values to
> the same buffer, then it works just fine.
OK, that approach is possibly better doing the memcpy.
>There are some small issues
> left, though, with the dialogs. Lots of repainting you can see when it
> blurs the background and pops up the dialog.
That would be what I would expect.
I'll need to look at the 1973 hardware to see if there is a way of
implementing double buffering with hopefully just a register write.
(Or maybe I'll just get a freerunner and be done with it :)
Cheers,
Benno
We haven't been doing any development on hardware without pageflipping
support. On the emulator and msm7k ports, the pan operation we use to
flip works well, but I think this is another area where we're going to
have to build some more flexibility into the system -- obviously what's
there now is not working everywhere and I suspect there may not be just
two options (flip/no-flip), but some variation in how flipping is handled.
Brian
One thing on my list that will significantly improve the user experience
with the Freerunner is to use some of its coprocessors. For instance, it
has an openGL capable graphics chip that would help. It also has an mp4
decoder that would smooth out the video quite nicely. Right now it is a
little blocky.
Not to mention it has Wifi. I forget if the gta01 has accelerometers,
but its nice to have video flip over when you turn the phones orientation.
> Cheers,
>
> Benno
>
> >
>
On 2008/11/02, at 14:01, Brian Swetland wrote:
> We haven't been doing any development on hardware without pageflipping
> support. On the emulator and msm7k ports, the pan operation we use to
> flip works well, but I think this is another area where we're going
> to
> have to build some more flexibility into the system -- obviously
> what's
> there now is not working everywhere and I suspect there may not be
> just
> two options (flip/no-flip), but some variation in how flipping is
> handled.
That reminds me... when looking at the i.MX31 fb flickering problem a
while ago, I noticed that android was using FBIOPUT_VSCREENINFO (which
calls fb_set_par etc along with fb_pan_display) instead of
FBIOPAN_DISPLAY to flip the display. Any ideas on the reason for doing
it that way?
Now that I have the code(!), it seems just swapping to FBIOPAN_DISPLAY
will work ok, so I might give that a try next week.
If it's using the s3c24x0's lcd controller, you could do it by messing
with LCDBASEU/LCDBASEL in the LCDSADDR1/2 registers.
Matt
As far as I can tell, it isn't suppose to provide immediate refresh of
the screen, so there are graphics chips that smoothly move to the
alternate graphical area. On the Openmoko GTA01, you can see what looks
a little like a shift in the view and the top bar is ghosted near the
bottom of the display. On the Openmoko GTA02, it just runs exceedingly
slow. I'm not sure if it is the Glamo chip or the driver. I'll have to
check with my companion, but during early development we saw problems on
the TI OMAP2-Zoom reference flatform as well.
>
>> It can have severe performance
>>
>
> Can you precise in which scenarios it can have a severe performance
> impact?
>
On the GTA02, all graphics are slowed down significantly. The world time
zone, for instance, it is practically unbearable.
>
>> issues as well. I think it was also incomplete in that it swapped
>> between video memory and allocated memory when flipping isn't supported.
>> At times, the allocated memory appeared to not get updated. I haven't
>> looked to see if that was fixed.
>>
>> If you disable flipping altogether and just set the 2 array values to
>> the same buffer, then it works just fine.
>>
>
> This will cause flickering and tearing, unfortunately; which is not
> acceptable for games or animations in the UI.
>
Indeed. Also, as mentioned below dialogs don't work well either.
>
>> There are some small issues
>> left, though, with the dialogs. Lots of repainting you can see when it
>> blurs the background and pops up the dialog.
>>
>
> This is why a memcpy() is unfortunately, needed when page flipping is
> not supported in hardware. The assumption here, is that hardware
> manufacturers control their drivers and will implement the features
> needed for proper graphics quality and performance.
>
It also assumes what scrolling the display buffer will do. I should
think this is accepted practice that if you have a duplicate screen size
not viewed you might expect it should not do a smooth transition, but
instantly switch buffers. This is not, however, what the definition of
panning is. To pan is to transition over time. It is typically used to
allow for a larger graphics area that is written and you can move your
viewing port around that area.
> Mathias
>
>
>
> >
>
This is irrelevant on Freerunner now as I've implemented page flipping
in the kernel. I still have to change to use FBIOPAN_DISPLAY, though, as
the other ioctl does a complete refresh of settings and causes flashing.
Sounds good.
Eventually, we'll need to abstract this out because there is no way to
know which ioctl to use. And in fact, one could imagine a board
without a /dev/graphics/fb driver at all. It sounds more and more like
a good candidate for the upcoming hardware abstraction layer.
mathias
Sure, I think it is still worth fixing for people porting to other
platforms. Either the code should be fixed, or things should error out
much earlier if the drivers doesn't have the correct capabilities.
Cheers,
Benno