summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-11-13 14:07:39 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-11-13 14:07:39 +0000
commit463614021a3736be63bae22753e95c766a7bce75 (patch)
tree200ffa1df3a0dc72adb6a41fe610963ca98f862a
parent630d662a3bf1d5c22876afaf6fc8b6d0637a094f (diff)
and this fixes compositing on newest intel+mesa drivers... wrong fb
config wasa being chosen as it was done by hand not accounting for multisample buffers. now using glxchoosefbconfig instead and it works. SVN revision: 79232
-rw-r--r--ChangeLog73
-rw-r--r--NEWS2
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c107
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.h7
-rw-r--r--src/modules/evas/engines/gl_x11/evas_x_main.c85
5 files changed, 128 insertions, 146 deletions
diff --git a/ChangeLog b/ChangeLog
index 1ad7e0bb37..97d91a5f59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,42 @@
12012-11-13 Carsten Haitzler (The Rasterman)
2
3 * Fixed GLX native surface handling to use glXChooseFBConfig.
4 This frixes a break in compositing on new intel mesa drivers.
5
62012-11-12 Mike Blumenkrantz
7
8 * Add eina_list_last_data_get
9
102012-11-10 Vincent Torri
11
12 * Fix build of eina_file on Solaris 10
13
142012-11-09 Vincent Torri
15
16 * Fixed longstanding memset bug in evas box.
17
182012-10-19 Cedric Bail
19
20 * Add eina_thread API.
21
222012-10-19 Patryk Kaczmarek
23
24 * eina_stringshare_add_length return NULL when func args are wrong.
25
262012-10-17 Carsten Haitzler (The Rasterman)
27
28 * Add eina_barrier API to cover pthread_barrier functionality
29 * Add eina_tmpstr_add() and eina_tmpstr_del().
30
312012-10-04 Vincent Torri
32
33 * Update lz4 code to rev. 77. This fix compilation on NetBSD 5.0
34
352012-10-31 Cedric Bail
36
37 * Add eet_list_entries().
38 * Add eet -l -v to give more information about an eet file.
39
12012-09-27 Patryk Kaczmarek <patryk.k@samsung.com> 402012-09-27 Patryk Kaczmarek <patryk.k@samsung.com>
2 41
3 * Add eet file handle null checks to eet_data_write_cipher(), 42 * Add eet file handle null checks to eet_data_write_cipher(),
@@ -35,37 +74,3 @@
35 74
36 * Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the 75 * Fix EINA_INLIST_FOREACH_SAFE macro to work when inlist is not the
37 first item in the struct. 76 first item in the struct.
38
392012-10-04 Vincent Torri
40
41 * Update lz4 code to rev. 77. This fix compilation on NetBSD 5.0
42
432012-10-17 Carsten Haitzler (The Rasterman)
44
45 * Add eina_barrier API to cover pthread_barrier functionality
46 * Add eina_tmpstr_add() and eina_tmpstr_del().
47
482012-10-19 Patryk Kaczmarek
49
50 * eina_stringshare_add_length return NULL when func args are wrong.
51
522012-10-19 Cedric Bail
53
54 * Add eina_thread API.
55
562012-10-31 Cedric Bail
57
58 * Add eet_list_entries().
59 * Add eet -l -v to give more information about an eet file.
60
612012-11-09 Vincent Torri
62
63 * Fixed longstanding memset bug in evas box.
64
652012-11-10 Vincent Torri
66
67 * Fix build of eina_file on Solaris 10
68
692012-11-12 Mike Blumenkrantz
70
71 * Add eina_list_last_data_get
diff --git a/NEWS b/NEWS
index 1e6e1081c3..d955f483e0 100644
--- a/NEWS
+++ b/NEWS
@@ -22,3 +22,5 @@ Fixes:
22 * Fix PPC (big endian) image codec bug. 22 * Fix PPC (big endian) image codec bug.
23 * Fix return value of eina_mmap_safety_enabled_set() and future 23 * Fix return value of eina_mmap_safety_enabled_set() and future
24 eina_mmap_safety_enabled_get() returns after success 24 eina_mmap_safety_enabled_get() returns after success
25 * Fixed GLX native surface handling to use glXChooseFBConfig.
26 This frixes a break in compositing on new intel mesa drivers.
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index b8d7914b1c..62b8ab88d4 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -342,9 +342,8 @@ evgl_eng_window_surface_destroy(void *data, void *surface)
342 eglDestroySurface(re->win->egl_disp, (EGLSurface)surface); 342 eglDestroySurface(re->win->egl_disp, (EGLSurface)surface);
343#endif 343#endif
344 344
345 surface = NULL;
346
347 return 1; 345 return 1;
346 if (surface) return 0;
348} 347}
349 348
350static void * 349static void *
@@ -1888,16 +1887,88 @@ eng_image_native_set(void *data, void *image, void *native)
1888 n = calloc(1, sizeof(Native)); 1887 n = calloc(1, sizeof(Native));
1889 if (n) 1888 if (n)
1890 { 1889 {
1891 int pixmap_att[20]; 1890 int pixmap_att[20], i;
1892 unsigned int target = 0; 1891 int config_attrs[40], num = 0;
1893 unsigned int i = 0; 1892 int tex_format = 0, tex_target = 0, yinvert = 0, mipmap = 0;
1893 unsigned int target;
1894 GLXFBConfig *configs;
1895
1896 i = 0;
1897 config_attrs[i++] = GLX_BUFFER_SIZE;
1898 config_attrs[i++] = depth;
1899 if (depth == 32)
1900 {
1901 config_attrs[i++] = GLX_BIND_TO_TEXTURE_RGBA_EXT;
1902 config_attrs[i++] = 1;
1903 }
1904 else
1905 {
1906 config_attrs[i++] = GLX_BIND_TO_TEXTURE_RGB_EXT;
1907 config_attrs[i++] = 1;
1908 }
1909
1910#ifndef GLX_VISUAL_ID
1911# define GLX_VISUAL_ID 0x800b
1912#endif
1913 config_attrs[i++] = GLX_VISUAL_ID;
1914 config_attrs[i++] = XVisualIDFromVisual(vis);
1915#ifndef GLX_SAMPLE_BUFFERS
1916# define GLX_SAMPLE_BUFFERS 0x186a0
1917#endif
1918 config_attrs[i++] = GLX_SAMPLE_BUFFERS;
1919 config_attrs[i++] = 0;
1920 config_attrs[i++] = GLX_DEPTH_SIZE;
1921 config_attrs[i++] = 0;
1922 config_attrs[i++] = GLX_STENCIL_SIZE;
1923 config_attrs[i++] = 0;
1924 config_attrs[i++] = GLX_AUX_BUFFERS;
1925 config_attrs[i++] = 0;
1926 config_attrs[i++] = GLX_STEREO;
1927 config_attrs[i++] = 0;
1928
1929 config_attrs[i++] = 0;
1930
1931 configs = glXChooseFBConfig(re->win->disp,
1932 re->win->screen,
1933 config_attrs,
1934 &num);
1935 if (configs)
1936 {
1937 int j = 0, val = 0;
1938
1939 tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
1940 glXGetFBConfigAttrib(re->win->disp, configs[j],
1941 GLX_ALPHA_SIZE, &val);
1942 if (val > 0)
1943 {
1944 glXGetFBConfigAttrib(re->win->disp, configs[j],
1945 GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
1946 if (val) tex_format = GLX_TEXTURE_FORMAT_RGBA_EXT;
1947 }
1948 else
1949 {
1950 glXGetFBConfigAttrib(re->win->disp, configs[j],
1951 GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
1952 if (val) tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
1953 }
1954 glXGetFBConfigAttrib(re->win->disp, configs[j],
1955 GLX_Y_INVERTED_EXT, &val);
1956 yinvert = val;
1957 glXGetFBConfigAttrib(re->win->disp, configs[j],
1958 GLX_BIND_TO_TEXTURE_TARGETS_EXT,
1959 &val);
1960 tex_target = val;
1961 glXGetFBConfigAttrib(re->win->disp, configs[j],
1962 GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
1963 mipmap = val;
1964 n->fbc = configs[j];
1965 XFree(configs);
1966 }
1894 1967
1895 eina_hash_add(re->win->gl_context->shared->native_pm_hash, &pmid, im); 1968 eina_hash_add(re->win->gl_context->shared->native_pm_hash, &pmid, im);
1896 if ((re->win->depth_cfg[depth].tex_target & 1969 if ((tex_target & GLX_TEXTURE_2D_BIT_EXT))
1897 GLX_TEXTURE_2D_BIT_EXT))
1898 target = GLX_TEXTURE_2D_EXT; 1970 target = GLX_TEXTURE_2D_EXT;
1899 else if ((re->win->depth_cfg[depth].tex_target & 1971 else if ((target & GLX_TEXTURE_RECTANGLE_BIT_EXT))
1900 GLX_TEXTURE_RECTANGLE_BIT_EXT))
1901 { 1972 {
1902 ERR("rect!!! (not handled)"); 1973 ERR("rect!!! (not handled)");
1903 target = GLX_TEXTURE_RECTANGLE_EXT; 1974 target = GLX_TEXTURE_RECTANGLE_EXT;
@@ -1905,31 +1976,27 @@ eng_image_native_set(void *data, void *image, void *native)
1905 if (!target) 1976 if (!target)
1906 { 1977 {
1907 ERR("broken tex-from-pixmap"); 1978 ERR("broken tex-from-pixmap");
1908 if (!(re->win->depth_cfg[depth].tex_target & 1979 if (!(tex_target & GLX_TEXTURE_2D_BIT_EXT))
1909 GLX_TEXTURE_2D_BIT_EXT))
1910 target = GLX_TEXTURE_RECTANGLE_EXT; 1980 target = GLX_TEXTURE_RECTANGLE_EXT;
1911 else if (!(re->win->depth_cfg[depth].tex_target & 1981 else if (!(tex_target & GLX_TEXTURE_RECTANGLE_BIT_EXT))
1912 GLX_TEXTURE_RECTANGLE_BIT_EXT))
1913 target = GLX_TEXTURE_2D_EXT; 1982 target = GLX_TEXTURE_2D_EXT;
1914 } 1983 }
1915 1984
1985 i = 0;
1916 pixmap_att[i++] = GLX_TEXTURE_FORMAT_EXT; 1986 pixmap_att[i++] = GLX_TEXTURE_FORMAT_EXT;
1917 pixmap_att[i++] = re->win->depth_cfg[depth].tex_format; 1987 pixmap_att[i++] = tex_format;
1918 pixmap_att[i++] = GLX_MIPMAP_TEXTURE_EXT; 1988 pixmap_att[i++] = GLX_MIPMAP_TEXTURE_EXT;
1919 pixmap_att[i++] = re->win->depth_cfg[depth].mipmap; 1989 pixmap_att[i++] = mipmap;
1920
1921 if (target) 1990 if (target)
1922 { 1991 {
1923 pixmap_att[i++] = GLX_TEXTURE_TARGET_EXT; 1992 pixmap_att[i++] = GLX_TEXTURE_TARGET_EXT;
1924 pixmap_att[i++] = target; 1993 pixmap_att[i++] = target;
1925 } 1994 }
1926
1927 pixmap_att[i++] = 0; 1995 pixmap_att[i++] = 0;
1928 1996
1929 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 1997 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
1930 n->pixmap = pm; 1998 n->pixmap = pm;
1931 n->visual = vis; 1999 n->visual = vis;
1932 n->fbc = re->win->depth_cfg[depth].fbc;
1933 if (glsym_glXCreatePixmap) 2000 if (glsym_glXCreatePixmap)
1934 n->glx_pixmap = glsym_glXCreatePixmap(re->win->disp, 2001 n->glx_pixmap = glsym_glXCreatePixmap(re->win->disp,
1935 n->fbc, 2002 n->fbc,
@@ -1953,7 +2020,7 @@ eng_image_native_set(void *data, void *image, void *native)
1953 if (target == GLX_TEXTURE_2D_EXT) 2020 if (target == GLX_TEXTURE_2D_EXT)
1954 { 2021 {
1955 im->native.target = GL_TEXTURE_2D; 2022 im->native.target = GL_TEXTURE_2D;
1956 im->native.mipmap = re->win->depth_cfg[depth].mipmap; 2023 im->native.mipmap = mipmap;
1957 } 2024 }
1958# ifdef GL_TEXTURE_RECTANGLE_ARB 2025# ifdef GL_TEXTURE_RECTANGLE_ARB
1959 else if (target == GLX_TEXTURE_RECTANGLE_EXT) 2026 else if (target == GLX_TEXTURE_RECTANGLE_EXT)
@@ -1971,7 +2038,7 @@ eng_image_native_set(void *data, void *image, void *native)
1971 } 2038 }
1972 else 2039 else
1973 ERR("GLX Pixmap create fail"); 2040 ERR("GLX Pixmap create fail");
1974 im->native.yinvert = re->win->depth_cfg[depth].yinvert; 2041 im->native.yinvert = yinvert;
1975 im->native.loose = re->win->detected.loose_binding; 2042 im->native.loose = re->win->detected.loose_binding;
1976 im->native.data = n; 2043 im->native.data = n;
1977 im->native.func.data = re; 2044 im->native.func.data = re;
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.h b/src/modules/evas/engines/gl_x11/evas_engine.h
index f52caf47f7..8478ce9bc0 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.h
+++ b/src/modules/evas/engines/gl_x11/evas_engine.h
@@ -83,13 +83,6 @@ struct _Evas_GL_X11_Window
83#else 83#else
84 GLXContext context; 84 GLXContext context;
85 GLXWindow glxwin; 85 GLXWindow glxwin;
86 struct {
87 GLXFBConfig fbc;
88 int tex_format;
89 int tex_target;
90 int mipmap;
91 unsigned char yinvert : 1;
92 } depth_cfg[33]; // config for all 32 possible depths!
93 86
94 struct { 87 struct {
95 unsigned int loose_binding : 1; 88 unsigned int loose_binding : 1;
diff --git a/src/modules/evas/engines/gl_x11/evas_x_main.c b/src/modules/evas/engines/gl_x11/evas_x_main.c
index ccda5ccde7..c1543af9ed 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -264,9 +264,6 @@ eng_window_new(Display *disp,
264 } 264 }
265 if (gw->context) 265 if (gw->context)
266 { 266 {
267 int i, j, num;
268 GLXFBConfig *fbc;
269
270 if (gw->glxwin) 267 if (gw->glxwin)
271 { 268 {
272 if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin, 269 if (!glXMakeContextCurrent(gw->disp, gw->glxwin, gw->glxwin,
@@ -398,88 +395,6 @@ eng_window_new(Display *disp,
398 { 395 {
399 // noothing yet. add more cases and options over time 396 // noothing yet. add more cases and options over time
400 } 397 }
401
402 fbc = glXGetFBConfigs(gw->disp, screen, &num);
403 if (!fbc)
404 {
405 ERR("glXGetFBConfigs() returned no fb configs");
406 eng_window_free(gw);
407 return NULL;
408 }
409 for (i = 0; i <= 32; i++)
410 {
411 for (j = 0; j < num; j++)
412 {
413 XVisualInfo *vi;
414 int vd;
415 int alph, val, dbuf, stencil, tdepth;
416 int rgba;
417
418 vi = glXGetVisualFromFBConfig(gw->disp, fbc[j]);
419 if (!vi) continue;
420 vd = vi->depth;
421 XFree(vi);
422
423 if (vd != i) continue;
424
425 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_ALPHA_SIZE, &alph);
426 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BUFFER_SIZE, &val);
427
428 if ((val != i) && ((val - alph) != i)) continue;
429
430 val = 0;
431 rgba = 0;
432
433 if (i == 32)
434 {
435 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGBA_EXT, &val);
436 if (val)
437 {
438 rgba = 1;
439 gw->depth_cfg[i].tex_format = GLX_TEXTURE_FORMAT_RGBA_EXT;
440 }
441 }
442 if (!val)
443 {
444 if (rgba) continue;
445 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_RGB_EXT, &val);
446 if (!val) continue;
447 gw->depth_cfg[i].tex_format = GLX_TEXTURE_FORMAT_RGB_EXT;
448 }
449
450 dbuf = 0x7fff;
451 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DOUBLEBUFFER, &val);
452 if (val > dbuf) continue;
453 dbuf = val;
454
455 stencil = 0x7fff;
456 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_STENCIL_SIZE, &val);
457 if (val > stencil) continue;
458 stencil = val;
459
460 tdepth = 0x7fff;
461 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_DEPTH_SIZE, &val);
462 if (val > tdepth) continue;
463 tdepth = val;
464
465 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_MIPMAP_TEXTURE_EXT, &val);
466 if (val < 0) continue;
467 gw->depth_cfg[i].mipmap = val;
468
469 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_Y_INVERTED_EXT, &val);
470 gw->depth_cfg[i].yinvert = val;
471
472 glXGetFBConfigAttrib(gw->disp, fbc[j], GLX_BIND_TO_TEXTURE_TARGETS_EXT, &val);
473 gw->depth_cfg[i].tex_target = val;
474
475 gw->depth_cfg[i].fbc = fbc[j];
476 }
477 }
478 XFree(fbc);
479 if (!gw->depth_cfg[DefaultDepth(gw->disp, screen)].fbc)
480 {
481 WRN("texture from pixmap not going to work");
482 }
483 } 398 }
484#endif 399#endif
485 400