Merge lp:~3v1n0/compiz/msaa-configs-ignore into lp:compiz/0.9.10

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 3699
Merged at revision: 3698
Proposed branch: lp:~3v1n0/compiz/msaa-configs-ignore
Merge into: lp:compiz/0.9.10
Diff against target: 53 lines (+23/-7)
1 file modified
plugins/opengl/src/screen.cpp (+23/-7)
To merge this branch: bzr merge lp:~3v1n0/compiz/msaa-configs-ignore
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sam Spilsbury Approve
MC Return Approve
Review via email: mp+163550@code.launchpad.net

Commit message

OpenGL Screen: Ignore the MSAA configs during initialization

This fixes a crash with new MESA drivers and high monitor resolutions
caused by the fact that we're accidentally using some MSAA configs with
some drivers in Mesa 9.0.
Taking in account the values of GLX_SAMPLES and GLX_SAMPLE_BUFFERS
fixes the issue.

See mesa bug https://bugs.freedesktop.org/show_bug.cgi?id=61182

Description of the change

In some cases compiz opengl plugin uses MSAA configurations while it should not and this is causing a crash when using compiz with big resolutions with recent MESA drivers.

The fix is based on the changes proposed by MESA developers that also Kwin and Clog have recently applied:
 - http://quickgit.kde.org/?p=kde-workspace.git&a=commitdiff&h=6cf057777555
 - https://git.gnome.org/browse/cogl/commit/?id=93b7b4c850

To post a comment you must log in.
Revision history for this message
MC Return (mc-return) wrote :

LGTM.

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

This is fine as we don't need msaa for tfp operations.

Can you (doesn't have to be in this branch)

1. Add this to the egl configs too (eg, http://www.khronos.org/registry/egl/sdk/docs/man/xhtml/eglChooseConfig.html EGL_SAMPLE_BUFFERS and friends)
2. Use compiz variable naming conventions e.g. msaaBuffers as opposed to msaa_buffers

review: Approve
lp:~3v1n0/compiz/msaa-configs-ignore updated
3699. By Marco Trevisan (Treviño)

GLScreen: use compiz names convention

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Updated variable names. EGL changes in a new branch.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/opengl/src/screen.cpp'
2--- plugins/opengl/src/screen.cpp 2013-01-09 10:57:03 +0000
3+++ plugins/opengl/src/screen.cpp 2013-05-13 15:58:25 +0000
4@@ -1058,7 +1058,7 @@
5
6 for (i = 0; i <= MAX_DEPTH; i++)
7 {
8- int j, db, stencil, depth, alpha, mipmap, rgba;
9+ int j, db, stencil, depth, alpha, mipmap, msaaBuffers, msaaSamples, rgba;
10
11 priv->glxPixmapFBConfigs[i].fbConfig = NULL;
12 priv->glxPixmapFBConfigs[i].mipmap = 0;
13@@ -1066,11 +1066,13 @@
14 priv->glxPixmapFBConfigs[i].textureFormat = 0;
15 priv->glxPixmapFBConfigs[i].textureTargets = 0;
16
17- db = MAXSHORT;
18- stencil = MAXSHORT;
19- depth = MAXSHORT;
20- mipmap = 0;
21- rgba = 0;
22+ db = MAXSHORT;
23+ stencil = MAXSHORT;
24+ depth = MAXSHORT;
25+ msaaBuffers = MAXSHORT;
26+ msaaSamples = MAXSHORT;
27+ mipmap = 0;
28+ rgba = 0;
29
30 for (j = 0; j < nElements; j++)
31 {
32@@ -1146,7 +1148,21 @@
33 depth = value;
34
35 (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
36- GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &value);
37+ GLX_SAMPLE_BUFFERS, &value);
38+ if (value > msaaBuffers)
39+ continue;
40+
41+ msaaBuffers = value;
42+
43+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
44+ GLX_SAMPLES, &value);
45+ if (value > msaaSamples)
46+ continue;
47+
48+ msaaSamples = value;
49+
50+ (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
51+ GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &value);
52 if (value < mipmap)
53 continue;
54

Subscribers

People subscribed via source and target branches