summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-11-03 18:13:59 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-11-04 15:15:05 +0900
commita2b64d97723e506535425e942b36d78055c0ea8f (patch)
treec7e83e5b5c347049f3815c7ef97d16cb92d98030
parentaefcb11444f6172b10129967956f3e6bde4dca04 (diff)
Evas: minor whitespace and debug changes
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c15
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c86
-rw-r--r--src/modules/evas/engines/gl_x11/evas_x_main.c4
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_swapper.c50
4 files changed, 77 insertions, 78 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c
index 3bd0d1de9d..6a03ac31b7 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -486,7 +486,7 @@ _fbo_surface_cap_test(GLint color_ifmt, GLenum color_fmt,
486 DBG("glGetError() returns %x ", err); 486 DBG("glGetError() returns %x ", err);
487 487
488 return 0; 488 return 0;
489 } 489 }
490 else 490 else
491 return 1; 491 return 1;
492} 492}
@@ -2113,10 +2113,10 @@ evgl_context_create(void *eng_data, EVGL_Context *share_ctx,
2113 DBG("Creating context GLESv%d (eng = %p, shctx = %p)", version, eng_data, share_ctx); 2113 DBG("Creating context GLESv%d (eng = %p, shctx = %p)", version, eng_data, share_ctx);
2114 2114
2115 if (!(rsc = _evgl_tls_resource_get())) 2115 if (!(rsc = _evgl_tls_resource_get()))
2116 { 2116 {
2117 ERR("Error creating resources in tls."); 2117 ERR("Error creating resources in tls.");
2118 return NULL; 2118 return NULL;
2119 } 2119 }
2120 2120
2121 // Allocate context object 2121 // Allocate context object
2122 ctx = calloc(1, sizeof(EVGL_Context)); 2122 ctx = calloc(1, sizeof(EVGL_Context));
@@ -2754,9 +2754,8 @@ evgl_native_surface_direct_opts_get(Evas_Native_Surface *ns,
2754 2754
2755 if (evgl_engine->api_debug_mode) 2755 if (evgl_engine->api_debug_mode)
2756 { 2756 {
2757 DBG("Found native surface: texid:%u DR:%d CSR:%d", 2757 DBG("Found native surface: DR:%d CSR:%d",
2758 ns->data.opengl.texture_id, (int) sfc->direct_fb_opt, 2758 (int) sfc->direct_fb_opt, (int) sfc->client_side_rotation);
2759 (int) sfc->client_side_rotation);
2760 } 2759 }
2761 2760
2762 if (direct_render) *direct_render = sfc->direct_fb_opt; 2761 if (direct_render) *direct_render = sfc->direct_fb_opt;
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 59195e8e58..80fcc53ec4 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -286,12 +286,12 @@ evgl_eng_native_window_create(void *data)
286 attr.win_gravity = NorthWestGravity; 286 attr.win_gravity = NorthWestGravity;
287 attr.save_under = False; 287 attr.save_under = False;
288 attr.do_not_propagate_mask = NoEventMask; 288 attr.do_not_propagate_mask = NoEventMask;
289 attr.event_mask = 0; 289 attr.event_mask = 0;
290 290
291 win = XCreateWindow(eng_get_ob(re)->info->info.display, 291 win = XCreateWindow(eng_get_ob(re)->info->info.display,
292 eng_get_ob(re)->win, 292 eng_get_ob(re)->win,
293 -20, -20, 2, 2, 0, 293 -20, -20, 2, 2, 0,
294 CopyFromParent, InputOutput, CopyFromParent, 294 CopyFromParent, InputOutput, CopyFromParent,
295 CWBackingStore | CWOverrideRedirect | 295 CWBackingStore | CWOverrideRedirect |
296 CWBorderPixel | CWBackPixmap | 296 CWBorderPixel | CWBackPixmap |
297 CWSaveUnder | CWDontPropagate | 297 CWSaveUnder | CWDontPropagate |
@@ -336,7 +336,7 @@ evgl_eng_native_window_destroy(void *data, void *native_window)
336 336
337 337
338// Theoretically, we wouldn't need this functoin if the surfaceless context 338// Theoretically, we wouldn't need this functoin if the surfaceless context
339// is supported. But, until then... 339// is supported. But, until then...
340static void * 340static void *
341evgl_eng_window_surface_create(void *data, void *native_window EINA_UNUSED) 341evgl_eng_window_surface_create(void *data, void *native_window EINA_UNUSED)
342{ 342{
@@ -2032,43 +2032,43 @@ _native_bind_cb(void *data EINA_UNUSED, void *image)
2032static void 2032static void
2033_native_unbind_cb(void *data EINA_UNUSED, void *image) 2033_native_unbind_cb(void *data EINA_UNUSED, void *image)
2034{ 2034{
2035 Evas_GL_Image *im = image; 2035 Evas_GL_Image *im = image;
2036 Native *n = im->native.data; 2036 Native *n = im->native.data;
2037 2037
2038 if (n->ns.type == EVAS_NATIVE_SURFACE_X11) 2038 if (n->ns.type == EVAS_NATIVE_SURFACE_X11)
2039 { 2039 {
2040#ifdef GL_GLES 2040#ifdef GL_GLES
2041 // nothing 2041 // nothing
2042#else 2042#else
2043# ifdef GLX_BIND_TO_TEXTURE_TARGETS_EXT 2043# ifdef GLX_BIND_TO_TEXTURE_TARGETS_EXT
2044 Render_Engine *re = data; 2044 Render_Engine *re = data;
2045 2045
2046 if (glsym_glXReleaseTexImage) 2046 if (glsym_glXReleaseTexImage)
2047 { 2047 {
2048 glsym_glXReleaseTexImage(eng_get_ob(re)->disp, (XID)n->surface, 2048 glsym_glXReleaseTexImage(eng_get_ob(re)->disp, (XID)n->surface,
2049 GLX_FRONT_LEFT_EXT); 2049 GLX_FRONT_LEFT_EXT);
2050 } 2050 }
2051 else 2051 else
2052 ERR("Try glXReleaseTexImage on GLX with no support"); 2052 ERR("Try glXReleaseTexImage on GLX with no support");
2053# endif 2053# endif
2054#endif 2054#endif
2055 } 2055 }
2056 else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL) 2056 else if (n->ns.type == EVAS_NATIVE_SURFACE_OPENGL)
2057 { 2057 {
2058 glBindTexture(GL_TEXTURE_2D, 0); 2058 glBindTexture(GL_TEXTURE_2D, 0);
2059 } 2059 }
2060 else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM) 2060 else if (n->ns.type == EVAS_NATIVE_SURFACE_TBM)
2061 { 2061 {
2062 // nothing 2062 // nothing
2063 } 2063 }
2064 else if (n->ns.type == EVAS_NATIVE_SURFACE_EVASGL) 2064 else if (n->ns.type == EVAS_NATIVE_SURFACE_EVASGL)
2065 { 2065 {
2066#ifdef GL_GLES 2066#ifdef GL_GLES
2067 // nothing 2067 // nothing
2068#else 2068#else
2069 glBindTexture(GL_TEXTURE_2D, 0); 2069 glBindTexture(GL_TEXTURE_2D, 0);
2070#endif 2070#endif
2071 } 2071 }
2072} 2072}
2073 2073
2074static void 2074static void
@@ -2448,7 +2448,7 @@ eng_image_native_set(void *data, void *image, void *native)
2448 int dummy; 2448 int dummy;
2449 unsigned int w, h, depth = 32, border; 2449 unsigned int w, h, depth = 32, border;
2450 Window wdummy; 2450 Window wdummy;
2451 2451
2452 // fixme: round trip :( 2452 // fixme: round trip :(
2453 XGetGeometry(eng_get_ob(re)->disp, pm, &wdummy, &dummy, &dummy, 2453 XGetGeometry(eng_get_ob(re)->disp, pm, &wdummy, &dummy, &dummy,
2454 &w, &h, &border, &depth); 2454 &w, &h, &border, &depth);
@@ -2462,7 +2462,7 @@ eng_image_native_set(void *data, void *image, void *native)
2462 int tex_format = 0, tex_target = 0, yinvert = 0, mipmap = 0; 2462 int tex_format = 0, tex_target = 0, yinvert = 0, mipmap = 0;
2463 unsigned int target = 0; 2463 unsigned int target = 0;
2464 GLXFBConfig *configs; 2464 GLXFBConfig *configs;
2465 2465
2466 i = 0; 2466 i = 0;
2467 config_attrs[i++] = GLX_BUFFER_SIZE; 2467 config_attrs[i++] = GLX_BUFFER_SIZE;
2468 config_attrs[i++] = depth; 2468 config_attrs[i++] = depth;
@@ -2476,7 +2476,7 @@ eng_image_native_set(void *data, void *image, void *native)
2476 config_attrs[i++] = GLX_BIND_TO_TEXTURE_RGB_EXT; 2476 config_attrs[i++] = GLX_BIND_TO_TEXTURE_RGB_EXT;
2477 config_attrs[i++] = 1; 2477 config_attrs[i++] = 1;
2478 } 2478 }
2479 2479
2480#ifndef GLX_VISUAL_ID 2480#ifndef GLX_VISUAL_ID
2481# define GLX_VISUAL_ID 0x800b 2481# define GLX_VISUAL_ID 0x800b
2482#endif 2482#endif
@@ -2495,9 +2495,9 @@ eng_image_native_set(void *data, void *image, void *native)
2495 config_attrs[i++] = 0; 2495 config_attrs[i++] = 0;
2496 config_attrs[i++] = GLX_STEREO; 2496 config_attrs[i++] = GLX_STEREO;
2497 config_attrs[i++] = 0; 2497 config_attrs[i++] = 0;
2498 2498
2499 config_attrs[i++] = 0; 2499 config_attrs[i++] = 0;
2500 2500
2501 configs = glXChooseFBConfig(eng_get_ob(re)->disp, 2501 configs = glXChooseFBConfig(eng_get_ob(re)->disp,
2502 eng_get_ob(re)->screen, 2502 eng_get_ob(re)->screen,
2503 config_attrs, 2503 config_attrs,
@@ -2505,19 +2505,19 @@ eng_image_native_set(void *data, void *image, void *native)
2505 if (configs) 2505 if (configs)
2506 { 2506 {
2507 int j = 0, val = 0, found = 0; 2507 int j = 0, val = 0, found = 0;
2508 2508
2509 try_again: 2509 try_again:
2510 for (j = 0; j < num; j++) 2510 for (j = 0; j < num; j++)
2511 { 2511 {
2512 if (found == 0) 2512 if (found == 0)
2513 { 2513 {
2514 XVisualInfo *vi; 2514 XVisualInfo *vi;
2515 2515
2516 vi = glXGetVisualFromFBConfig(eng_get_ob(re)->disp, configs[j]); 2516 vi = glXGetVisualFromFBConfig(eng_get_ob(re)->disp, configs[j]);
2517 if (!vi) continue; 2517 if (!vi) continue;
2518 if (vi->depth != (int)depth) continue; 2518 if (vi->depth != (int)depth) continue;
2519 XFree(vi); 2519 XFree(vi);
2520 2520
2521 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j], 2521 glXGetFBConfigAttrib(eng_get_ob(re)->disp, configs[j],
2522 GLX_BUFFER_SIZE, &val); 2522 GLX_BUFFER_SIZE, &val);
2523 if (val != (int) depth) continue; 2523 if (val != (int) depth) continue;
@@ -2562,7 +2562,7 @@ eng_image_native_set(void *data, void *image, void *native)
2562 } 2562 }
2563 XFree(configs); 2563 XFree(configs);
2564 } 2564 }
2565 2565
2566 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_pm_hash, &pmid, im); 2566 eina_hash_add(eng_get_ob(re)->gl_context->shared->native_pm_hash, &pmid, im);
2567 if ((tex_target & GLX_TEXTURE_2D_BIT_EXT)) 2567 if ((tex_target & GLX_TEXTURE_2D_BIT_EXT))
2568 target = GLX_TEXTURE_2D_EXT; 2568 target = GLX_TEXTURE_2D_EXT;
@@ -2579,7 +2579,7 @@ eng_image_native_set(void *data, void *image, void *native)
2579 else if (!(tex_target & GLX_TEXTURE_RECTANGLE_BIT_EXT)) 2579 else if (!(tex_target & GLX_TEXTURE_RECTANGLE_BIT_EXT))
2580 target = GLX_TEXTURE_2D_EXT; 2580 target = GLX_TEXTURE_2D_EXT;
2581 } 2581 }
2582 2582
2583 i = 0; 2583 i = 0;
2584 pixmap_att[i++] = GLX_TEXTURE_FORMAT_EXT; 2584 pixmap_att[i++] = GLX_TEXTURE_FORMAT_EXT;
2585 pixmap_att[i++] = tex_format; 2585 pixmap_att[i++] = tex_format;
@@ -2591,7 +2591,7 @@ eng_image_native_set(void *data, void *image, void *native)
2591 pixmap_att[i++] = target; 2591 pixmap_att[i++] = target;
2592 } 2592 }
2593 pixmap_att[i++] = 0; 2593 pixmap_att[i++] = 0;
2594 2594
2595 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface)); 2595 memcpy(&(n->ns), ns, sizeof(Evas_Native_Surface));
2596 n->pixmap = pm; 2596 n->pixmap = pm;
2597 n->visual = vis; 2597 n->visual = vis;
@@ -2643,7 +2643,7 @@ eng_image_native_set(void *data, void *image, void *native)
2643 im->native.func.bind = _native_bind_cb; 2643 im->native.func.bind = _native_bind_cb;
2644 im->native.func.unbind = _native_unbind_cb; 2644 im->native.func.unbind = _native_unbind_cb;
2645 im->native.func.free = _native_free_cb; 2645 im->native.func.free = _native_free_cb;
2646 2646
2647 glsym_evas_gl_common_image_native_enable(im); 2647 glsym_evas_gl_common_image_native_enable(im);
2648 } 2648 }
2649 } 2649 }
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 75db3436e9..d2a0617dda 100644
--- a/src/modules/evas/engines/gl_x11/evas_x_main.c
+++ b/src/modules/evas/engines/gl_x11/evas_x_main.c
@@ -490,7 +490,7 @@ try_gles2:
490 // vendor: VMware, Inc. 490 // vendor: VMware, Inc.
491 // renderer: Gallium 0.4 on softpipe 491 // renderer: Gallium 0.4 on softpipe
492 // version: 2.1 Mesa 7.9-devel 492 // version: 2.1 Mesa 7.9-devel
493 // 493 //
494 if (strstr((const char *)vendor, "Mesa Project")) 494 if (strstr((const char *)vendor, "Mesa Project"))
495 { 495 {
496 if (strstr((const char *)renderer, "Software Rasterizer")) 496 if (strstr((const char *)renderer, "Software Rasterizer"))
@@ -1578,7 +1578,7 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode)
1578 } 1578 }
1579 } 1579 }
1580 else 1580 else
1581 eglSwapBuffers(ob->egl_disp, ob->egl_surface[0]); 1581 eglSwapBuffers(ob->egl_disp, ob->egl_surface[0]);
1582 1582
1583//xx if (!safe_native) eglWaitGL(); 1583//xx if (!safe_native) eglWaitGL();
1584 if (ob->info->callback.post_swap) 1584 if (ob->info->callback.post_swap)
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_swapper.c b/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
index bb05dd6b8b..c60c9d7ee4 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
@@ -50,14 +50,14 @@ _buf_new(X_Swapper *swp, Buffer *buf)
50{ 50{
51 buf->w = swp->w; 51 buf->w = swp->w;
52 buf->h = swp->h; 52 buf->h = swp->h;
53 53
54 // try shm first 54 // try shm first
55 buf->xim = XShmCreateImage(swp->disp, swp->vis, swp->depth, ZPixmap, 55 buf->xim = XShmCreateImage(swp->disp, swp->vis, swp->depth, ZPixmap,
56 NULL, &(buf->shm_info), buf->w, buf->h); 56 NULL, &(buf->shm_info), buf->w, buf->h);
57 if (buf->xim) 57 if (buf->xim)
58 { 58 {
59 buf->bpl = buf->xim->bytes_per_line; 59 buf->bpl = buf->xim->bytes_per_line;
60 60
61 buf->shm_info.shmid = shmget(IPC_PRIVATE, buf->bpl * buf->h, 61 buf->shm_info.shmid = shmget(IPC_PRIVATE, buf->bpl * buf->h,
62 IPC_CREAT | 0777); 62 IPC_CREAT | 0777);
63 if (buf->shm_info.shmid >= 0) 63 if (buf->shm_info.shmid >= 0)
@@ -68,7 +68,7 @@ _buf_new(X_Swapper *swp, Buffer *buf)
68 if (buf->shm_info.shmaddr != ((void *)-1)) 68 if (buf->shm_info.shmaddr != ((void *)-1))
69 { 69 {
70 XErrorHandler ph; 70 XErrorHandler ph;
71 71
72 XSync(swp->disp, False); 72 XSync(swp->disp, False);
73 _x_err = EINA_FALSE; 73 _x_err = EINA_FALSE;
74 ph = XSetErrorHandler((XErrorHandler)_x_err_hand); 74 ph = XSetErrorHandler((XErrorHandler)_x_err_hand);
@@ -104,7 +104,7 @@ _buf_new(X_Swapper *swp, Buffer *buf)
104 104
105 if (!buf->xim) // shm failed - try normal ximage 105 if (!buf->xim) // shm failed - try normal ximage
106 { 106 {
107 buf->xim = XCreateImage(swp->disp, swp->vis, swp->depth, ZPixmap, 107 buf->xim = XCreateImage(swp->disp, swp->vis, swp->depth, ZPixmap,
108 0, NULL, buf->w, buf->h, 32, 0); 108 0, NULL, buf->w, buf->h, 32, 0);
109 if (!buf->xim) return EINA_FALSE; 109 if (!buf->xim) return EINA_FALSE;
110 buf->bpl = buf->xim->bytes_per_line; 110 buf->bpl = buf->xim->bytes_per_line;
@@ -143,7 +143,7 @@ _buf_put(X_Swapper *swp, Buffer *buf, Eina_Rectangle *rects, int nrects)
143{ 143{
144 Region tmpr; 144 Region tmpr;
145 int i; 145 int i;
146 146
147 if (!buf->xim) return; 147 if (!buf->xim) return;
148 tmpr = XCreateRegion(); 148 tmpr = XCreateRegion();
149 if ((rects)/* && 0*/) // set to 0 to test buffer stuff 149 if ((rects)/* && 0*/) // set to 0 to test buffer stuff
@@ -151,7 +151,7 @@ _buf_put(X_Swapper *swp, Buffer *buf, Eina_Rectangle *rects, int nrects)
151 for (i = 0; i < nrects; i++) 151 for (i = 0; i < nrects; i++)
152 { 152 {
153 XRectangle xr; 153 XRectangle xr;
154 154
155 xr.x = rects[i].x; xr.y = rects[i].y; 155 xr.x = rects[i].x; xr.y = rects[i].y;
156 xr.width = rects[i].w; xr.height = rects[i].h; 156 xr.width = rects[i].w; xr.height = rects[i].h;
157 XUnionRectWithRegion(&xr, tmpr, tmpr); 157 XUnionRectWithRegion(&xr, tmpr, tmpr);
@@ -160,7 +160,7 @@ _buf_put(X_Swapper *swp, Buffer *buf, Eina_Rectangle *rects, int nrects)
160 else 160 else
161 { 161 {
162 XRectangle xr; 162 XRectangle xr;
163 163
164 xr.x = 0; xr.y = 0; 164 xr.x = 0; xr.y = 0;
165 xr.width = buf->w; xr.height = buf->h; 165 xr.width = buf->w; xr.height = buf->h;
166 XUnionRectWithRegion(&xr, tmpr, tmpr); 166 XUnionRectWithRegion(&xr, tmpr, tmpr);
@@ -189,9 +189,9 @@ evas_xlib_swapper_new(Display *disp, Drawable draw, Visual *vis,
189 X_Swapper *swp; 189 X_Swapper *swp;
190 XGCValues gcv; 190 XGCValues gcv;
191 int i; 191 int i;
192 192
193 int nbuf = 3; // pretend we are triple buffered 193 int nbuf = 3; // pretend we are triple buffered
194 194
195 swp = calloc(1, sizeof(X_Swapper)); 195 swp = calloc(1, sizeof(X_Swapper));
196 if (!swp) return NULL; 196 if (!swp) return NULL;
197 swp->disp = disp; 197 swp->disp = disp;
@@ -246,7 +246,7 @@ void
246evas_xlib_swapper_swap(X_Swapper *swp, Eina_Rectangle *rects, int nrects) 246evas_xlib_swapper_swap(X_Swapper *swp, Eina_Rectangle *rects, int nrects)
247{ 247{
248 int n; 248 int n;
249 249
250 n = swp->buf_cur; 250 n = swp->buf_cur;
251 _buf_put(swp, &(swp->buf[n]), rects, nrects); 251 _buf_put(swp, &(swp->buf[n]), rects, nrects);
252 swp->buf[n].valid = 1; 252 swp->buf[n].valid = 1;
@@ -257,7 +257,7 @@ Render_Engine_Swap_Mode
257evas_xlib_swapper_buffer_state_get(X_Swapper *swp) 257evas_xlib_swapper_buffer_state_get(X_Swapper *swp)
258{ 258{
259 int i, n, count = 0; 259 int i, n, count = 0;
260/* 260/*
261 for (i = 0; i < swp->buf_num; i++) 261 for (i = 0; i < swp->buf_num; i++)
262 { 262 {
263 if ((rand() % 50) == 0) 263 if ((rand() % 50) == 0)
@@ -434,13 +434,13 @@ _drm_init(Display *disp, int scr)
434{ 434{
435 char *drv_name = NULL, *dev_name = NULL; 435 char *drv_name = NULL, *dev_name = NULL;
436 drm_magic_t magic = 0; 436 drm_magic_t magic = 0;
437 437
438 if (swap_debug == -1) 438 if (swap_debug == -1)
439 { 439 {
440 if (getenv("EVAS_SWAPPER_DEBUG")) swap_debug = 1; 440 if (getenv("EVAS_SWAPPER_DEBUG")) swap_debug = 1;
441 else swap_debug = 0; 441 else swap_debug = 0;
442 } 442 }
443 443
444 if (xfixes_lib) return EINA_TRUE; 444 if (xfixes_lib) return EINA_TRUE;
445 if ((tried) && (!xfixes_lib)) return EINA_FALSE; 445 if ((tried) && (!xfixes_lib)) return EINA_FALSE;
446 tried = EINA_TRUE; 446 tried = EINA_TRUE;
@@ -471,7 +471,7 @@ _drm_init(Display *disp, int scr)
471 if (swap_debug) ERR("Can't load libXfixes.so.3"); 471 if (swap_debug) ERR("Can't load libXfixes.so.3");
472 goto err; 472 goto err;
473 } 473 }
474 474
475#define SYM(l, x) \ 475#define SYM(l, x) \
476 do { sym_ ## x = dlsym(l, #x); \ 476 do { sym_ ## x = dlsym(l, #x); \
477 if (!sym_ ## x) { \ 477 if (!sym_ ## x) { \
@@ -479,7 +479,7 @@ _drm_init(Display *disp, int scr)
479 goto err; \ 479 goto err; \
480 } \ 480 } \
481 } while (0) 481 } while (0)
482 482
483 SYM(drm_lib, drmGetMagic); 483 SYM(drm_lib, drmGetMagic);
484 484
485 if (!slp_mode) 485 if (!slp_mode)
@@ -523,14 +523,14 @@ _drm_init(Display *disp, int scr)
523 SYM(xfixes_lib, XFixesQueryVersion); 523 SYM(xfixes_lib, XFixesQueryVersion);
524 SYM(xfixes_lib, XFixesCreateRegion); 524 SYM(xfixes_lib, XFixesCreateRegion);
525 SYM(xfixes_lib, XFixesDestroyRegion); 525 SYM(xfixes_lib, XFixesDestroyRegion);
526 526
527 if (!sym_XFixesQueryExtension(disp, &xfixes_ev_base, &xfixes_err_base)) 527 if (!sym_XFixesQueryExtension(disp, &xfixes_ev_base, &xfixes_err_base))
528 { 528 {
529 if (swap_debug) ERR("XFixes extension not in xserver"); 529 if (swap_debug) ERR("XFixes extension not in xserver");
530 goto err; 530 goto err;
531 } 531 }
532 sym_XFixesQueryVersion(disp, &xfixes_major, &xfixes_minor); 532 sym_XFixesQueryVersion(disp, &xfixes_major, &xfixes_minor);
533 533
534 if (!sym_DRI2QueryExtension(disp, &dri2_ev_base, &dri2_err_base)) 534 if (!sym_DRI2QueryExtension(disp, &dri2_ev_base, &dri2_err_base))
535 { 535 {
536 if (swap_debug) ERR("DRI2 extension not in xserver"); 536 if (swap_debug) ERR("DRI2 extension not in xserver");
@@ -563,7 +563,7 @@ _drm_init(Display *disp, int scr)
563 if (swap_debug) ERR("DRM get magic failed"); 563 if (swap_debug) ERR("DRM get magic failed");
564 goto err; 564 goto err;
565 } 565 }
566 if (!sym_DRI2Authenticate(disp, RootWindow(disp, scr), 566 if (!sym_DRI2Authenticate(disp, RootWindow(disp, scr),
567 (unsigned int)magic)) 567 (unsigned int)magic))
568 { 568 {
569 if (swap_debug) ERR("DRI2 authenticate failed with magic 0x%x on screen %i", (unsigned int)magic, scr); 569 if (swap_debug) ERR("DRI2 authenticate failed with magic 0x%x on screen %i", (unsigned int)magic, scr);
@@ -621,7 +621,7 @@ _drm_shutdown(void)
621 // though, as once shut down, we have to re-init and this could be 621 // though, as once shut down, we have to re-init and this could be
622 // expensive especially if u have a single canvas that is changing config 622 // expensive especially if u have a single canvas that is changing config
623 // and being shut down and re-initted a few times. 623 // and being shut down and re-initted a few times.
624/* 624/*
625 if (bufmgr) 625 if (bufmgr)
626 { 626 {
627 sym_tbm_bufmgr_deinit(bufmgr); 627 sym_tbm_bufmgr_deinit(bufmgr);
@@ -663,7 +663,7 @@ evas_xlib_swapper_new(Display *disp, Drawable draw, Visual *vis,
663 if (!_drm_init(disp, 0)) return NULL; 663 if (!_drm_init(disp, 0)) return NULL;
664 } 664 }
665 inits++; 665 inits++;
666 666
667 swp = calloc(1, sizeof(X_Swapper)); 667 swp = calloc(1, sizeof(X_Swapper));
668 if (!swp) return NULL; 668 if (!swp) return NULL;
669 swp->disp = disp; 669 swp->disp = disp;
@@ -692,7 +692,7 @@ void
692evas_xlib_swapper_free(X_Swapper *swp) 692evas_xlib_swapper_free(X_Swapper *swp)
693{ 693{
694 Buffer *b; 694 Buffer *b;
695 695
696 if (swap_debug) printf("Swapper free\n"); 696 if (swap_debug) printf("Swapper free\n");
697 if (swp->mapped) evas_xlib_swapper_buffer_unmap(swp); 697 if (swp->mapped) evas_xlib_swapper_buffer_unmap(swp);
698 EINA_LIST_FREE(swp->buf_cache, b) 698 EINA_LIST_FREE(swp->buf_cache, b)
@@ -715,7 +715,7 @@ evas_xlib_swapper_buffer_map(X_Swapper *swp, int *bpl, int *w, int *h)
715 Eina_List *l; 715 Eina_List *l;
716 Buffer *b; 716 Buffer *b;
717 DRI2BufferFlags *flags; 717 DRI2BufferFlags *flags;
718 718
719 if (swp->mapped) 719 if (swp->mapped)
720 { 720 {
721 if (bpl) 721 if (bpl)
@@ -727,7 +727,7 @@ evas_xlib_swapper_buffer_map(X_Swapper *swp, int *bpl, int *w, int *h)
727 if (h) *h = swp->h; 727 if (h) *h = swp->h;
728 return swp->buf_data; 728 return swp->buf_data;
729 } 729 }
730 swp->buf = sym_DRI2GetBuffers(swp->disp, swp->draw, 730 swp->buf = sym_DRI2GetBuffers(swp->disp, swp->draw,
731 &(swp->buf_w), &(swp->buf_h), 731 &(swp->buf_w), &(swp->buf_h),
732 &attach, 1, &num); 732 &attach, 1, &num);
733 if (!swp->buf) return NULL; 733 if (!swp->buf) return NULL;
@@ -840,7 +840,7 @@ evas_xlib_swapper_swap(X_Swapper *swp, Eina_Rectangle *rects, int nrects)
840 XID region; 840 XID region;
841 int i; 841 int i;
842 unsigned long long sbc_count = 0; 842 unsigned long long sbc_count = 0;
843 843
844 if (swap_debug) printf("Swap buffers\n"); 844 if (swap_debug) printf("Swap buffers\n");
845 for (i = 0; i < nrects; i++) 845 for (i = 0; i < nrects; i++)
846 { 846 {
@@ -856,7 +856,7 @@ Render_Engine_Swap_Mode
856evas_xlib_swapper_buffer_state_get(X_Swapper *swp) 856evas_xlib_swapper_buffer_state_get(X_Swapper *swp)
857{ 857{
858 DRI2BufferFlags *flags; 858 DRI2BufferFlags *flags;
859 859
860 if (!swp->mapped) evas_xlib_swapper_buffer_map(swp, NULL, NULL, NULL); 860 if (!swp->mapped) evas_xlib_swapper_buffer_map(swp, NULL, NULL, NULL);
861 if (!swp->mapped) return MODE_FULL; 861 if (!swp->mapped) return MODE_FULL;
862 flags = (DRI2BufferFlags *)(&(swp->buf->flags)); 862 flags = (DRI2BufferFlags *)(&(swp->buf->flags));