Merge lp:~om26er/ubuntu/oneiric/compiz/perf-sru into lp:ubuntu/oneiric-proposed/compiz

Proposed by Omer Akram
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~om26er/ubuntu/oneiric/compiz/perf-sru
Merge into: lp:ubuntu/oneiric-proposed/compiz
Diff against target: 276 lines (+251/-0)
4 files modified
debian/changelog (+12/-0)
debian/patches/fix-764330.patch (+92/-0)
debian/patches/fix_slow_vsync_lp763005.patch (+145/-0)
debian/patches/series (+2/-0)
To merge this branch: bzr merge lp:~om26er/ubuntu/oneiric/compiz/perf-sru
Reviewer Review Type Date Requested Status
Ubuntu Sponsors Pending
Review via email: mp+92444@code.launchpad.net

Description of the change

merged Daniel's lp:~vanvugt/ubuntu/oneiric/compiz/fix-763005-oneiric with my branch for the fix of bug 764330

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This hasn't been merged at all. How do we fix the status?

Revision history for this message
Martin Pitt (pitti) wrote :

Set back to "needs review"

Revision history for this message
Sebastien Bacher (seb128) wrote :

it has been "merged":
https://launchpad.net/ubuntu/oneiric/+queue?queue_state=1&queue_text=compiz

