Merge lp:~vanvugt/ubuntu/quantal/compiz/fix-1039155 into lp:ubuntu/quantal/compiz

Proposed by Daniel van Vugt
Status: Merged
Merged at revision: 3316
Proposed branch: lp:~vanvugt/ubuntu/quantal/compiz/fix-1039155
Merge into: lp:ubuntu/quantal/compiz
Diff against target: 96 lines (+84/-0)
2 files modified
debian/patches/series (+1/-0)
debian/patches/unity_support_test.patch (+83/-0)
To merge this branch: bzr merge lp:~vanvugt/ubuntu/quantal/compiz/fix-1039155
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Ubuntu branches Pending
Review via email: mp+128684@code.launchpad.net

Commit message

Automatically fall back to LLVMpipe software rendering if the hardware
fails unity_support_test.
(LP: #1039155)

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

@Daniel: it's looking good to me, even if I don't have such hardware to test on. Can you please change the condition to do the test with:
XDG_CURRENT_DESKTOP=Unity
rather?

Otherwise, it looks good to me :)
Thanks a lot!

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

actually, I missed the second line. Mirv confirmed it works, and it looks excellent to me! Merging, let's try to get it on the CD :)

Thanks!

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-09-13 04:59:17 +0000
3+++ debian/patches/series 2012-10-09 11:08:25 +0000
4@@ -7,3 +7,4 @@
5 ccsm_disable_unity_checkbox.patch
6 99_valid_ccsm_desktop_file.patch
7 100_expo_layout.patch
8+unity_support_test.patch
9
10=== added file 'debian/patches/unity_support_test.patch'
11--- debian/patches/unity_support_test.patch 1970-01-01 00:00:00 +0000
12+++ debian/patches/unity_support_test.patch 2012-10-09 11:08:25 +0000
13@@ -0,0 +1,83 @@
14+=== modified file 'src/plugin.cpp'
15+--- old/src/plugin.cpp 2012-07-30 10:15:41 +0000
16++++ new/src/plugin.cpp 2012-10-09 10:52:12 +0000
17+@@ -116,6 +116,60 @@
18+ }
19+
20+ static bool
21++setOpenGLPluginEnvironment ()
22++{
23++ /*
24++ * Check if the hardware is adequate for Unity and if not, use LLVMpipe.
25++ * Unfortunately the design of Mesa requires that this be done before
26++ * libGL is loaded, which means before the opengl plugin is loaded.
27++ */
28++ bool toggledLLVM = false;
29++
30++ if (!getenv ("LIBGL_ALWAYS_SOFTWARE"))
31++ {
32++ const char *profile = getenv ("COMPIZ_CONFIG_PROFILE");
33++ if (profile && !strcmp (profile, "ubuntu"))
34++ {
35++ int result = system ("/usr/lib/nux/unity_support_test");
36++ int status = WEXITSTATUS (result);
37++ compLogMessage ("core", CompLogLevelInfo,
38++ "Unity is %s",
39++ status == 0 ? "fully supported by your hardware." :
40++ status == 127 ? "undetectable" :
41++ "not supported by your hardware. "
42++ "Enabling software rendering instead (slow).");
43++ if (status > 0 && status < 127)
44++ {
45++ setenv ("LIBGL_ALWAYS_SOFTWARE", "1", 1);
46++ toggledLLVM = true;
47++ }
48++ }
49++ }
50++
51++ return toggledLLVM;
52++}
53++
54++static void
55++unsetUnityshellPluginEnvironment ()
56++{
57++ unsetenv ("LIBGL_ALWAYS_SOFTWARE");
58++}
59++
60++static void
61++setPluginEnvironment (const char *name)
62++{
63++ if (!strcmp (name, "opengl"))
64++ setOpenGLPluginEnvironment ();
65++}
66++
67++static void
68++unsetPluginEnvironment (const char *name)
69++{
70++ if (!strcmp (name, "unityshell"))
71++ unsetUnityshellPluginEnvironment ();
72++}
73++
74++static bool
75+ dlloaderLoadPlugin (CompPlugin *p,
76+ const char *path,
77+ const char *name)
78+@@ -127,6 +181,8 @@
79+ if (cloaderLoadPlugin (p, path, name))
80+ return true;
81+
82++ setPluginEnvironment (name);
83++
84+ if (path)
85+ {
86+ file = path;
87+@@ -197,6 +253,8 @@
88+ if (!loaded && dlhand)
89+ dlclose (dlhand);
90+
91++ unsetPluginEnvironment (name);
92++
93+ return loaded;
94+ }
95+
96+

Subscribers

People subscribed via source and target branches