Merge lp:~sil2100/compiz/workaround_770283 into lp:~compiz/compiz/ubuntu

Proposed by Łukasz Zemczak
Status: Merged
Merged at revision: 777
Proposed branch: lp:~sil2100/compiz/workaround_770283
Merge into: lp:~compiz/compiz/ubuntu
Diff against target: 152 lines (+132/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/series (+1/-0)
debian/patches/workaround_770283.patch (+123/-0)
To merge this branch: bzr merge lp:~sil2100/compiz/workaround_770283
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+102505@code.launchpad.net

Commit message

Adding fix for LP: #770283 as a distro patch. Started 1:0.9.7.6-0ubuntu2.

Description of the change

Introduces a workaround for LP: #770283 (see related branch). The patch will be merged upstream partially, with the actual usage of the workaround being added as a distro-patch. But until we have a new compiz tarball, we need to have the whole fix in the tree for an SRU.

After application of this fix, fglrx systems have working decoration updates. Non-fglrx systems have no visible side-effects. Tested on many fglrx systems and a few non-fglrx ones.

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Thanks Lukasz

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

FYI, workaround_770283.patch will likely break in compiz 0.9.7.8. Because *part* of the patch has now been merged upstream.

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-04-12 07:16:53 +0000
3+++ debian/changelog 2012-04-18 12:38:18 +0000
4@@ -1,3 +1,11 @@
5+compiz (1:0.9.7.6-0ubuntu2) UNRELEASED; urgency=low
6+
7+ * debian/patches/workaround_770283.patch:
8+ - Workaround a problem with fglrx not refreshing window decoration textures
9+ on pixmap modification (LP: #770283)
10+
11+ -- Łukasz 'sil2100' Zemczak <lukasz.zemczak@canonical.com> Wed, 18 Apr 2012 13:06:05 +0200
12+
13 compiz (1:0.9.7.6-0ubuntu1) precise; urgency=low
14
15 [ Didier Roche ]
16
17=== modified file 'debian/patches/series'
18--- debian/patches/series 2012-04-10 09:02:47 +0000
19+++ debian/patches/series 2012-04-18 12:38:18 +0000
20@@ -2,3 +2,4 @@
21 ccp_plugin.patch
22 workaround_broken_drivers.patch
23 fix_976467.patch
24+workaround_770283.patch
25
26=== added file 'debian/patches/workaround_770283.patch'
27--- debian/patches/workaround_770283.patch 1970-01-01 00:00:00 +0000
28+++ debian/patches/workaround_770283.patch 2012-04-18 12:38:18 +0000
29@@ -0,0 +1,123 @@
30+--- compiz-0.9.7.6.orig/plugins/decor/src/decor.cpp
31++++ compiz-0.9.7.6/plugins/decor/src/decor.cpp
32+@@ -317,44 +317,66 @@ DecorTexture::DecorTexture (Pixmap pixma
33+ pixmap (pixmap),
34+ damage (None)
35+ {
36++ if (!bindTexture (pixmap))
37++ return;
38++
39++ damage = XDamageCreate (screen->dpy (), pixmap,
40++ XDamageReportRawRectangles);
41++}
42++
43++/*
44++ * DecorTexture::~DecorTexture
45++ *
46++ * Remove damage handle on texture
47++ *
48++ */
49++
50++DecorTexture::~DecorTexture ()
51++{
52++ if (damage)
53++ XDamageDestroy (screen->dpy (), damage);
54++}
55++
56++/*
57++ * DecorTexture::indTexture
58++ *
59++ * This function actually takes and binds/rebinds the given Pixmap
60++ * to a texture (i.e. calls GLTexture::bindPixmapToTexture)
61++ *
62++ */
63++
64++bool
65++DecorTexture::bindTexture (Pixmap src)
66++{
67+ unsigned int width, height, depth, ui;
68+ Window root;
69+ int i;
70+
71++ pixmap = src;
72++
73+ if (!XGetGeometry (screen->dpy (), pixmap, &root,
74+ &i, &i, &width, &height, &ui, &depth))
75+ {
76+- status = false;
77+- return;
78++ status = false;
79++ return false;
80+ }
81+
82++ // Explicitly clear the texture list before binding/rebinding
83++ textures.clear ();
84++
85+ bindFailed = false;
86+ textures = GLTexture::bindPixmapToTexture (pixmap, width, height, depth);
87+ if (textures.size () != 1)
88+ {
89+ bindFailed = true;
90+- status = false;
91+- return;
92++ status = false;
93++ return false;
94+ }
95+
96+ if (!DecorScreen::get (screen)->optionGetMipmap ())
97+ textures[0]->setMipmap (false);
98+
99+- damage = XDamageCreate (screen->dpy (), pixmap,
100+- XDamageReportRawRectangles);
101+-}
102+-
103+-/*
104+- * DecorTexture::~DecorTexture
105+- *
106+- * Remove damage handle on texture
107+- *
108+- */
109+-
110+-DecorTexture::~DecorTexture ()
111+-{
112+- if (damage)
113+- XDamageDestroy (screen->dpy (), damage);
114++ return true;
115+ }
116+
117+ /*
118+@@ -2315,8 +2337,22 @@ DecorScreen::handleEvent (XEvent *event)
119+ {
120+ DECOR_WINDOW (w);
121+
122+- if (dw->wd && dw->wd->decor->texture == t)
123++ if (dw->wd && dw->wd->decor->texture == t) {
124++ /* XXX FIXME: dirty fglrx workaround here!
125++ (LP #770283) */
126++ /* If the damage is done on decoration, in case
127++ of fglrx we need to rebind the texture to see
128++ actual Pixmap changes */
129++
130++ XGrabServer (screen->dpy ());
131++ XSync (screen->dpy (), false);
132++
133++ t->bindTexture (t->pixmap);
134++
135++ XUngrabServer (screen->dpy ());
136++ XSync (screen->dpy (), false);
137+ dw->cWindow->damageOutputExtents ();
138++ }
139+ }
140+ }
141+ return;
142+--- compiz-0.9.7.6.orig/plugins/decor/src/decor.h
143++++ compiz-0.9.7.6/plugins/decor/src/decor.h
144+@@ -79,6 +79,8 @@ class DecorTexture {
145+ DecorTexture (Pixmap pixmap);
146+ ~DecorTexture ();
147+
148++ bool bindTexture (Pixmap src);
149++
150+ public:
151+ bool status;
152+ int refCount;

Subscribers

People subscribed via source and target branches

to all changes: