uxa,i915: Handle SourcePict through uxa_composite()

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2010-05-10 12:10:09 +01:00
parent 21c1c3c7f6
commit 0d4dd00aea
2 changed files with 41 additions and 18 deletions

View File

@ -369,13 +369,13 @@ i915_prepare_composite(int op, PicturePtr source_picture,
PicturePtr mask_picture, PicturePtr dest_picture,
PixmapPtr source, PixmapPtr mask, PixmapPtr dest)
{
ScrnInfoPtr scrn = xf86Screens[source_picture->pDrawable->pScreen->myNum];
ScrnInfoPtr scrn = xf86Screens[dest_picture->pDrawable->pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
drm_intel_bo *bo_table[] = {
NULL, /* batch_bo */
i830_get_pixmap_bo(source),
mask ? i830_get_pixmap_bo(mask) : NULL,
i830_get_pixmap_bo(dest),
source ? i830_get_pixmap_bo(source) : NULL,
mask ? i830_get_pixmap_bo(mask) : NULL,
};
int tex_unit = 0;
@ -465,7 +465,7 @@ i915_prepare_composite(int op, PicturePtr source_picture,
intel->i915_render_state.op = op;
if(i830_uxa_pixmap_is_dirty(source) ||
if((source && i830_uxa_pixmap_is_dirty(source)) ||
(mask && i830_uxa_pixmap_is_dirty(mask)))
intel_batch_emit_flush(scrn);

View File

@ -708,8 +708,13 @@ uxa_acquire_source(ScreenPtr pScreen,
if (uxa_screen->info->check_composite_texture &&
uxa_screen->info->check_composite_texture(pScreen, pPict)) {
*out_x = x + pPict->pDrawable->x;
*out_y = y + pPict->pDrawable->y;
if (pPict->pDrawable) {
*out_x = x + pPict->pDrawable->x;
*out_y = y + pPict->pDrawable->y;
} else {
*out_x = x;
*out_y = y;
}
return pPict;
}
@ -930,22 +935,40 @@ uxa_try_driver_composite(CARD8 op,
return 1;
}
pSrcPix = uxa_get_offscreen_pixmap(localSrc->pDrawable,
&src_off_x, &src_off_y);
if (localSrc->pDrawable) {
pSrcPix = uxa_get_offscreen_pixmap(localSrc->pDrawable,
&src_off_x, &src_off_y);
if (!pSrcPix) {
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
if (localMask)
pMaskPix = uxa_get_offscreen_pixmap(localMask->pDrawable,
&mask_off_x, &mask_off_y);
if (localSrc != pSrc)
FreePicture(localSrc, 0);
if (localMask && localMask != pMask)
FreePicture(localMask, 0);
if (!pSrcPix || (localMask && !pMaskPix)) {
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
return 0;
}
} else {
pSrcPix = NULL;
}
if (localSrc != pSrc)
FreePicture(localSrc, 0);
if (localMask && localMask != pMask)
FreePicture(localMask, 0);
if (localMask) {
if (localMask->pDrawable) {
pMaskPix = uxa_get_offscreen_pixmap(localMask->pDrawable,
&mask_off_x, &mask_off_y);
if (!pMaskPix) {
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
return 0;
if (localSrc != pSrc)
FreePicture(localSrc, 0);
if (localMask && localMask != pMask)
FreePicture(localMask, 0);
return 0;
}
} else {
pMaskPix = NULL;
}
}
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);