summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-10 12:10:09 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-10 12:29:26 +0100
commit0d4dd00aeafdd625ffe902e26e666b63a0842adc (patch)
tree8a59686c5484c9ba05899827070b77e58e16b491
parent21c1c3c7f6eb2b5070d2153b15a8fb1afe938bbb (diff)
uxa,i915: Handle SourcePict through uxa_composite()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/i915_render.c8
-rw-r--r--uxa/uxa-render.c51
2 files changed, 41 insertions, 18 deletions
diff --git a/src/i915_render.c b/src/i915_render.c
index 25ad51ce..98f8f4a8 100644
--- a/src/i915_render.c
+++ b/src/i915_render.c
@@ -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);
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index ddee1725..849a6463 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -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);