We miss the strict warning flags for a long time, now add it back.
This commit also fixed most of the warnings after enable the strict
flags.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
INCLUDES = \
$(XORG_INCS)
-AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
+AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS) $(LIBDRM_CFLAGS)
libglamor_la_LDFLAGS = -avoid-version
glamor_screen_private *glamor_priv;
PixmapPtr screen_pixmap;
int flags;
-
- glamor_priv = glamor_get_screen_private(screen);
- flags = glamor_priv->flags;
#ifdef RENDER
PictureScreenPtr ps = GetPictureScreenIfSet(screen);
#endif
+ glamor_priv = glamor_get_screen_private(screen);
+ flags = glamor_priv->flags;
glamor_glyphs_fini(screen);
screen->CloseScreen = glamor_priv->saved_procs.close_screen;
if (flags & GLAMOR_USE_SCREEN) {
* */
extern _X_EXPORT void glamor_egl_exchange_buffers(PixmapPtr front, PixmapPtr back);
+extern _X_EXPORT void glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back);
+
+
#ifdef GLAMOR_FOR_XORG
#define GLAMOR_EGL_MODULE_NAME "glamoregl"
struct gbm_device *gbm;
#endif
int has_gem;
- void *gl_context, *old_context;
+ void *glamor_context;
+ void *current_context;
int gl_context_depth;
PFNEGLCREATEIMAGEKHRPROC egl_create_image_khr;
if (glamor_egl->gl_context_depth++)
return;
- GET_CURRENT_CONTEXT(current);
- glamor_egl->old_context = current;
+ GET_CURRENT_CONTEXT(glamor_egl->current_context);
- if (glamor_egl->gl_context != current) {
+ if (glamor_egl->glamor_context != glamor_egl->current_context) {
eglMakeCurrent(glamor_egl->display, EGL_NO_SURFACE,
EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!eglMakeCurrent(glamor_egl->display,
if (--glamor_egl->gl_context_depth)
return;
- if (glamor_egl->old_context &&
- glamor_egl->gl_context != glamor_egl->old_context)
- SET_CURRENT_CONTEXT(glamor_egl->old_context);
+ if (glamor_egl->current_context &&
+ glamor_egl->glamor_context != glamor_egl->current_context)
+ SET_CURRENT_CONTEXT(glamor_egl->current_context);
}
#else
#define glamor_egl_make_current(x)
return TRUE;
}
-Bool
+static Bool
glamor_egl_check_has_gem(int fd)
{
struct drm_gem_flink flink;
return FALSE;
}
#ifdef GLX_USE_SHARED_DISPATCH
- GET_CURRENT_CONTEXT(current);
- glamor_egl->gl_context = current;
+ GET_CURRENT_CONTEXT(glamor_egl->glamor_context);
#endif
glamor_egl->saved_free_screen = scrn->FreeScreen;
scrn->FreeScreen = glamor_egl_free_screen;
return order;
}
-glamor_pixmap_fbo *
+static glamor_pixmap_fbo *
glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
int w, int h, GLenum format, int flag)
{
}
-glamor_pixmap_fbo *
+static glamor_pixmap_fbo *
glamor_create_tex_obj(glamor_screen_private *glamor_priv,
int w, int h, GLenum format, int flag)
{
return fbo;
}
-void
+static void
glamor_destroy_tex_obj(glamor_pixmap_fbo * tex_obj)
{
assert(tex_obj->fb == 0);
glamor_pixmap_fbo_cache_put(tex_obj);
}
-int
+static int
_glamor_create_tex(glamor_screen_private *glamor_priv,
int w, int h, GLenum format)
{
return TRUE;
}
-void *
+static void *
_glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int stride, int revert)
{
PictFormatShort dst_format, src_format;
(*dst) = ((a) << (a_shift)) | ((r) << (b_shift)) | ((g) << (g_shift)) | ((b) << (r_shift)); \
}
-void *
+static void *
_glamor_color_revert_x2b10g10r10(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb)
{
int x,y;
}
-void *
+static void *
_glamor_color_revert_x1b5g5r5(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb)
{
int x,y;
*
*/
-void *
+static void *
glamor_color_convert_to_bits(void *src_bits, void *dst_bits, int w, int h, int stride, int no_alpha, int revert, int swap_rb)
{
if (revert == REVERT_DOWNLOADING_A1 || revert == REVERT_UPLOADING_A1) {
read = dispatch->glMapBuffer(GL_PIXEL_PACK_BUFFER,
GL_READ_ONLY);
for (yy = 0; yy < pixmap->drawable.height; yy++)
- memcpy(data + yy * stride,
- read + (h - yy - 1) * stride, stride);
+ memcpy((char*)data + yy * stride,
+ (char*)read + (h - yy - 1) * stride, stride);
dispatch->glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
dispatch->glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
dispatch->glDeleteBuffers(1, &temp_pbo);
PictFormatShort saved_source_format = 0;
float src_matrix[9], mask_matrix[9];
GLfloat source_solid_color[4], mask_solid_color[4];
- dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
int vert_stride = 4;
int nrect_max;
Bool ret = FALSE;
+ dest_pixmap_priv = glamor_get_pixmap_private(dest_pixmap);
if (!GLAMOR_PIXMAP_PRIV_HAS_FBO(dest_pixmap_priv)) {
glamor_fallback("dest has no fbo.\n");
goto fail;
int little_endian = 0;
unsigned char *p_test;
int bpp = pixmap1->drawable.depth == 8 ? 1 : 4;
+ int stride = pixmap1->devKind;
assert(pixmap1->devKind == pixmap2->devKind);
- int stride = pixmap1->devKind;
ErrorF("stride:%d, width:%d, height:%d\n", stride, w, h);
extern const void *_glapi_Context;
# define GET_DISPATCH() _glapi_tls_Dispatch
-# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_tls_Context
+# define GET_CURRENT_CONTEXT(C) C = (typeof(C)) _glapi_tls_Context
# define SET_CURRENT_CONTEXT(C) _glapi_tls_Context = (void*)C
#else
# define GET_DISPATCH() \
(likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
-# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \
+# define GET_CURRENT_CONTEXT(C) C = (typeof(C)) \
(likely(_glapi_Context) ? _glapi_Context : _glapi_get_context())
# else
# define GET_DISPATCH() _glapi_Dispatch
-# define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) _glapi_Context
+# define GET_CURRENT_CONTEXT(C) C = (typeof(C)) _glapi_Context
# define SET_CURRENT_CONTEXT(C) _glapi_Context = (void*)C
# endif