xf86-video-intel: src/i830_render.c src/i965_render.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 14 04:16:23 PDT 2010


 src/i830_render.c |   14 ++++++++++++++
 src/i965_render.c |   16 ++++++++++++++++
 2 files changed, 30 insertions(+)

New commits:
commit 995a4b2b1d09c31672d9258a8ac732dcf9a8fe9f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 14 12:15:34 2010 +0100

    i965: Sanity check ComponentAlpha status in prepare_composite
    
    Fixes:
    
      Bug 28446 - Garbled Font with Mathematica 7
      https://bugs.freedesktop.org/show_bug.cgi?id=28446
    
    Rewriting the glyphs to render to the destination directly and removing
    the more expensive multiple invocations of CompositePicture per picture
    was a great performance boost -- except that it needs special handling
    in the backend in order to not fallback. Having done so for i915, I
    neglected to ensure the sanity checking in i965_prepare_composite() was
    sufficient. As it turns out, it was not and so we misrendered CA-glyphs
    when rendering directly to the destination. This causes us to fallback
    properly, but is a performance regression as we no longer try the 2-pass
    magic helper before resorting to s/w. At the moment, I'd rather live
    with the temporary regression and fix i965 to do the same magic as i915,
    as it critical to fixing the severe performance issues currently
    crippling i965, as I believe that this regression only affects the
    minority of applications (incorrect, as it turns out, as the glyphs are
    overlapping) rendering directly to the destination.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/i830_render.c b/src/i830_render.c
index cba65eb..622fe65 100644
--- a/src/i830_render.c
+++ b/src/i830_render.c
@@ -465,6 +465,20 @@ i830_prepare_composite(int op, PicturePtr source_picture,
 	if (!intel_check_pitch_3d(source))
 		return FALSE;
 	if (mask) {
+		if (mask_picture->componentAlpha &&
+		    PICT_FORMAT_RGB(mask_picture->format)) {
+			/* Check if it's component alpha that relies on a source alpha and on
+			 * the source value.  We can only get one of those into the single
+			 * source value that we get to blend with.
+			 */
+			if (i830_blend_op[op].src_alpha &&
+			    (i830_blend_op[op].src_blend != BLENDFACTOR_ZERO)) {
+				intel_debug_fallback(scrn, "Component alpha not "
+						     "supported with source alpha and "
+						     "source value blending.\n");
+				return FALSE;
+			}
+		}
 		if (!intel_check_pitch_3d(mask))
 			return FALSE;
 	}
diff --git a/src/i965_render.c b/src/i965_render.c
index 4f68b04..f5904cc 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -1509,6 +1509,22 @@ i965_prepare_composite(int op, PicturePtr source_picture,
 	}
 
 	if (mask_picture) {
+		if (mask_picture->componentAlpha &&
+		    PICT_FORMAT_RGB(mask_picture->format)) {
+			/* Check if it's component alpha that relies on a source alpha and on
+			 * the source value.  We can only get one of those into the single
+			 * source value that we get to blend with.
+			 */
+			if (i965_blend_op[op].src_alpha &&
+			    (i965_blend_op[op].src_blend != BRW_BLENDFACTOR_ZERO)) {
+				intel_debug_fallback(scrn,
+						     "Component alpha not supported "
+						     "with source alpha and source "
+						     "value blending.\n");
+				return FALSE;
+			}
+		}
+
 		composite_op->mask_filter =
 		    sampler_state_filter_from_picture(mask_picture->filter);
 		if (composite_op->mask_filter < 0) {


More information about the xorg-commit mailing list