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
=== modified file 'plugins/opengl/src/screen.cpp'
--- plugins/opengl/src/screen.cpp 2013-01-09 10:57:03 +0000
+++ plugins/opengl/src/screen.cpp 2013-05-13 15:58:25 +0000
@@ -1058,7 +1058,7 @@
10581058
1059 for (i = 0; i <= MAX_DEPTH; i++)1059 for (i = 0; i <= MAX_DEPTH; i++)
1060 {1060 {
1061 int j, db, stencil, depth, alpha, mipmap, rgba;1061 int j, db, stencil, depth, alpha, mipmap, msaaBuffers, msaaSamples, rgba;
10621062
1063 priv->glxPixmapFBConfigs[i].fbConfig = NULL;1063 priv->glxPixmapFBConfigs[i].fbConfig = NULL;
1064 priv->glxPixmapFBConfigs[i].mipmap = 0;1064 priv->glxPixmapFBConfigs[i].mipmap = 0;
@@ -1066,11 +1066,13 @@
1066 priv->glxPixmapFBConfigs[i].textureFormat = 0;1066 priv->glxPixmapFBConfigs[i].textureFormat = 0;
1067 priv->glxPixmapFBConfigs[i].textureTargets = 0;1067 priv->glxPixmapFBConfigs[i].textureTargets = 0;
10681068
1069 db = MAXSHORT;1069 db = MAXSHORT;
1070 stencil = MAXSHORT;1070 stencil = MAXSHORT;
1071 depth = MAXSHORT;1071 depth = MAXSHORT;
1072 mipmap = 0;1072 msaaBuffers = MAXSHORT;
1073 rgba = 0;1073 msaaSamples = MAXSHORT;
1074 mipmap = 0;
1075 rgba = 0;
10741076
1075 for (j = 0; j < nElements; j++)1077 for (j = 0; j < nElements; j++)
1076 {1078 {
@@ -1146,7 +1148,21 @@
1146 depth = value;1148 depth = value;
11471149
1148 (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],1150 (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
1149 GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &value);1151 GLX_SAMPLE_BUFFERS, &value);
1152 if (value > msaaBuffers)
1153 continue;
1154
1155 msaaBuffers = value;
1156
1157 (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
1158 GLX_SAMPLES, &value);
1159 if (value > msaaSamples)
1160 continue;
1161
1162 msaaSamples = value;
1163
1164 (*GL::getFBConfigAttrib) (dpy, fbConfigs[j],
1165 GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &value);
1150 if (value < mipmap)1166 if (value < mipmap)
1151 continue;1167 continue;
11521168

Subscribers

People subscribed via source and target branches