Fixed all unused variables warnings.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
Zhigang Gong 2012-04-28 14:55:34 +08:00 committed by Eric Anholt
parent 33e11cd614
commit 1035fc72b9
12 changed files with 14 additions and 44 deletions

View File

@ -136,7 +136,6 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
glamor_get_screen_private(screen);
glamor_pixmap_fbo *fbo;
int pitch;
int flag;
GLenum format;
if (w > 32767 || h > 32767)
@ -463,8 +462,6 @@ glamor_close_screen(int idx, ScreenPtr screen)
{
glamor_screen_private *glamor_priv;
PixmapPtr screen_pixmap;
glamor_pixmap_private *screen_pixmap_priv;
glamor_pixmap_fbo *fbo;
int flags;
glamor_priv = glamor_get_screen_private(screen);

View File

@ -398,8 +398,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
if (src_pixmap_priv->type == GLAMOR_DRM_ONLY
|| dst_pixmap_priv->type == GLAMOR_DRM_ONLY) {
LogMessage(X_WARNING,
"Access a DRM only pixmap is not allowed within glamor.\n",
dst->pScreen->myNum);
"Access a DRM only pixmap is not allowed within glamor.\n");
return TRUE;
}
glamor_report_delayed_fallbacks(src->pScreen);

View File

@ -260,10 +260,9 @@ glamor_egl_check_has_gem(int fd)
{
struct drm_gem_flink flink;
flink.handle = 0;
int err;
ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink);
if (errno == ENOENT || err == EINVAL)
if (errno == ENOENT || errno == EINVAL)
return TRUE;
return FALSE;
}

View File

