WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Review Request: Swap vsync order, trade in 1frame lag, try harder to detect nvidia framerate (recently broke here ; -)

Re: Review Request: Swap vsync order, trade in 1frame lag, try harder to detect nvidia framerate (recently broke here ; -)

by Martin Gräßlin :: Rate this Message:

| View in Thread

This is an automatically generated e-mail. To reply, visit: http://git.reviewboard.kde.org/r/103058/

On May 3rd, 2012, 8:46 a.m., Martin Gräßlin wrote:

kwin/scene.cpp (Diff revision 7)
void Scene::paintScreen(int* mask, QRegion* region)
162
#define LIE_ABOUT_TIME_DIFF 1
163
    if (!last_time.isValid()) {
163
    if (!last_time.isValid()) {
164
        // Painting has been idle (optimized out) for some time,
164
        // Painting has been idle (optimized out) for some time,
165
        // which means time_diff would be huge and would break animations.
165
        // which means time_diff would be huge and would break animations.
166
        // Simply set it to one (zero would mean no change at all and could
166
        // Simply set it to one (zero would mean no change at all and could
167
        // cause problems).
167
        // cause problems).
168
        time_diff = 1;
168
        time_diff = 1;
169
        last_time.start();
169
        last_time.start();
170
    } else
170
    } else
171
#if LIE_ABOUT_TIME_DIFF
172
        time_diff = last_time.restart() + wspace->nextFrameDelay();
173
#else
171
        time_diff = last_time.restart();
174
        time_diff = last_time.restart();
175
#endif
172
176
173
    if (time_diff < 0)   // check time rollback
177
    if (time_diff < 0)   // check time rollback
174
        time_diff = 1;
178
        time_diff = 1;
179
#undef LIE_ABOUT_TIME_DIFF
why this define?

On May 3rd, 2012, 3:44 p.m., Thomas Lübking wrote:

I think I raised the option to do this and we never defined whether to do or not, so i just added both variants.
The way it is we lie about the time which has actually passed to compensate the lagging frame (what makes the animation shorter but fix the time regarding the triggering event)

You can just pick one or i'll remove the dead branch before committing (and add a comment that we lie)
+1 for the lie. I think that makes more sense

On May 3rd, 2012, 8:46 a.m., Martin Gräßlin wrote:

kwin/scene_opengl_egl.cpp (Diff revision 7)
SceneOpenGL::SceneOpenGL(Workspace* ws)
63
#if 0
64
    // "theoretically".
65
    // - internet rumors say: it doesn't work with TBDR
66
    // - eglSwapInterval has no impact on intel GMA chips
67
    has_waitSync = options->glVSync;
68
    if (has_waitSync) {
69
        has_waitSync = (eglSwapInterval( dpy, 1) == EGL_TRUE);
70
        if (!has_waitSync)
71
            kWarning(1212) << "Could not activate EGL v'sync on this system";
72
    }
73
    if (!has_waitSync)
74
        eglSwapInterval( dpy, 0); // deactivate syncing
75
#else
76
    has_waitSync = false;
77
#endif
should it go in?

On May 3rd, 2012, 3:44 p.m., Thomas Lübking wrote:

I'll try on gles syncing tonight - drivers got eventually updated but according to fredrik this should actually be just forced on by all mesa drivers.
TBDR however can likely really not sync for principal reasons - do you have a PowerVR on some board?
If I have a PowerVR than not on a board where I could test. The PandaBoard comes with a TI chip IIRC.

- Martin


On April 21st, 2012, 6:11 p.m., Thomas Lübking wrote:

Review request for kwin and Martin Gräßlin.
By Thomas Lübking.

Updated April 21, 2012, 6:11 p.m.

Description

This performs a paint & glFlush immediately after the buffer swapping and defers the next swapping to the next anticipated frame (or idling)
The behavior is still not as deterministic as we hoped to be since we cannot measure the time for the actual vsync :\
I set a fuzzyness of 6ms what leads to a majority of 2-3ms times in waitsync but single wait times up to 8 or 9ms occur (what ultimately can be part of the syncing itself)

There's some debug code to print lagging.

TODO:
- attempt egl support
- probably lie to the effects about the time

Testing

I've used a CRT for testing which can sync every 11ms ie. 85Hz and lowered the maxFPS down to 10fps with pretty constant results for the time lost waiting for the sync.

Diffs

  • kwin/composite.cpp (6a27e00)
  • kwin/libkwineffects/kwinglutils_funcs.h (a2c047b)
  • kwin/libkwineffects/kwinglutils_funcs.cpp (6d79507)
  • kwin/options.h (4d37d8b)
  • kwin/options.cpp (6eabc78)
  • kwin/scene.h (c7e462f)
  • kwin/scene.cpp (450402e)
  • kwin/scene_opengl.h (98d4dd4)
  • kwin/scene_opengl.cpp (43d30ad)
  • kwin/scene_opengl_egl.cpp (d0ce360)
  • kwin/scene_opengl_glx.cpp (67400a8)
  • kwin/scene_xrender.h (98c4b3b)
  • kwin/scene_xrender.cpp (265825c)
  • kwin/workspace.h (0dcb29c)
  • kwin/workspace.cpp (a9deaaa)

View Diff


_______________________________________________
kwin mailing list
kwin@...
https://mail.kde.org/mailman/listinfo/kwin

 « Return to Thread: Review Request: Swap vsync order, trade in 1frame lag, try harder to detect nvidia framerate (recently broke here ; -)