From: <bug...@fr...> - 2010-04-14 11:14:40
|
https://bugs.freedesktop.org/show_bug.cgi?id=27628 Summary: glxgears prints bogus swap interval information Product: Mesa Version: git Platform: Other OS/Version: All Status: NEW Severity: normal Priority: medium Component: Demos AssignedTo: mes...@li... ReportedBy: msc...@re... Created an attachment (id=34997) View: https://bugs.freedesktop.org/attachment.cgi?id=34997 Review: https://bugs.freedesktop.org/review?bug=27628&attachment=34997 [PATCH] Initialize swap_interval to 0 $ glxgears Running synchronized to the vertical refresh. The framerate should be approximately 1/1920103026 the monitor refresh rate. The number is obviously nonsense. This is on current Fedora 13 (mesa-7.8.1-1.fc13). I looked into it and here's what I found: - glxgears gets this number using GLX_MESA_swap_control from glXGetSwapIntervalMESA(). - glXGetSwapIntervalMESA() calls into src/glx/dri2_glx.c:dri2GetSwapInterval() which returns priv->swap_interval - this value is not initialized. Valgrind agrees: ==25411== Conditional jump or move depends on uninitialised value(s) ==25411== at 0x402C9A: main (glxgears.c:619) Should pdraw->swap_interval be initialized to 0 in dri2CreateDrawable(), like in the attached patch? -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-04-14 11:16:50
|
https://bugs.freedesktop.org/show_bug.cgi?id=27628 Michal Schmidt <msc...@re...> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #34997|0 |1 is obsolete| | --- Comment #1 from Michal Schmidt <msc...@re...> 2010-04-14 04:16:42 PDT --- Created an attachment (id=34998) View: https://bugs.freedesktop.org/attachment.cgi?id=34998 Review: https://bugs.freedesktop.org/review?bug=27628&attachment=34998 [PATCH] Initialize swap_interval to 0 Sorry, attached wrong file before. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-04-14 14:16:20
|
https://bugs.freedesktop.org/show_bug.cgi?id=27628 Kristian Høgsberg <kr...@bi...> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #2 from Kristian Høgsberg <kr...@bi...> 2010-04-14 07:16:11 PDT --- Thanks, looks good. Committed: commit 0863c7e499a553c2d8e7bcbd09c5de88e396fcd0 Author: Michael Schmidt <msc...@re...> Date: Wed Apr 14 10:12:42 2010 -0400 Initialize DRI2 swap interval to 0 https://bugs.freedesktop.org/show_bug.cgi?id=27628 -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: <bug...@fr...> - 2010-04-14 16:10:34
|
https://bugs.freedesktop.org/show_bug.cgi?id=27628 --- Comment #3 from Jesse Barnes <jb...@vi...> 2010-04-14 09:10:27 PDT --- On Wed, 14 Apr 2010 17:57:07 +0200 Mario Kleiner <mar...@tu...> wrote: > Hmm. The patch inits mesa's local cached copy of swap_interval to > zero. The DRI2CreateDrawable() function inside the xserver's xserver/ > hw/xfree86/dri2/dri2.c implementation inits its own copy of > swap_interval to 1, at least in the DRI2 patch series of Jesse and > mine that is supposed be pulled of the next x-server release. > > So until client code calls glXSetSwapIntervalMESA() or > glXSetSwapIntervalSGI() the first time, the returned value will not > match the true setting. > > Either we need to match the defaults, or propagate the mesa setting > to the server at drawable creation time, or query the server's > setting to init mesa's copy. Yeah was just talking with Kristian about this. According to the SGI_swap_interval spec, the default value should be 1. For direct rendered clients we should probably just make them send a swap interval protocol request so that the server will match up and all will be in sync. That way we won't have to keep the server and mesa in sync by hand. I'll get to it later today unless Kristian already has a fix. -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. |
From: Mario K. <mar...@tu...> - 2010-04-14 16:31:40
|
Hmm. The patch inits mesa's local cached copy of swap_interval to zero. The DRI2CreateDrawable() function inside the xserver's xserver/ hw/xfree86/dri2/dri2.c implementation inits its own copy of swap_interval to 1, at least in the DRI2 patch series of Jesse and mine that is supposed be pulled of the next x-server release. So until client code calls glXSetSwapIntervalMESA() or glXSetSwapIntervalSGI() the first time, the returned value will not match the true setting. Either we need to match the defaults, or propagate the mesa setting to the server at drawable creation time, or query the server's setting to init mesa's copy. thanks, -mario On Apr 14, 2010, at 4:16 PM, bug...@fr... wrote: > https://bugs.freedesktop.org/show_bug.cgi?id=27628 > > Kristian Høgsberg <kr...@bi...> changed: > > What |Removed |Added > ---------------------------------------------------------------------- > ------ > Status|NEW |RESOLVED > Resolution| |FIXED > > --- Comment #2 from Kristian Høgsberg <kr...@bi...> > 2010-04-14 07:16:11 PDT --- > Thanks, looks good. Committed: > > commit 0863c7e499a553c2d8e7bcbd09c5de88e396fcd0 > Author: Michael Schmidt <msc...@re...> > Date: Wed Apr 14 10:12:42 2010 -0400 > > Initialize DRI2 swap interval to 0 > > https://bugs.freedesktop.org/show_bug.cgi?id=27628 > > -- > Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi? > tab=email > ------- You are receiving this mail because: ------- > You are the assignee for the bug. > ---------------------------------------------------------------------- > -------- > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Mesa3d-dev mailing list > Mes...@li... > https://lists.sourceforge.net/lists/listinfo/mesa3d-dev ********************************************************************* Mario Kleiner Max Planck Institute for Biological Cybernetics Spemannstr. 38 72076 Tuebingen Germany e-mail: mar...@tu... office: +49 (0)7071/601-1623 fax: +49 (0)7071/601-616 www: http://www.kyb.tuebingen.mpg.de/~kleinerm ********************************************************************* "For a successful technology, reality must take precedence over public relations, for Nature cannot be fooled." (Richard Feynman) |
From: Jesse B. <jb...@vi...> - 2010-04-14 16:10:30
|
On Wed, 14 Apr 2010 17:57:07 +0200 Mario Kleiner <mar...@tu...> wrote: > Hmm. The patch inits mesa's local cached copy of swap_interval to > zero. The DRI2CreateDrawable() function inside the xserver's xserver/ > hw/xfree86/dri2/dri2.c implementation inits its own copy of > swap_interval to 1, at least in the DRI2 patch series of Jesse and > mine that is supposed be pulled of the next x-server release. > > So until client code calls glXSetSwapIntervalMESA() or > glXSetSwapIntervalSGI() the first time, the returned value will not > match the true setting. > > Either we need to match the defaults, or propagate the mesa setting > to the server at drawable creation time, or query the server's > setting to init mesa's copy. Yeah was just talking with Kristian about this. According to the SGI_swap_interval spec, the default value should be 1. For direct rendered clients we should probably just make them send a swap interval protocol request so that the server will match up and all will be in sync. That way we won't have to keep the server and mesa in sync by hand. I'll get to it later today unless Kristian already has a fix. -- Jesse Barnes, Intel Open Source Technology Center |
From: Jesse B. <jb...@vi...> - 2010-04-19 16:57:54
|
On Wed, 14 Apr 2010 17:57:07 +0200 Mario Kleiner <mar...@tu...> wrote: > Hmm. The patch inits mesa's local cached copy of swap_interval to > zero. The DRI2CreateDrawable() function inside the xserver's xserver/ > hw/xfree86/dri2/dri2.c implementation inits its own copy of > swap_interval to 1, at least in the DRI2 patch series of Jesse and > mine that is supposed be pulled of the next x-server release. > > So until client code calls glXSetSwapIntervalMESA() or > glXSetSwapIntervalSGI() the first time, the returned value will not > match the true setting. > > Either we need to match the defaults, or propagate the mesa setting > to the server at drawable creation time, or query the server's > setting to init mesa's copy. Got distracted by other things last week, but the fix is pushed now to both 7.8 and master. commit 385e2896ebf54ac0b016132fe513f21a5b67ba4f Author: Jesse Barnes <jb...@vi...> Date: Mon Apr 19 09:54:08 2010 -0700 DRI2: synchronize swap interval with server at startup time -- Jesse Barnes, Intel Open Source Technology Center |