pending_op: Remove the pending operations handling.
We have disabled this feature for a long time, and previous testing shows that this(pending fill) will not bring observed performance gain. Now remove it. Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
		
							parent
							
								
									1761768f49
								
							
						
					
					
						commit
						9bcddff93b
					
				| 
						 | 
					@ -49,9 +49,6 @@ glamor_copy_n_to_n_fbo_blit(DrawablePtr src,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	src_pixmap_priv = glamor_get_pixmap_private(src_pixmap);
 | 
						src_pixmap_priv = glamor_get_pixmap_private(src_pixmap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (src_pixmap_priv->pending_op.type == GLAMOR_PENDING_FILL)
 | 
					 | 
				
			||||||
		return FALSE;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (gc) {
 | 
						if (gc) {
 | 
				
			||||||
		if (gc->alu != GXcopy) {
 | 
							if (gc->alu != GXcopy) {
 | 
				
			||||||
			glamor_delayed_fallback(screen, "non-copy ALU\n");
 | 
								glamor_delayed_fallback(screen, "non-copy ALU\n");
 | 
				
			||||||
| 
						 | 
					@ -69,10 +66,8 @@ glamor_copy_n_to_n_fbo_blit(DrawablePtr src,
 | 
				
			||||||
		return FALSE;
 | 
							return FALSE;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (glamor_set_destination_pixmap(dst_pixmap)) {
 | 
						if (glamor_set_destination_pixmap(dst_pixmap))
 | 
				
			||||||
		return FALSE;
 | 
							return FALSE;
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	glamor_validate_pixmap(dst_pixmap);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dispatch = glamor_get_dispatch(glamor_priv);
 | 
						dispatch = glamor_get_dispatch(glamor_priv);
 | 
				
			||||||
	dispatch->glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT,
 | 
						dispatch->glBindFramebuffer(GL_READ_FRAMEBUFFER_EXT,
 | 
				
			||||||
| 
						 | 
					@ -199,18 +194,12 @@ glamor_copy_n_to_n_textured(DrawablePtr src,
 | 
				
			||||||
		return FALSE;
 | 
							return FALSE;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (alu != GXcopy) {
 | 
					 | 
				
			||||||
		glamor_set_destination_pixmap_priv_nc (src_pixmap_priv);
 | 
					 | 
				
			||||||
		glamor_validate_pixmap(src_pixmap);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv);
 | 
						glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv);
 | 
				
			||||||
	glamor_validate_pixmap(dst_pixmap);
 | 
					 | 
				
			||||||
	dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
 | 
						dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
 | 
				
			||||||
					GL_FALSE, 2 * sizeof(float),
 | 
										GL_FALSE, 2 * sizeof(float),
 | 
				
			||||||
					vertices);
 | 
										vertices);
 | 
				
			||||||
	dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
						dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (GLAMOR_PIXMAP_PRIV_NO_PENDING(src_pixmap_priv)) {
 | 
					 | 
				
			||||||
	glamor_get_drawable_deltas(src, src_pixmap, &src_x_off,
 | 
						glamor_get_drawable_deltas(src, src_pixmap, &src_x_off,
 | 
				
			||||||
				   &src_y_off);
 | 
									   &src_y_off);
 | 
				
			||||||
	dx += src_x_off;
 | 
						dx += src_x_off;
 | 
				
			||||||
| 
						 | 
					@ -247,10 +236,6 @@ glamor_copy_n_to_n_textured(DrawablePtr src,
 | 
				
			||||||
			      REVERT_NONE);
 | 
								      REVERT_NONE);
 | 
				
			||||||
	dispatch->glUniform1i(glamor_priv->finish_access_swap_rb[0],
 | 
						dispatch->glUniform1i(glamor_priv->finish_access_swap_rb[0],
 | 
				
			||||||
			      SWAP_NONE_UPLOADING);
 | 
								      SWAP_NONE_UPLOADING);
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		GLAMOR_CHECK_PENDING_FILL(dispatch, glamor_priv,
 | 
					 | 
				
			||||||
					  src_pixmap_priv);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i = 0; i < nbox; i++) {
 | 
						for (i = 0; i < nbox; i++) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -262,7 +247,6 @@ glamor_copy_n_to_n_textured(DrawablePtr src,
 | 
				
			||||||
					     glamor_priv->yInverted,
 | 
										     glamor_priv->yInverted,
 | 
				
			||||||
					     vertices);
 | 
										     vertices);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (GLAMOR_PIXMAP_PRIV_NO_PENDING(src_pixmap_priv))
 | 
					 | 
				
			||||||
		glamor_set_normalize_tcoords(src_xscale,
 | 
							glamor_set_normalize_tcoords(src_xscale,
 | 
				
			||||||
					     src_yscale,
 | 
										     src_yscale,
 | 
				
			||||||
					     box[i].x1 + dx,
 | 
										     box[i].x1 + dx,
 | 
				
			||||||
| 
						 | 
					@ -271,17 +255,14 @@ glamor_copy_n_to_n_textured(DrawablePtr src,
 | 
				
			||||||
					     box[i].y2 + dy,
 | 
										     box[i].y2 + dy,
 | 
				
			||||||
					     glamor_priv->yInverted,
 | 
										     glamor_priv->yInverted,
 | 
				
			||||||
					     texcoords);
 | 
										     texcoords);
 | 
				
			||||||
 | 
					 | 
				
			||||||
		dispatch->glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 | 
							dispatch->glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
						dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
				
			||||||
	if (GLAMOR_PIXMAP_PRIV_NO_PENDING(src_pixmap_priv)) {
 | 
					 | 
				
			||||||
	dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
 | 
						dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
 | 
				
			||||||
#ifndef GLAMOR_GLES2
 | 
					#ifndef GLAMOR_GLES2
 | 
				
			||||||
	dispatch->glDisable(GL_TEXTURE_2D);
 | 
						dispatch->glDisable(GL_TEXTURE_2D);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	dispatch->glUseProgram(0);
 | 
						dispatch->glUseProgram(0);
 | 
				
			||||||
	/* The source texture is bound to a fbo, we have to flush it here. */
 | 
						/* The source texture is bound to a fbo, we have to flush it here. */
 | 
				
			||||||
	if (flush_needed)
 | 
						if (flush_needed)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -538,12 +538,6 @@ glamor_pixmap_ensure_fbo(PixmapPtr pixmap, GLenum format, int flag)
 | 
				
			||||||
	pixmap_priv = glamor_get_pixmap_private(pixmap);
 | 
						pixmap_priv = glamor_get_pixmap_private(pixmap);
 | 
				
			||||||
	return TRUE;
 | 
						return TRUE;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
 * XXX how to handle those pending OPs.
 | 
					 | 
				
			||||||
 * By default, pending OP is disabled. Maybe we will give up the pending
 | 
					 | 
				
			||||||
 * OP latter.
 | 
					 | 
				
			||||||
 *
 | 
					 | 
				
			||||||
 * */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
_X_EXPORT void
 | 
					_X_EXPORT void
 | 
				
			||||||
glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back)
 | 
					glamor_pixmap_exchange_fbos(PixmapPtr front, PixmapPtr back)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -213,20 +213,8 @@ glamor_solid(PixmapPtr pixmap, int x, int y, int width, int height,
 | 
				
			||||||
				   &color[1],
 | 
									   &color[1],
 | 
				
			||||||
				   &color[2],
 | 
									   &color[2],
 | 
				
			||||||
				   &color[3], format_for_pixmap(pixmap));
 | 
									   &color[3], format_for_pixmap(pixmap));
 | 
				
			||||||
#ifdef GLAMOR_DELAYED_FILLING
 | 
					
 | 
				
			||||||
	if (x == 0 && y == 0
 | 
					 | 
				
			||||||
	    && width == pixmap->drawable.width
 | 
					 | 
				
			||||||
	    && height == pixmap->drawable.height
 | 
					 | 
				
			||||||
	    && pixmap_priv->fb != glamor_priv->screen_fbo) {
 | 
					 | 
				
			||||||
		pixmap_priv->pending_op.type = GLAMOR_PENDING_FILL;
 | 
					 | 
				
			||||||
		memcpy(&pixmap_priv->pending_op.fill.color4fv,
 | 
					 | 
				
			||||||
		       color, 4 * sizeof(GLfloat));
 | 
					 | 
				
			||||||
		pixmap_priv->pending_op.fill.colori = fg_pixel;
 | 
					 | 
				
			||||||
		return TRUE;
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
	glamor_set_destination_pixmap_priv_nc(pixmap_priv);
 | 
						glamor_set_destination_pixmap_priv_nc(pixmap_priv);
 | 
				
			||||||
	glamor_validate_pixmap(pixmap);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dispatch = glamor_get_dispatch(glamor_priv);
 | 
						dispatch = glamor_get_dispatch(glamor_priv);
 | 
				
			||||||
	if (!glamor_set_alu(dispatch, alu)) {
 | 
						if (!glamor_set_alu(dispatch, alu)) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,47 +23,10 @@ glamor_get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					 | 
				
			||||||
_glamor_pixmap_validate_filling(glamor_screen_private * glamor_priv,
 | 
					 | 
				
			||||||
				glamor_pixmap_private * pixmap_priv)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	glamor_gl_dispatch *dispatch = glamor_get_dispatch(glamor_priv);
 | 
					 | 
				
			||||||
	GLfloat vertices[8];
 | 
					 | 
				
			||||||
	dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
 | 
					 | 
				
			||||||
					GL_FALSE, 2 * sizeof(float),
 | 
					 | 
				
			||||||
					vertices);
 | 
					 | 
				
			||||||
	dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
					 | 
				
			||||||
	dispatch->glUseProgram(glamor_priv->solid_prog);
 | 
					 | 
				
			||||||
	dispatch->glUniform4fv(glamor_priv->solid_color_uniform_location,
 | 
					 | 
				
			||||||
			       1, pixmap_priv->pending_op.fill.color4fv);
 | 
					 | 
				
			||||||
	vertices[0] = -1;
 | 
					 | 
				
			||||||
	vertices[1] = -1;
 | 
					 | 
				
			||||||
	vertices[2] = 1;
 | 
					 | 
				
			||||||
	vertices[3] = -1;
 | 
					 | 
				
			||||||
	vertices[4] = 1;
 | 
					 | 
				
			||||||
	vertices[5] = 1;
 | 
					 | 
				
			||||||
	vertices[6] = -1;
 | 
					 | 
				
			||||||
	vertices[7] = 1;
 | 
					 | 
				
			||||||
	dispatch->glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 | 
					 | 
				
			||||||
	dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
					 | 
				
			||||||
	dispatch->glUseProgram(0);
 | 
					 | 
				
			||||||
	pixmap_priv->pending_op.type = GLAMOR_PENDING_NONE;
 | 
					 | 
				
			||||||
	glamor_put_dispatch(glamor_priv);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
glamor_pixmap_validate_function_t pixmap_validate_funcs[] = {
 | 
					 | 
				
			||||||
	NULL,
 | 
					 | 
				
			||||||
	_glamor_pixmap_validate_filling
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
glamor_pixmap_init(ScreenPtr screen)
 | 
					glamor_pixmap_init(ScreenPtr screen)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	glamor_screen_private *glamor_priv;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	glamor_priv = glamor_get_screen_private(screen);
 | 
					 | 
				
			||||||
	glamor_priv->pixmap_validate_funcs = pixmap_validate_funcs;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
| 
						 | 
					@ -71,23 +34,6 @@ glamor_pixmap_fini(ScreenPtr screen)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					 | 
				
			||||||
glamor_validate_pixmap(PixmapPtr pixmap)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	glamor_pixmap_validate_function_t validate_op;
 | 
					 | 
				
			||||||
	glamor_screen_private *glamor_priv =
 | 
					 | 
				
			||||||
	    glamor_get_screen_private(pixmap->drawable.pScreen);
 | 
					 | 
				
			||||||
	glamor_pixmap_private *pixmap_priv =
 | 
					 | 
				
			||||||
	    glamor_get_pixmap_private(pixmap);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	validate_op =
 | 
					 | 
				
			||||||
	    glamor_priv->pixmap_validate_funcs[pixmap_priv->
 | 
					 | 
				
			||||||
					       pending_op.type];
 | 
					 | 
				
			||||||
	if (validate_op) {
 | 
					 | 
				
			||||||
		(*validate_op) (glamor_priv, pixmap_priv);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo * fbo)
 | 
					glamor_set_destination_pixmap_fbo(glamor_pixmap_fbo * fbo)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -865,9 +811,6 @@ glamor_download_sub_pixmap_to_cpu(PixmapPtr pixmap, int x, int y, int w, int h,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	glamor_set_destination_pixmap_priv_nc(pixmap_priv);
 | 
						glamor_set_destination_pixmap_priv_nc(pixmap_priv);
 | 
				
			||||||
	/* XXX we may don't need to validate it on GPU here,
 | 
					 | 
				
			||||||
	 * we can just validate it on CPU. */
 | 
					 | 
				
			||||||
	glamor_validate_pixmap(pixmap);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	need_post_conversion = (revert > REVERT_NORMAL);
 | 
						need_post_conversion = (revert > REVERT_NORMAL);
 | 
				
			||||||
	if (need_post_conversion) {
 | 
						if (need_post_conversion) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -132,11 +132,6 @@ enum gradient_shader_type {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct glamor_screen_private;
 | 
					struct glamor_screen_private;
 | 
				
			||||||
struct glamor_pixmap_private;
 | 
					struct glamor_pixmap_private;
 | 
				
			||||||
typedef void (*glamor_pixmap_validate_function_t) (struct
 | 
					 | 
				
			||||||
						   glamor_screen_private *,
 | 
					 | 
				
			||||||
						   struct
 | 
					 | 
				
			||||||
						   glamor_pixmap_private
 | 
					 | 
				
			||||||
						   *);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum glamor_gl_flavor {
 | 
					enum glamor_gl_flavor {
 | 
				
			||||||
	GLAMOR_GL_DESKTOP,	// OPENGL API
 | 
						GLAMOR_GL_DESKTOP,	// OPENGL API
 | 
				
			||||||
| 
						 | 
					@ -246,7 +241,6 @@ typedef struct glamor_screen_private {
 | 
				
			||||||
	struct glamor_saved_procs saved_procs;
 | 
						struct glamor_saved_procs saved_procs;
 | 
				
			||||||
	char delayed_fallback_string[GLAMOR_DELAYED_STRING_MAX + 1];
 | 
						char delayed_fallback_string[GLAMOR_DELAYED_STRING_MAX + 1];
 | 
				
			||||||
	int delayed_fallback_pending;
 | 
						int delayed_fallback_pending;
 | 
				
			||||||
	glamor_pixmap_validate_function_t *pixmap_validate_funcs;
 | 
					 | 
				
			||||||
	int flags;
 | 
						int flags;
 | 
				
			||||||
	ScreenPtr screen;
 | 
						ScreenPtr screen;
 | 
				
			||||||
} glamor_screen_private;
 | 
					} glamor_screen_private;
 | 
				
			||||||
| 
						 | 
					@ -257,22 +251,6 @@ typedef enum glamor_access {
 | 
				
			||||||
	GLAMOR_ACCESS_WO,
 | 
						GLAMOR_ACCESS_WO,
 | 
				
			||||||
} glamor_access_t;
 | 
					} glamor_access_t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
enum _glamor_pending_op_type {
 | 
					 | 
				
			||||||
	GLAMOR_PENDING_NONE,
 | 
					 | 
				
			||||||
	GLAMOR_PENDING_FILL
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef struct _glamor_pending_fill {
 | 
					 | 
				
			||||||
	unsigned int type;
 | 
					 | 
				
			||||||
	GLfloat color4fv[4];
 | 
					 | 
				
			||||||
	CARD32 colori;
 | 
					 | 
				
			||||||
} glamor_pending_fill;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
typedef union _glamor_pending_op {
 | 
					 | 
				
			||||||
	unsigned int type;
 | 
					 | 
				
			||||||
	glamor_pending_fill fill;
 | 
					 | 
				
			||||||
} glamor_pending_op;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define GLAMOR_FBO_NORMAL     1
 | 
					#define GLAMOR_FBO_NORMAL     1
 | 
				
			||||||
#define GLAMOR_FBO_DOWNLOADED 2
 | 
					#define GLAMOR_FBO_DOWNLOADED 2
 | 
				
			||||||
/* glamor_pixmap_fbo:
 | 
					/* glamor_pixmap_fbo:
 | 
				
			||||||
| 
						 | 
					@ -315,7 +293,6 @@ typedef struct glamor_pixmap_fbo {
 | 
				
			||||||
 * @gl_tex:  The pixmap is in a gl texture originally.
 | 
					 * @gl_tex:  The pixmap is in a gl texture originally.
 | 
				
			||||||
 * @is_picture: The drawable is attached to a picture.
 | 
					 * @is_picture: The drawable is attached to a picture.
 | 
				
			||||||
 * @pict_format: the corresponding picture's format.
 | 
					 * @pict_format: the corresponding picture's format.
 | 
				
			||||||
 * #pending_op: currently only support pending filling.
 | 
					 | 
				
			||||||
 * @container: The corresponding pixmap's pointer.
 | 
					 * @container: The corresponding pixmap's pointer.
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
typedef struct glamor_pixmap_private {
 | 
					typedef struct glamor_pixmap_private {
 | 
				
			||||||
| 
						 | 
					@ -325,7 +302,6 @@ typedef struct glamor_pixmap_private {
 | 
				
			||||||
	glamor_pixmap_type_t type;
 | 
						glamor_pixmap_type_t type;
 | 
				
			||||||
	glamor_pixmap_fbo *fbo;
 | 
						glamor_pixmap_fbo *fbo;
 | 
				
			||||||
	PictFormatShort pict_format;
 | 
						PictFormatShort pict_format;
 | 
				
			||||||
	glamor_pending_op pending_op;
 | 
					 | 
				
			||||||
	PixmapPtr container;
 | 
						PixmapPtr container;
 | 
				
			||||||
	int drm_stride;
 | 
						int drm_stride;
 | 
				
			||||||
	glamor_screen_private *glamor_priv;
 | 
						glamor_screen_private *glamor_priv;
 | 
				
			||||||
| 
						 | 
					@ -682,8 +658,6 @@ Bool glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format, GLenu
 | 
				
			||||||
 **/
 | 
					 **/
 | 
				
			||||||
void glamor_destroy_upload_pixmap(PixmapPtr pixmap);
 | 
					void glamor_destroy_upload_pixmap(PixmapPtr pixmap);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void glamor_validate_pixmap(PixmapPtr pixmap);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int glamor_create_picture(PicturePtr picture);
 | 
					int glamor_create_picture(PicturePtr picture);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bool
 | 
					Bool
 | 
				
			||||||
| 
						 | 
					@ -754,7 +728,7 @@ glamor_poly_line(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
 | 
				
			||||||
 * this will increase performance obviously. */
 | 
					 * this will increase performance obviously. */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 | 
					#define GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 | 
				
			||||||
//#define GLAMOR_DELAYED_FILLING
 | 
					#define GLAMOR_DELAYED_FILLING
 | 
				
			||||||
//#define GLAMOR_GRADIENT_SHADER
 | 
					//#define GLAMOR_GRADIENT_SHADER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -997,12 +997,6 @@ glamor_composite_with_shader(CARD8 op,
 | 
				
			||||||
			glamor_fallback("no texture in source\n");
 | 
								glamor_fallback("no texture in source\n");
 | 
				
			||||||
			goto fail;
 | 
								goto fail;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
		} else if (source_pixmap_priv->pending_op.type ==
 | 
					 | 
				
			||||||
			   GLAMOR_PENDING_FILL) {
 | 
					 | 
				
			||||||
			key.source = SHADER_SOURCE_SOLID;
 | 
					 | 
				
			||||||
			memcpy(source_solid_color,
 | 
					 | 
				
			||||||
			       source_pixmap_priv->pending_op.
 | 
					 | 
				
			||||||
			       fill.color4fv, 4 * sizeof(float));
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if (key.mask == SHADER_MASK_TEXTURE ||
 | 
						if (key.mask == SHADER_MASK_TEXTURE ||
 | 
				
			||||||
| 
						 | 
					@ -1020,12 +1014,6 @@ glamor_composite_with_shader(CARD8 op,
 | 
				
			||||||
			glamor_fallback("no texture in mask\n");
 | 
								glamor_fallback("no texture in mask\n");
 | 
				
			||||||
			goto fail;
 | 
								goto fail;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
		} else if (mask_pixmap_priv->pending_op.type ==
 | 
					 | 
				
			||||||
			   GLAMOR_PENDING_FILL) {
 | 
					 | 
				
			||||||
			key.mask = SHADER_MASK_SOLID;
 | 
					 | 
				
			||||||
			memcpy(mask_solid_color,
 | 
					 | 
				
			||||||
			       mask_pixmap_priv->pending_op.fill.color4fv,
 | 
					 | 
				
			||||||
			       4 * sizeof(float));
 | 
					 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 | 
					#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
 | 
				
			||||||
| 
						 | 
					@ -1103,7 +1091,6 @@ glamor_composite_with_shader(CARD8 op,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv);
 | 
						glamor_set_destination_pixmap_priv_nc(dest_pixmap_priv);
 | 
				
			||||||
	glamor_validate_pixmap(dest_pixmap);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!glamor_set_composite_op(screen, op, dest, mask)) {
 | 
						if (!glamor_set_composite_op(screen, op, dest, mask)) {
 | 
				
			||||||
		goto fail;
 | 
							goto fail;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,13 +152,7 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
 | 
				
			||||||
		goto fail;
 | 
							goto fail;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (alu != GXcopy) {
 | 
					 | 
				
			||||||
		glamor_set_destination_pixmap_priv_nc(src_pixmap_priv);
 | 
					 | 
				
			||||||
		glamor_validate_pixmap(tile);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv);
 | 
						glamor_set_destination_pixmap_priv_nc(dst_pixmap_priv);
 | 
				
			||||||
	glamor_validate_pixmap(pixmap);
 | 
					 | 
				
			||||||
	pixmap_priv_get_scale(dst_pixmap_priv, &dst_xscale, &dst_yscale);
 | 
						pixmap_priv_get_scale(dst_pixmap_priv, &dst_xscale, &dst_yscale);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dispatch = glamor_get_dispatch(glamor_priv);
 | 
						dispatch = glamor_get_dispatch(glamor_priv);
 | 
				
			||||||
| 
						 | 
					@ -167,7 +161,6 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
 | 
				
			||||||
		goto fail;
 | 
							goto fail;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (GLAMOR_PIXMAP_PRIV_NO_PENDING(src_pixmap_priv)) {
 | 
					 | 
				
			||||||
	pixmap_priv_get_scale(src_pixmap_priv, &src_xscale,
 | 
						pixmap_priv_get_scale(src_pixmap_priv, &src_xscale,
 | 
				
			||||||
			      &src_yscale);
 | 
								      &src_yscale);
 | 
				
			||||||
	dispatch->glUseProgram(glamor_priv->tile_prog);
 | 
						dispatch->glUseProgram(glamor_priv->tile_prog);
 | 
				
			||||||
| 
						 | 
					@ -202,10 +195,6 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
 | 
				
			||||||
					2 * sizeof(float),
 | 
										2 * sizeof(float),
 | 
				
			||||||
					source_texcoords);
 | 
										source_texcoords);
 | 
				
			||||||
	dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
 | 
						dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
 | 
				
			||||||
	} else {
 | 
					 | 
				
			||||||
		GLAMOR_CHECK_PENDING_FILL(dispatch, glamor_priv,
 | 
					 | 
				
			||||||
					  src_pixmap_priv);
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	glamor_set_normalize_vcoords(dst_xscale, dst_yscale,
 | 
						glamor_set_normalize_vcoords(dst_xscale, dst_yscale,
 | 
				
			||||||
				     x1, y1, x2, y2,
 | 
									     x1, y1, x2, y2,
 | 
				
			||||||
| 
						 | 
					@ -217,12 +206,10 @@ glamor_tile(PixmapPtr pixmap, PixmapPtr tile,
 | 
				
			||||||
	dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
						dispatch->glEnableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
				
			||||||
	dispatch->glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 | 
						dispatch->glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (GLAMOR_PIXMAP_PRIV_NO_PENDING(src_pixmap_priv)) {
 | 
					 | 
				
			||||||
	dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
 | 
						dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_SOURCE);
 | 
				
			||||||
#ifndef GLAMOR_GLES2
 | 
					#ifndef GLAMOR_GLES2
 | 
				
			||||||
		dispatch->glDisable(GL_TEXTURE_2D);
 | 
							dispatch->glDisable(GL_TEXTURE_2D);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
						dispatch->glDisableVertexAttribArray(GLAMOR_VERTEX_POS);
 | 
				
			||||||
	dispatch->glUseProgram(0);
 | 
						dispatch->glUseProgram(0);
 | 
				
			||||||
	glamor_set_alu(dispatch, GXcopy);
 | 
						glamor_set_alu(dispatch, GXcopy);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -207,23 +207,6 @@ glamor_transform_boxes(BoxPtr boxes, int nbox, int dx, int dy)
 | 
				
			||||||
#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)    (pixmap_priv && pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL)
 | 
					#define GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv)    (pixmap_priv && pixmap_priv->gl_fbo == GLAMOR_FBO_NORMAL)
 | 
				
			||||||
#define GLAMOR_PIXMAP_PRIV_HAS_FBO_DOWNLOADED(pixmap_priv)    (pixmap_priv && (pixmap_priv->gl_fbo == GLAMOR_FBO_DOWNLOADED))
 | 
					#define GLAMOR_PIXMAP_PRIV_HAS_FBO_DOWNLOADED(pixmap_priv)    (pixmap_priv && (pixmap_priv->gl_fbo == GLAMOR_FBO_DOWNLOADED))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define GLAMOR_PIXMAP_PRIV_NEED_VALIDATE(pixmap_priv)  \
 | 
					 | 
				
			||||||
	(GLAMOR_PIXMAP_PRIV_HAS_FBO(pixmap_priv) \
 | 
					 | 
				
			||||||
	&& (pixmap_priv->pending_op.type != GLAMOR_PENDING_NONE))
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define GLAMOR_PIXMAP_PRIV_NO_PENDING(pixmap_priv)   \
 | 
					 | 
				
			||||||
	(pixmap_priv->pending_op.type == GLAMOR_PENDING_NONE)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#define GLAMOR_CHECK_PENDING_FILL(_dispatch_, _glamor_priv_, _pixmap_priv_) do \
 | 
					 | 
				
			||||||
  { \
 | 
					 | 
				
			||||||
      if (_pixmap_priv_->pending_op.type == GLAMOR_PENDING_FILL) { \
 | 
					 | 
				
			||||||
        _dispatch_->glUseProgram(_glamor_priv_->solid_prog); \
 | 
					 | 
				
			||||||
        _dispatch_->glUniform4fv(_glamor_priv_->solid_color_uniform_location, 1,  \
 | 
					 | 
				
			||||||
                        _pixmap_priv_->pending_op.fill.color4fv); \
 | 
					 | 
				
			||||||
      } \
 | 
					 | 
				
			||||||
  } while(0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Borrow from uxa.
 | 
					 * Borrow from uxa.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue