sna/gen3: Improve reduction of render operator to blt

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-10-17 11:57:07 +01:00
parent 606e18bd36
commit 2cbe79b85b
1 changed files with 13 additions and 5 deletions

View File

@ -3541,6 +3541,9 @@ gen3_render_fill_boxes_try_blt(struct sna *sna,
uint8_t alu = GXcopy;
uint32_t pixel;
if (dst_bo->tiling == I915_TILING_Y)
return FALSE;
if (!sna_get_pixel_from_rgba(&pixel,
color->red,
color->green,
@ -3549,17 +3552,22 @@ gen3_render_fill_boxes_try_blt(struct sna *sna,
format))
return FALSE;
if (color->alpha >= 0xff00) {
if (op == PictOpOver)
op = PictOpSrc;
else if (op == PictOpOutReverse)
op = PictOpClear;
else if (op == PictOpAdd &&
(color->red & color->green & color->blue) >= 0xff00)
op = PictOpSrc;
}
if (op == PictOpClear) {
alu = GXclear;
pixel = 0;
op = PictOpSrc;
}
if (op == PictOpOver) {
if ((pixel & 0xff000000) == 0xff000000)
op = PictOpSrc;
}
if (op != PictOpSrc)
return FALSE;