glamor: Fix one bug for Xephyr.

Xephyr doesn't has a bounded valid texture. It seems that we can't
load texture 0 directly sometimes. Especially in the copyarea, function
if that is the case, we prefer to use fbo blit to read the screen pixmap
rather than load the bound texture.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
This commit is contained in:
Zhigang Gong 2011-07-21 16:18:48 +08:00
parent 9b667ffd56
commit 0ef1698be2
3 changed files with 9 additions and 4 deletions

View File

@ -200,7 +200,7 @@ glamor_create_screen_pixmap(ScreenPtr screen, int w, int h, int depth,
pixmap_priv = glamor_get_pixmap_private(pixmap);
pixmap_priv->tex = 0;
pixmap_priv->gl_fbo = 1;
pixmap_priv->gl_tex = 1;
pixmap_priv->gl_tex = 0;
pixmap_priv->container = pixmap;
pixmap_priv->pending_op.type = GLAMOR_PENDING_NONE;

View File

@ -293,7 +293,8 @@ glamor_copy_n_to_n(DrawablePtr src,
}
/* XXX need revisit to handle overlapped area copying. */
if ( overlaped
if ((overlaped
|| !src_pixmap_priv->gl_tex || !dst_pixmap_priv->gl_tex )
&& glamor_copy_n_to_n_fbo_blit(src, dst, gc, box, nbox, dx, dy)) {
goto done;
return;

View File

@ -765,7 +765,11 @@ glamor_composite_with_shader(CARD8 op,
glamor_fallback("source == dest\n");
goto fail;
}
if (!source_pixmap_priv || source_pixmap_priv->gl_tex == 0) {
if (!source_pixmap_priv || source_pixmap_priv->gl_fbo == 0) {
/* XXX in Xephyr, we may have gl_fbo equal to 1 but gl_tex
* equal to zero when the pixmap is screen pixmap. Then we may
* refer the tex zero directly latter in the composition.
* It seems that it works fine, but it may have potential problem*/
#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
source_status = GLAMOR_UPLOAD_PENDING;
#else
@ -786,7 +790,7 @@ glamor_composite_with_shader(CARD8 op,
glamor_fallback("mask == dest\n");
goto fail;
}
if (!mask_pixmap_priv || mask_pixmap_priv->gl_tex == 0) {
if (!mask_pixmap_priv || mask_pixmap_priv->gl_fbo == 0) {
#ifdef GLAMOR_PIXMAP_DYNAMIC_UPLOAD
mask_status = GLAMOR_UPLOAD_PENDING;
#else