@ -98,7 +98,6 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
{
struct xorg_list *cache;
glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL;
int size;
int n_format;
#ifdef NO_FBO_CACHE
return NULL;
@ -436,7 +435,7 @@ _glamor_create_tex(glamor_screen_private *glamor_priv,
int w, int h, GLenum format)
{
glamor_gl_dispatch *dispatch;
int tex;
unsigned int tex;
dispatch = glamor_get_dispatch(glamor_priv);
dispatch->glGenTextures(1, &tex);
@ -451,15 +450,12 @@ _glamor_create_tex(glamor_screen_private *glamor_priv,
return tex;
}
glamor_pixmap_fbo *
glamor_create_fbo(glamor_screen_private *glamor_priv,
int w, int h,
GLenum format,
int flag)
{
glamor_gl_dispatch *dispatch;
glamor_pixmap_fbo *fbo;
GLint tex = 0;
int cache_flag;

View File

@ -40,7 +40,7 @@ glamor_fill(DrawablePtr drawable,
PixmapPtr sub_pixmap = NULL;
glamor_access_t sub_pixmap_access;
DrawablePtr saved_drawable = NULL;
int saved_x, saved_y;
int saved_x = x, saved_y = y;
glamor_get_drawable_deltas(drawable, dst_pixmap, &off_x, &off_y);
@ -119,8 +119,6 @@ glamor_fill(DrawablePtr drawable,
}
if (sub_pixmap != NULL) {
struct pixman_box16 box;
int dx, dy;
if (gc->fillStyle != FillSolid) {
gc->patOrg.x -= (saved_drawable->x - saved_x);
gc->patOrg.y -= (saved_drawable->y - saved_y);

View File

@ -37,7 +37,6 @@ _glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h,
PixmapPtr pixmap, sub_pixmap;
struct glamor_pixmap_private *pixmap_priv;
int x_off, y_off;
Bool ret = FALSE;
int stride;
void *data;

View File

@ -33,8 +33,6 @@ _glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr * ppci, pointer pglyphBase, Bool fallback)
{
glamor_screen_private *glamor_priv;
if (!fallback
&& glamor_ddx_fallback_check_pixmap(pDrawable)
&& glamor_ddx_fallback_check_gc(pGC))
@ -65,8 +63,6 @@ _glamor_poly_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph,
CharInfoPtr * ppci, pointer pglyphBase, Bool fallback)
{
glamor_screen_private *glamor_priv;
if (!fallback
&& glamor_ddx_fallback_check_pixmap(pDrawable)
&& glamor_ddx_fallback_check_gc(pGC))

View File

@ -188,7 +188,6 @@ glamor_set_alu(struct glamor_gl_dispatch *dispatch, unsigned char alu)
void *
_glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int stride, int revert)
{
void *bits;
PictFormatShort dst_format, src_format;
pixman_image_t *dst_image;
pixman_image_t *src_image;
@ -209,7 +208,6 @@ _glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int st
dst_bits,
stride);
if (dst_image == NULL) {
free(bits);
return NULL;
}
@ -220,7 +218,6 @@ _glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int st
if (src_image == NULL) {
pixman_image_unref(dst_image);
free(bits);
return NULL;
}
@ -384,7 +381,7 @@ glamor_color_convert_to_bits(void *src_bits, void *dst_bits, int w, int h, int s
**/
int in_restore = 0;
static void
__glamor_upload_pixmap_to_texture(PixmapPtr pixmap, int *tex,
__glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex,
GLenum format,
GLenum type,
int x, int y, int w, int h,
@ -394,7 +391,7 @@ __glamor_upload_pixmap_to_texture(PixmapPtr pixmap, int *tex,
glamor_get_screen_private(pixmap->drawable.pScreen);
glamor_gl_dispatch *dispatch;
int non_sub = 0;
int iformat;
unsigned int iformat = 0;
dispatch = glamor_get_dispatch(glamor_priv);
if (*tex == 0) {
@ -480,7 +477,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, GLenum ty
stride,
no_alpha, revert, swap_rb);
if (bits == NULL) {
ErrorF("Failed to convert pixmap no_alpha %d, revert mode %d, swap mode %d\n", swap_rb);
ErrorF("Failed to convert pixmap no_alpha %d,"
"revert mode %d, swap mode %d\n", no_alpha, revert, swap_rb);
return FALSE;
}
no_alpha = 0;
@ -698,8 +696,7 @@ void
glamor_restore_pixmap_to_texture(PixmapPtr pixmap)
{
if (glamor_upload_pixmap_to_texture(pixmap) != GLAMOR_UPLOAD_DONE)
LogMessage(X_WARNING, "Failed to restore pixmap to texture.\n",
pixmap->drawable.pScreen->myNum);
LogMessage(X_WARNING, "Failed to restore pixmap to texture.\n");
}
/*
@ -800,7 +797,7 @@ glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, int x, int y, int w, int h,
int stride, void *bits, int pbo, glamor_access_t access)
{
glamor_pixmap_private *pixmap_priv;
GLenum format, type, gl_access, gl_usage;
GLenum format, type, gl_access = 0, gl_usage = 0;
int no_alpha, revert, swap_rb;
void *data, *read;
ScreenPtr screen;
@ -904,7 +901,7 @@ glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, int x, int y, int w, int h,
dispatch->glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
}
} else {
int temp_pbo;
unsigned int temp_pbo;
int yy;
dispatch = glamor_get_dispatch(glamor_priv);
@ -940,8 +937,6 @@ glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, int x, int y, int w, int h,
revert, swap_rb);
}
done:
if (temp_fbo != NULL)
glamor_destroy_fbo(temp_fbo);
if (need_free_data)
@ -965,9 +960,7 @@ glamor_download_pixmap_to_cpu(PixmapPtr pixmap, glamor_access_t access)
{
glamor_pixmap_private *pixmap_priv =
glamor_get_pixmap_private(pixmap);
unsigned int stride, y;
GLenum format, type, gl_access, gl_usage;
int no_alpha, revert, swap_rb;
unsigned int stride;
void *data = NULL, *dst;
ScreenPtr screen;
glamor_screen_private *glamor_priv =
@ -1024,8 +1017,6 @@ glamor_download_pixmap_to_cpu(PixmapPtr pixmap, glamor_access_t access)
pixmap_priv->gl_fbo = GLAMOR_FBO_DOWNLOADED;
done:
pixmap->devPrivate.ptr = dst;
return TRUE;
@ -1188,7 +1179,7 @@ glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y, int w, int h, glamor_acces
return sub_pixmap;
}
PixmapPtr
void
glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y, int w, int h, glamor_access_t access)
{
void *bits;

View File

@ -44,7 +44,6 @@ _glamor_poly_fill_rect(DrawablePtr drawable,
RegionPtr pClip = fbGetCompositeClip(gc);
Bool ret = FALSE;
glamor_screen_private *glamor_priv;
xRectangle *saved_prect = prect;
glamor_priv = glamor_get_screen_private(drawable->pScreen);

View File

@ -648,8 +648,7 @@ glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, int h
PixmapPtr
glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y,
int w, int h, glamor_access_t access);
PixmapPtr
void
glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y,
int w, int h, glamor_access_t access);

View File

@ -255,7 +255,6 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
glamor_get_pixmap_private(pixmap);
RegionPtr clip;
int x_off, y_off;
float vertices[8], texcoords[8];
Bool ret = FALSE;
PixmapPtr temp_pixmap, sub_pixmap;
glamor_pixmap_private *temp_pixmap_priv;

View File

@ -1018,8 +1018,6 @@ static inline void glamor_compare_pictures( ScreenPtr screen,
PixmapPtr fst_pixmap;
PixmapPtr snd_pixmap;
int fst_generated, snd_generated;
glamor_pixmap_private *fst_pixmap_priv;
glamor_pixmap_private *snd_pixmap_priv;
int error;
int fst_type = -1;
int snd_type = -1; // -1 represent has drawable.