Merge lp:~vanvugt/compiz/fix-1026920 into lp:compiz/0.9.9

Proposed by Daniel van Vugt
Status: Merged
Approved by: Sam Spilsbury
Approved revision: 3514
Merged at revision: 3516
Proposed branch: lp:~vanvugt/compiz/fix-1026920
Merge into: lp:compiz/0.9.9
Diff against target: 131 lines (+31/-54)
3 files modified
debian/patches/series (+0/-1)
debian/patches/workaround_broken_drivers.patch (+0/-44)
plugins/opengl/src/screen.cpp (+31/-9)
To merge this branch: bzr merge lp:~vanvugt/compiz/fix-1026920
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Sam Spilsbury Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+138670@code.launchpad.net

Commit message

Upstream workaround_broken_drivers.patch so all users, not just Ubuntu, can
have properly working fglrx support (including GLSL!). (LP: #1026920)
.

To post a comment you must log in.
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

ATI already fixed this in their driver.

We should drop the patch instead.

review: Needs Information
Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Sorry - AMD already told us that they had a fix in line for this for their driver, but I'm not sure if that fix actually got released. Can we check?

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

Checking is irrelevant. AMD have proven themselves slightly unreliable. And even if we knew the exact version it's fixed it we can't guarantee someone won't want to compile compiz and run it against an older fglrx version.

So the workaround is required until we're confident the affected versions are no longer in circulation.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

:(

review: Approve
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

looking good, I agree with Daniel's rationale :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/patches/series'
2--- debian/patches/series 2012-11-26 07:13:04 +0000
3+++ debian/patches/series 2012-12-07 09:50:27 +0000
4@@ -1,6 +1,5 @@
5 ubuntu-config.patch
6 ccp_plugin.patch
7-workaround_broken_drivers.patch
8 ccsm_remove_redundant_sliders.patch
9 ccsm_add_first_run_warning.patch
10 ccsm_disable_unity_checkbox.patch
11
12=== removed file 'debian/patches/workaround_broken_drivers.patch'
13--- debian/patches/workaround_broken_drivers.patch 2012-08-24 13:41:00 +0000
14+++ debian/patches/workaround_broken_drivers.patch 1970-01-01 00:00:00 +0000
15@@ -1,44 +0,0 @@
16-Index: ubuntu_quantal_trunk/plugins/opengl/src/screen.cpp
17-===================================================================
18---- ubuntu_quantal_trunk.orig/plugins/opengl/src/screen.cpp 2012-08-22 18:07:44.344116000 +0800
19-+++ ubuntu_quantal_trunk/plugins/opengl/src/screen.cpp 2012-08-22 18:09:37.269159461 +0800
20-@@ -37,6 +37,21 @@
21- #include <dlfcn.h>
22- #include <math.h>
23-
24-+class DetectionWorkaround
25-+{
26-+ public:
27-+
28-+ DetectionWorkaround ()
29-+ {
30-+ program_invocation_short_name[0] = 'C';
31-+ }
32-+ ~DetectionWorkaround ()
33-+ {
34-+ program_invocation_short_name[0] = 'c';
35-+ }
36-+};
37-+
38-+
39- using namespace compiz::opengl;
40-
41- namespace GL {
42-@@ -274,6 +289,8 @@
43- bool
44- GLScreen::glInitContext (XVisualInfo *visinfo)
45- {
46-+ DetectionWorkaround workaround;
47-+
48- #ifdef USE_GLES
49- Display *xdpy;
50- Window overlay;
51-@@ -814,6 +831,8 @@
52- PluginClassHandler<GLScreen, CompScreen, COMPIZ_OPENGL_ABI> (s),
53- priv (new PrivateGLScreen (this))
54- {
55-+ DetectionWorkaround workaround;
56-+
57- XVisualInfo *visinfo = NULL;
58- #ifndef USE_GLES
59- Display *dpy = s->dpy ();
60
61=== modified file 'plugins/opengl/src/screen.cpp'
62--- plugins/opengl/src/screen.cpp 2012-12-05 12:53:59 +0000
63+++ plugins/opengl/src/screen.cpp 2012-12-07 09:50:27 +0000
64@@ -42,6 +42,29 @@
65
66 template class WrapableInterface<GLScreen, GLScreenInterface>;
67
68+#ifndef USE_GLES
69+/*
70+ * Historically most versions of fglrx have contained a nasty hack that checks
71+ * if argv[0] == "compiz", and downgrades OpenGL features including dropping
72+ * GLSL support (hides GL_ARB_shading_language_100). (LP #1026920)
73+ * This hack in fglrx is misguided and I'm told AMD have or will remove
74+ * it soon. In the mean time, modify argv[0] so it's not triggered...
75+ */
76+class DetectionWorkaround
77+{
78+ public:
79+ DetectionWorkaround ()
80+ {
81+ program_invocation_short_name[0] = 'C';
82+ }
83+ ~DetectionWorkaround ()
84+ {
85+ program_invocation_short_name[0] = 'c';
86+ }
87+};
88+#endif
89+
90+
91 using namespace compiz::opengl;
92
93 namespace GL {
94@@ -337,6 +360,10 @@
95 bool
96 GLScreen::glInitContext (XVisualInfo *visinfo)
97 {
98+#ifndef USE_GLES
99+ DetectionWorkaround workaround;
100+#endif
101+
102 #ifdef USE_GLES
103 Display *xdpy;
104 Window overlay;
105@@ -773,15 +800,6 @@
106
107 priv->updateRenderMode ();
108
109- /*
110- * !!! WARNING for users of the ATI/AMD fglrx driver !!!
111- *
112- * fglrx contains a hack which hides GL_ARB_shading_language_100 if
113- * your argv[0]=="compiz" for stupid historical reasons, so you won't
114- * get shader support by default when using fglrx.
115- *
116- * Workaround: Rename or link your "compiz" binary to "Compiz".
117- */
118 if (strstr (glExtensions, "GL_ARB_fragment_shader") &&
119 strstr (glExtensions, "GL_ARB_vertex_shader") &&
120 strstr (glExtensions, "GL_ARB_shader_objects") &&
121@@ -892,6 +910,10 @@
122 PluginClassHandler<GLScreen, CompScreen, COMPIZ_OPENGL_ABI> (s),
123 priv (new PrivateGLScreen (this))
124 {
125+#ifndef USE_GLES
126+ DetectionWorkaround workaround;
127+#endif
128+
129 XVisualInfo *visinfo = NULL;
130 #ifndef USE_GLES
131 Display *dpy = s->dpy ();

Subscribers

People subscribed via source and target branches