I didn't bother using the vcs because launchpad import the package diffs when they packages are accepted by soyuz, but technically that has been uploaded and just need to be reviewed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-01-17 15:08:38 +0000
3+++ debian/changelog 2012-02-10 11:28:19 +0000
4@@ -1,3 +1,15 @@
5+compiz (1:0.9.6+bzr20110929-0ubuntu6.2) oneiric-proposed; urgency=low
6+
7+ [ Daniel van Vugt ]
8+ * Fix slow/stuttering display with fglrx (LP: #763005)
9+
10+ [ Omer Akram ]
11+ * debian/patches/fix-764330.patch:
12+ - Moving windows lags behind the mouse by 1-2 seconds;
13+ appear to freeze when dragging. (LP: #764330)
14+
15+ -- Omer Akram <om26er@ubuntu.com> Fri, 10 Feb 2012 16:11:19 +0500
16+
17 compiz (1:0.9.6+bzr20110929-0ubuntu6.1) oneiric-proposed; urgency=low
18
19 * debian/patches/fix_890947_synthetic_notifications.patch:
20
21=== added file 'debian/patches/fix-764330.patch'
22--- debian/patches/fix-764330.patch 1970-01-01 00:00:00 +0000
23+++ debian/patches/fix-764330.patch 2012-02-10 11:28:19 +0000
24@@ -0,0 +1,92 @@
25+=== modified file 'plugins/move/src/move.cpp'
26+--- a/plugins/move/src/move.cpp 2011-10-12 10:44:49 +0000
27++++ b/plugins/move/src/move.cpp 2012-02-08 05:06:13 +0000
28+@@ -487,20 +487,8 @@
29+ w->move (wX + dx - w->geometry ().x (),
30+ wY + dy - w->geometry ().y (), false);
31+
32+- if (ms->optionGetLazyPositioning () &&
33+- ms->hasCompositing &&
34+- !MoveWindow::get (ms->w)->mLocked)
35+- {
36+- /* FIXME: This form of lazy positioning is broken and should
37+- be replaced asap. Current code exists just to avoid a
38+- major performance regression in the 0.5.2 release. */
39+- w->serverGeometry ().setX (w->geometry ().x ());
40+- w->serverGeometry ().setY (w->geometry ().y ());
41+- }
42+- else
43+- {
44++ if (!ms->optionGetLazyPositioning ())
45+ w->syncPosition ();
46+- }
47+
48+ ms->x -= dx;
49+ ms->y -= dy;
50+@@ -508,32 +496,6 @@
51+ }
52+ }
53+
54+-/* FIXME: This is a hack to prevent a race condition
55+- * when core is processing ConfigureNotify events. It
56+- * MUST be removed after 0.9.6 when we can break ABI
57+- * and do lazy positioning correctly ! */
58+-
59+-void
60+-MoveScreen::handleCompizEvent (const char *plugin, const char *event, CompOption::Vector &options)
61+-{
62+- if (w)
63+- {
64+- if (std::string ("core") == std::string (plugin))
65+- {
66+- if (std::string ("lock_position") == std::string (event))
67+- {
68+- Window xid = CompOption::getIntOptionNamed (options, "window", 0);
69+- int lock = CompOption::getIntOptionNamed (options, "active", 0);
70+-
71+- if (xid == ROOTPARENT (w))
72+- MoveWindow::get (w)->mLocked = lock ? true : false;
73+- }
74+- }
75+- }
76+-
77+- screen->handleCompizEvent (plugin, event, options);
78+-}
79+-
80+ void
81+ MoveScreen::handleEvent (XEvent *event)
82+ {
83+
84+=== modified file 'plugins/move/src/move.h'
85+--- a/plugins/move/src/move.h 2011-09-28 14:15:21 +0000
86++++ b/plugins/move/src/move.h 2012-02-08 05:06:13 +0000
87+@@ -61,9 +61,6 @@
88+ void updateOpacity ();
89+
90+ void handleEvent (XEvent *);
91+- void handleCompizEvent (const char *plugin,
92+- const char *event,
93+- CompOption::Vector &options);
94+
95+ CompWindow *w;
96+ int savedX;
97+@@ -101,8 +98,7 @@
98+ PluginClassHandler<MoveWindow,CompWindow> (window),
99+ window (window),
100+ gWindow (GLWindow::get (window)),
101+- cWindow (CompositeWindow::get (window)),
102+- mLocked (false)
103++ cWindow (CompositeWindow::get (window))
104+ {
105+ if (gWindow)
106+ GLWindowInterface::setHandler (gWindow, false);
107+@@ -114,8 +110,6 @@
108+ CompWindow *window;
109+ GLWindow *gWindow;
110+ CompositeWindow *cWindow;
111+-
112+- bool mLocked;
113+ };
114+
115+ #define MOVE_SCREEN(s) \
116+
117
118=== added file 'debian/patches/fix_slow_vsync_lp763005.patch'
119--- debian/patches/fix_slow_vsync_lp763005.patch 1970-01-01 00:00:00 +0000
120+++ debian/patches/fix_slow_vsync_lp763005.patch 2012-02-10 11:28:19 +0000
121@@ -0,0 +1,145 @@
122+Description: Fix slow/stuttering display when sync to Vblank is enabled.
123+ For fglrx the cause appears to be an ATI/AMD driver bug where
124+ glXGetVideoSyncSGI and glXWaitVideoSyncSGI are particularly slow, so we
125+ can't afford to call both on every redraw or we end up with 1/3-1/2 framerate.
126+ For intel and really all drivers, another cause appears to be excessive
127+ waiting in the compiz architecture not allowing enough CPU time to draw the
128+ full frame before the next vertical refresh.
129+ This patch addresses both possible problems, providing optimal framerates
130+ with sync-to-vblank support, most of the time.
131+Author: Daniel van Vugt <vanvugt@gmail.com>
132+Bug-Ubuntu: https://launchpad.net/bugs/763005
133+
134+===================================================================
135+--- old/plugins/opengl/src/screen.cpp 2011-09-12 08:09:46 +0000
136++++ new/plugins/opengl/src/screen.cpp 2011-09-30 06:19:53 +0000
137+@@ -36,6 +36,9 @@
138+ #include <math.h>
139+
140+ namespace GL {
141++ typedef int (*GLXSwapIntervalProc) (int interval);
142++
143++ GLXSwapIntervalProc swapInterval = NULL;
144+ GLXBindTexImageProc bindTexImage = NULL;
145+ GLXReleaseTexImageProc releaseTexImage = NULL;
146+ GLXQueryDrawableProc queryDrawable = NULL;
147+@@ -234,6 +237,12 @@
148+ getProcAddress ("glXWaitVideoSyncSGI");
149+ }
150+
151++ if (strstr (glxExtensions, "GLX_SGI_swap_control"))
152++ {
153++ GL::swapInterval = (GL::GLXSwapIntervalProc)
154++ getProcAddress ("glXSwapIntervalSGI");
155++ }
156++
157+ glXMakeCurrent (dpy, CompositeScreen::get (s)->output (), priv->ctx);
158+
159+ glExtensions = (const char *) glGetString (GL_EXTENSIONS);
160+@@ -999,21 +1008,41 @@
161+ priv->lastViewport.height);
162+ }
163+
164++namespace GL
165++{
166++
167++void
168++waitForVideoSync ()
169++{
170++ if (GL::waitVideoSync)
171++ {
172++ // Don't wait twice. Just in case.
173++ if (GL::swapInterval)
174++ (*GL::swapInterval) (0);
175++
176++ // Docs: http://www.opengl.org/registry/specs/SGI/video_sync.txt
177++ unsigned int frameno;
178++ (*GL::waitVideoSync) (1, 0, &frameno);
179++ }
180++}
181++
182++void
183++controlSwapVideoSync (bool sync)
184++{
185++ // Docs: http://www.opengl.org/registry/specs/SGI/swap_control.txt
186++ if (GL::swapInterval)
187++ (*GL::swapInterval) (sync ? 1 : 0);
188++ else if (sync)
189++ waitForVideoSync ();
190++}
191++
192++} // namespace GL
193++
194+ void
195+ PrivateGLScreen::waitForVideoSync ()
196+ {
197+- unsigned int sync;
198+-
199+- if (!optionGetSyncToVblank ())
200+- return;
201+-
202+- if (GL::getVideoSync)
203+- {
204+- glFlush ();
205+-
206+- (*GL::getVideoSync) (&sync);
207+- (*GL::waitVideoSync) (2, (sync + 1) % 2, &sync);
208+- }
209++ if (optionGetSyncToVblank ())
210++ GL::waitForVideoSync ();
211+ }
212+
213+ void
214+@@ -1085,10 +1114,23 @@
215+
216+ targetOutput = &screen->outputDevs ()[0];
217+
218+- waitForVideoSync ();
219++ glFlush ();
220+
221++ //
222++ // FIXME: Actually fix the composite plugin to be more efficient;
223++ // If GL::swapInterval == NULL && GL::waitVideoSync != NULL then the
224++ // composite plugin should not be imposing any framerate restriction
225++ // (ie. blocking the CPU) at all. Because the framerate will be controlled
226++ // and optimized here:
227++ //
228+ if (mask & COMPOSITE_SCREEN_DAMAGE_ALL_MASK)
229+ {
230++ //
231++ // controlSwapVideoSync is much faster than waitForVideoSync because
232++ // it won't block the CPU. The waiting is offloaded to the GPU.
233++ // Unfortunately it only works with glXSwapBuffers in most drivers.
234++ //
235++ GL::controlSwapVideoSync (optionGetSyncToVblank ());
236+ glXSwapBuffers (screen->dpy (), cScreen->output ());
237+ }
238+ else
239+@@ -1096,6 +1138,7 @@
240+ BoxPtr pBox;
241+ int nBox, y;
242+
243++ waitForVideoSync ();
244+ pBox = const_cast <Region> (tmpRegion.handle ())->rects;
245+ nBox = const_cast <Region> (tmpRegion.handle ())->numRects;
246+
247+@@ -1151,7 +1194,7 @@
248+ bool
249+ PrivateGLScreen::hasVSync ()
250+ {
251+- return (GL::getVideoSync && optionGetSyncToVblank ());
252++ return (GL::waitVideoSync && optionGetSyncToVblank ());
253+ }
254+
255+ void
256+@@ -1159,7 +1202,8 @@
257+ {
258+ if (pendingCommands)
259+ {
260+- glFinish ();
261++ // glFlush! glFinish would block the CPU, which is bad.
262++ glFlush ();
263+ pendingCommands = false;
264+ }
265+ }
266+
267
268=== modified file 'debian/patches/series'
269--- debian/patches/series 2012-01-17 15:08:38 +0000
270+++ debian/patches/series 2012-02-10 11:28:19 +0000
271@@ -21,3 +21,5 @@
272 fix_890947_synthetic_notifications.patch
273 fix_focus_on_wrong_window_896762.patch
274 java_offset_frame_extents_878934.patch
275+fix_slow_vsync_lp763005.patch
276+fix-764330.patch

Subscribers

People subscribed via source and target branches

to all changes: