![]() |
2011-03-05
, 22:46
|
Posts: 110 |
Thanked: 127 times |
Joined on May 2010
|
#2
|
Another alternative I wanted to explore was reducing the LCD's refresh rate to 30hz, as this would reduce tearing even without frame sync. And there's no reason to have it any higher that I can think of.
![]() |
2011-03-05
, 23:22
|
Posts: 842 |
Thanked: 1,197 times |
Joined on May 2010
|
#3
|
The Following User Says Thank You to RobbieThe1st For This Useful Post: | ||
![]() |
2011-03-06
, 00:59
|
Posts: 842 |
Thanked: 1,197 times |
Joined on May 2010
|
#5
|
The Following User Says Thank You to RobbieThe1st For This Useful Post: | ||
![]() |
2011-03-06
, 01:27
|
Posts: 1,746 |
Thanked: 2,100 times |
Joined on Sep 2009
|
#6
|
But, erm... Some of us -like- Maemo. Meego's not debian-based, so it's at -least- one step below maemo.
![]() |
2011-03-06
, 02:59
|
Posts: 842 |
Thanked: 1,197 times |
Joined on May 2010
|
#7
|
The Following 6 Users Say Thank You to RobbieThe1st For This Useful Post: | ||
![]() |
2011-03-06
, 03:39
|
|
Posts: 2,355 |
Thanked: 5,249 times |
Joined on Jan 2009
@ Barcelona
|
#8
|
The Following 8 Users Say Thank You to javispedro For This Useful Post: | ||
![]() |
2011-03-06
, 07:33
|
Posts: 310 |
Thanked: 383 times |
Joined on Jan 2010
|
#9
|
![]() |
2011-03-06
, 07:40
|
Posts: 310 |
Thanked: 383 times |
Joined on Jan 2010
|
#10
|
Since you're trying...
Read:
http://lists.maemo.org/pipermail/mae...er/023281.html
Also, what you're proposing has been tried already:
http://maemo.gitorious.org/fremantle...9be0bac825e8c4
I at least pretty much agree with Eero here: vsync is a global problem that affects many applications, and cannot really be eliminated by editing just one of the pieces in the graphics stack: it has to be a coordinated effort.
In fact, you can easily see that there's still some tearing, albeit reduced, when removing hildon-desktop from the equation by either killing it or pressing Ctrl+Shift+N. While in this mode, you're neither using the SGX drivers, nor hildon-desktop, nor clutter, and yet there's still tearing that comes from Gtk+ and Xorg themselves.
Of course it is easier to fix in Meego, because Nokia now basically controls the toolkit.
I've been spending the last few days trying to reduce tearing on pannable widgets (ie. photo browser) and the desktop.
I'm just starting this thread as a placeholder; as I make progress I'll post updates here. And, of course, if anyone has any insight I'd appreciate it. I'm a C coder and have fairly extensive experience with Qt, but virtually none with gtk, gles, hildon, clutter, etc. If any experts on this stuff are reading this you'll no doubt cringe at my haphazard and uneducated approach to this.
So far I've identified an ioctl() that seems to wait for vsync.
I assumed it didn't exist, but after applying a kernel patch to implement FBIO_WAITFORVSYNC I found by Brian Swetland against drivers/video/omap, I realized that the n900 doesn't seem to use that driver at all. It seems to use the one under omap2.
In looking through omap2/omapfb/omapfb-ioctl.c I discovered OMAPFB_WAITFORVSYNC, which seems to work!
According to my quick test, it cycles ~60 times/second, which I would assume is the default frame rate while the device is active. Interestingly, when the screen is off, that rate drops dramatically (I assume for power saving).
Now, I inserted this ioctl() into hildon-pannable-area.c (hildon_pannable_area_timeout) just prior to gdk_window_process_updates (), just to see what would happen.
Unfortunately it didn't seem to have the desired effect. Now I don't know enough about what happens, so my guesses would be:
1. gdk_window_process_updates () doesn't actually block and swap frames; frame swapping is asynchronous
2. updates are so slow the frame swapping occurs between frames anyway
3. it's not double buffered, and updates take longer than one frame
Again, apologies if the answer is obvious and I'm off the mark.. I'm still learning.
In any case, it appears the hildon desktop uses clutter and its own method for panning (ie. not hildon-pannable-area), and it was the main thing I was trying to fix, I so put hildon-pannable-area on hold, and focused on clutter.
I assume clutter is using the eglx backend on the n900?
All I've done so far is implement OMAPFB_WAITFORVSYNC and some debug code in clutter_backend_egl_redraw(), but it doesn't seem to get called on the device. Still trying to figure this one out.
I know enabling WSEGL_UseHWSync is supposed to have some sort of effect but I don't really see it (still tears badly), and I can't find any references to that variable anywhere in hildon-desktop, except in the bundled hildon-desktop.ini.
Another alternative I wanted to explore was reducing the LCD's refresh rate to 30hz, as this would reduce tearing even without frame sync. And there's no reason to have it any higher that I can think of. I assume it's just a matter of adjusting the pixel clock/timings.
Anyway, if anyone has any insights or words of wisdom to share (like I'm going in completely the wrong direction), please do share.
Last edited by nightfire; 2011-03-05 at 22:20.