Fixed all unused variables warnings.
Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
parent
33e11cd614
commit
1035fc72b9
|
@ -136,7 +136,6 @@ glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
|
||||||
glamor_get_screen_private(screen);
|
glamor_get_screen_private(screen);
|
||||||
glamor_pixmap_fbo *fbo;
|
glamor_pixmap_fbo *fbo;
|
||||||
int pitch;
|
int pitch;
|
||||||
int flag;
|
|
||||||
GLenum format;
|
GLenum format;
|
||||||
|
|
||||||
if (w > 32767 || h > 32767)
|
if (w > 32767 || h > 32767)
|
||||||
|
@ -463,8 +462,6 @@ glamor_close_screen(int idx, ScreenPtr screen)
|
||||||
{
|
{
|
||||||
glamor_screen_private *glamor_priv;
|
glamor_screen_private *glamor_priv;
|
||||||
PixmapPtr screen_pixmap;
|
PixmapPtr screen_pixmap;
|
||||||
glamor_pixmap_private *screen_pixmap_priv;
|
|
||||||
glamor_pixmap_fbo *fbo;
|
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
glamor_priv = glamor_get_screen_private(screen);
|
glamor_priv = glamor_get_screen_private(screen);
|
||||||
|
|
|
@ -398,8 +398,7 @@ _glamor_copy_n_to_n(DrawablePtr src,
|
||||||
if (src_pixmap_priv->type == GLAMOR_DRM_ONLY
|
if (src_pixmap_priv->type == GLAMOR_DRM_ONLY
|
||||||
|| dst_pixmap_priv->type == GLAMOR_DRM_ONLY) {
|
|| dst_pixmap_priv->type == GLAMOR_DRM_ONLY) {
|
||||||
LogMessage(X_WARNING,
|
LogMessage(X_WARNING,
|
||||||
"Access a DRM only pixmap is not allowed within glamor.\n",
|
"Access a DRM only pixmap is not allowed within glamor.\n");
|
||||||
dst->pScreen->myNum);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
glamor_report_delayed_fallbacks(src->pScreen);
|
glamor_report_delayed_fallbacks(src->pScreen);
|
||||||
|
|
|
@ -260,10 +260,9 @@ glamor_egl_check_has_gem(int fd)
|
||||||
{
|
{
|
||||||
struct drm_gem_flink flink;
|
struct drm_gem_flink flink;
|
||||||
flink.handle = 0;
|
flink.handle = 0;
|
||||||
int err;
|
|
||||||
|
|
||||||
ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink);
|
ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink);
|
||||||
if (errno == ENOENT || err == EINVAL)
|
if (errno == ENOENT || errno == EINVAL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,6 @@ glamor_pixmap_fbo_cache_get(glamor_screen_private *glamor_priv,
|
||||||
{
|
{
|
||||||
struct xorg_list *cache;
|
struct xorg_list *cache;
|
||||||
glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL;
|
glamor_pixmap_fbo *fbo_entry, *ret_fbo = NULL;
|
||||||
int size;
|
|
||||||
int n_format;
|
int n_format;
|
||||||
#ifdef NO_FBO_CACHE
|
#ifdef NO_FBO_CACHE
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -436,7 +435,7 @@ _glamor_create_tex(glamor_screen_private *glamor_priv,
|
||||||
int w, int h, GLenum format)
|
int w, int h, GLenum format)
|
||||||
{
|
{
|
||||||
glamor_gl_dispatch *dispatch;
|
glamor_gl_dispatch *dispatch;
|
||||||
int tex;
|
unsigned int tex;
|
||||||
|
|
||||||
dispatch = glamor_get_dispatch(glamor_priv);
|
dispatch = glamor_get_dispatch(glamor_priv);
|
||||||
dispatch->glGenTextures(1, &tex);
|
dispatch->glGenTextures(1, &tex);
|
||||||
|
@ -451,15 +450,12 @@ _glamor_create_tex(glamor_screen_private *glamor_priv,
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
glamor_pixmap_fbo *
|
glamor_pixmap_fbo *
|
||||||
glamor_create_fbo(glamor_screen_private *glamor_priv,
|
glamor_create_fbo(glamor_screen_private *glamor_priv,
|
||||||
int w, int h,
|
int w, int h,
|
||||||
GLenum format,
|
GLenum format,
|
||||||
int flag)
|
int flag)
|
||||||
{
|
{
|
||||||
glamor_gl_dispatch *dispatch;
|
|
||||||
glamor_pixmap_fbo *fbo;
|
glamor_pixmap_fbo *fbo;
|
||||||
GLint tex = 0;
|
GLint tex = 0;
|
||||||
int cache_flag;
|
int cache_flag;
|
||||||
|
|
|
@ -40,7 +40,7 @@ glamor_fill(DrawablePtr drawable,
|
||||||
PixmapPtr sub_pixmap = NULL;
|
PixmapPtr sub_pixmap = NULL;
|
||||||
glamor_access_t sub_pixmap_access;
|
glamor_access_t sub_pixmap_access;
|
||||||
DrawablePtr saved_drawable = NULL;
|
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);
|
glamor_get_drawable_deltas(drawable, dst_pixmap, &off_x, &off_y);
|
||||||
|
|
||||||
|
@ -119,8 +119,6 @@ glamor_fill(DrawablePtr drawable,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sub_pixmap != NULL) {
|
if (sub_pixmap != NULL) {
|
||||||
struct pixman_box16 box;
|
|
||||||
int dx, dy;
|
|
||||||
if (gc->fillStyle != FillSolid) {
|
if (gc->fillStyle != FillSolid) {
|
||||||
gc->patOrg.x -= (saved_drawable->x - saved_x);
|
gc->patOrg.x -= (saved_drawable->x - saved_x);
|
||||||
gc->patOrg.y -= (saved_drawable->y - saved_y);
|
gc->patOrg.y -= (saved_drawable->y - saved_y);
|
||||||
|
|
|
@ -37,7 +37,6 @@ _glamor_get_image(DrawablePtr drawable, int x, int y, int w, int h,
|
||||||
PixmapPtr pixmap, sub_pixmap;
|
PixmapPtr pixmap, sub_pixmap;
|
||||||
struct glamor_pixmap_private *pixmap_priv;
|
struct glamor_pixmap_private *pixmap_priv;
|
||||||
int x_off, y_off;
|
int x_off, y_off;
|
||||||
Bool ret = FALSE;
|
|
||||||
int stride;
|
int stride;
|
||||||
void *data;
|
void *data;
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,6 @@ _glamor_image_glyph_blt(DrawablePtr pDrawable, GCPtr pGC,
|
||||||
int x, int y, unsigned int nglyph,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr * ppci, pointer pglyphBase, Bool fallback)
|
CharInfoPtr * ppci, pointer pglyphBase, Bool fallback)
|
||||||
{
|
{
|
||||||
glamor_screen_private *glamor_priv;
|
|
||||||
|
|
||||||
if (!fallback
|
if (!fallback
|
||||||
&& glamor_ddx_fallback_check_pixmap(pDrawable)
|
&& glamor_ddx_fallback_check_pixmap(pDrawable)
|
||||||
&& glamor_ddx_fallback_check_gc(pGC))
|
&& 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,
|
int x, int y, unsigned int nglyph,
|
||||||
CharInfoPtr * ppci, pointer pglyphBase, Bool fallback)
|
CharInfoPtr * ppci, pointer pglyphBase, Bool fallback)
|
||||||
{
|
{
|
||||||
glamor_screen_private *glamor_priv;
|
|
||||||
|
|
||||||
if (!fallback
|
if (!fallback
|
||||||
&& glamor_ddx_fallback_check_pixmap(pDrawable)
|
&& glamor_ddx_fallback_check_pixmap(pDrawable)
|
||||||
&& glamor_ddx_fallback_check_gc(pGC))
|
&& glamor_ddx_fallback_check_gc(pGC))
|
||||||
|
|
|
@ -188,7 +188,6 @@ glamor_set_alu(struct glamor_gl_dispatch *dispatch, unsigned char alu)
|
||||||
void *
|
void *
|
||||||
_glamor_color_convert_a1_a8(void *src_bits, void *dst_bits, int w, int h, int stride, int revert)
|
_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;
|
PictFormatShort dst_format, src_format;
|
||||||
pixman_image_t *dst_image;
|
pixman_image_t *dst_image;
|
||||||
pixman_image_t *src_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,
|
dst_bits,
|
||||||
stride);
|
stride);
|
||||||
if (dst_image == NULL) {
|
if (dst_image == NULL) {
|
||||||
free(bits);
|
|
||||||
return NULL;
|
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) {
|
if (src_image == NULL) {
|
||||||
pixman_image_unref(dst_image);
|
pixman_image_unref(dst_image);
|
||||||
free(bits);
|
|
||||||
return NULL;
|
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;
|
int in_restore = 0;
|
||||||
static void
|
static void
|
||||||
__glamor_upload_pixmap_to_texture(PixmapPtr pixmap, int *tex,
|
__glamor_upload_pixmap_to_texture(PixmapPtr pixmap, unsigned int *tex,
|
||||||
GLenum format,
|
GLenum format,
|
||||||
GLenum type,
|
GLenum type,
|
||||||
int x, int y, int w, int h,
|
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_get_screen_private(pixmap->drawable.pScreen);
|
||||||
glamor_gl_dispatch *dispatch;
|
glamor_gl_dispatch *dispatch;
|
||||||
int non_sub = 0;
|
int non_sub = 0;
|
||||||
int iformat;
|
unsigned int iformat = 0;
|
||||||
|
|
||||||
dispatch = glamor_get_dispatch(glamor_priv);
|
dispatch = glamor_get_dispatch(glamor_priv);
|
||||||
if (*tex == 0) {
|
if (*tex == 0) {
|
||||||
|
@ -480,7 +477,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, GLenum ty
|
||||||
stride,
|
stride,
|
||||||
no_alpha, revert, swap_rb);
|
no_alpha, revert, swap_rb);
|
||||||
if (bits == NULL) {
|
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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
no_alpha = 0;
|
no_alpha = 0;
|
||||||
|
@ -698,8 +696,7 @@ void
|
||||||
glamor_restore_pixmap_to_texture(PixmapPtr pixmap)
|
glamor_restore_pixmap_to_texture(PixmapPtr pixmap)
|
||||||
{
|
{
|
||||||
if (glamor_upload_pixmap_to_texture(pixmap) != GLAMOR_UPLOAD_DONE)
|
if (glamor_upload_pixmap_to_texture(pixmap) != GLAMOR_UPLOAD_DONE)
|
||||||
LogMessage(X_WARNING, "Failed to restore pixmap to texture.\n",
|
LogMessage(X_WARNING, "Failed to restore pixmap to texture.\n");
|
||||||
pixmap->drawable.pScreen->myNum);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -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)
|
int stride, void *bits, int pbo, glamor_access_t access)
|
||||||
{
|
{
|
||||||
glamor_pixmap_private *pixmap_priv;
|
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;
|
int no_alpha, revert, swap_rb;
|
||||||
void *data, *read;
|
void *data, *read;
|
||||||
ScreenPtr screen;
|
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);
|
dispatch->glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int temp_pbo;
|
unsigned int temp_pbo;
|
||||||
int yy;
|
int yy;
|
||||||
|
|
||||||
dispatch = glamor_get_dispatch(glamor_priv);
|
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);
|
revert, swap_rb);
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
|
||||||
|
|
||||||
if (temp_fbo != NULL)
|
if (temp_fbo != NULL)
|
||||||
glamor_destroy_fbo(temp_fbo);
|
glamor_destroy_fbo(temp_fbo);
|
||||||
if (need_free_data)
|
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_pixmap_private *pixmap_priv =
|
||||||
glamor_get_pixmap_private(pixmap);
|
glamor_get_pixmap_private(pixmap);
|
||||||
unsigned int stride, y;
|
unsigned int stride;
|
||||||
GLenum format, type, gl_access, gl_usage;
|
|
||||||
int no_alpha, revert, swap_rb;
|
|
||||||
void *data = NULL, *dst;
|
void *data = NULL, *dst;
|
||||||
ScreenPtr screen;
|
ScreenPtr screen;
|
||||||
glamor_screen_private *glamor_priv =
|
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;
|
pixmap_priv->gl_fbo = GLAMOR_FBO_DOWNLOADED;
|
||||||
|
|
||||||
done:
|
|
||||||
|
|
||||||
pixmap->devPrivate.ptr = dst;
|
pixmap->devPrivate.ptr = dst;
|
||||||
|
|
||||||
return TRUE;
|
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;
|
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)
|
glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y, int w, int h, glamor_access_t access)
|
||||||
{
|
{
|
||||||
void *bits;
|
void *bits;
|
||||||
|
|
|
@ -44,7 +44,6 @@ _glamor_poly_fill_rect(DrawablePtr drawable,
|
||||||
RegionPtr pClip = fbGetCompositeClip(gc);
|
RegionPtr pClip = fbGetCompositeClip(gc);
|
||||||
Bool ret = FALSE;
|
Bool ret = FALSE;
|
||||||
glamor_screen_private *glamor_priv;
|
glamor_screen_private *glamor_priv;
|
||||||
xRectangle *saved_prect = prect;
|
|
||||||
|
|
||||||
glamor_priv = glamor_get_screen_private(drawable->pScreen);
|
glamor_priv = glamor_get_screen_private(drawable->pScreen);
|
||||||
|
|
||||||
|
|
|
@ -648,8 +648,7 @@ glamor_upload_sub_pixmap_to_texture(PixmapPtr pixmap, int x, int y, int w, int h
|
||||||
PixmapPtr
|
PixmapPtr
|
||||||
glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y,
|
glamor_get_sub_pixmap(PixmapPtr pixmap, int x, int y,
|
||||||
int w, int h, glamor_access_t access);
|
int w, int h, glamor_access_t access);
|
||||||
|
void
|
||||||
PixmapPtr
|
|
||||||
glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y,
|
glamor_put_sub_pixmap(PixmapPtr sub_pixmap, PixmapPtr pixmap, int x, int y,
|
||||||
int w, int h, glamor_access_t access);
|
int w, int h, glamor_access_t access);
|
||||||
|
|
||||||
|
|
|
@ -255,7 +255,6 @@ _glamor_put_image(DrawablePtr drawable, GCPtr gc, int depth, int x, int y,
|
||||||
glamor_get_pixmap_private(pixmap);
|
glamor_get_pixmap_private(pixmap);
|
||||||
RegionPtr clip;
|
RegionPtr clip;
|
||||||
int x_off, y_off;
|
int x_off, y_off;
|
||||||
float vertices[8], texcoords[8];
|
|
||||||
Bool ret = FALSE;
|
Bool ret = FALSE;
|
||||||
PixmapPtr temp_pixmap, sub_pixmap;
|
PixmapPtr temp_pixmap, sub_pixmap;
|
||||||
glamor_pixmap_private *temp_pixmap_priv;
|
glamor_pixmap_private *temp_pixmap_priv;
|
||||||
|
|
|
@ -1018,8 +1018,6 @@ static inline void glamor_compare_pictures( ScreenPtr screen,
|
||||||
PixmapPtr fst_pixmap;
|
PixmapPtr fst_pixmap;
|
||||||
PixmapPtr snd_pixmap;
|
PixmapPtr snd_pixmap;
|
||||||
int fst_generated, snd_generated;
|
int fst_generated, snd_generated;
|
||||||
glamor_pixmap_private *fst_pixmap_priv;
|
|
||||||
glamor_pixmap_private *snd_pixmap_priv;
|
|
||||||
int error;
|
int error;
|
||||||
int fst_type = -1;
|
int fst_type = -1;
|
||||||
int snd_type = -1; // -1 represent has drawable.
|
int snd_type = -1; // -1 represent has drawable.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user