Bug 47444 - [sna] Text input fields in firefox appear corrupted (bisected)
Summary: [sna] Text input fields in firefox appear corrupted (bisected)
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-17 09:35 UTC by Da Fox
Modified: 2012-03-18 09:59 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Clear outside the ADD for the pending clear (1.60 KB, patch)
2012-03-17 16:59 UTC, Chris Wilson
no flags Details | Splinter Review

Description Da Fox 2012-03-17 09:35:05 UTC
Starting with xf86-video-intel commit bd62dc73dcdbab34aa5c83382e46c7315d554a1a (sna/traps: Apply somes simple but common operator reduction for clipmasks) text areas in firefox appear corrupt: 
http://www.zimagez.com/zimage/screenshot-03152012-120418pm.php ('aurora-looks' theme)
http://www.zimagez.com/zimage/screenshot-03152012-113637am.php ('dark glow lava' theme)

The text area should appear a single, solid color. Instead there are lines and speckles which change as you type or mouse-over other areas.

The issue is still present as of xf86-video-intel e31d9dacafe060dc86de801114b475fdd0142eb6 (sna/traps: Align indices for unrolled memset in row_inplace()).

My hardware is a Dell XPS 15 (L502x) laptop with:
00:02.0 VGA compatible controller: Intel Corporation Device 0116 (rev 09)
[    13.803] (II) intel(0): Integrated Graphics Chipset: Intel(R) Sandybridge
Mobile (GT2)
Comment 1 Chris Wilson 2012-03-17 12:01:51 UTC
There's only one condition left from that original patch, so can you confirm if

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 3a93450..e22eb37 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -4127,7 +4127,7 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePt
 
        switch (op) {
        case PictOpAdd:
-               if (priv->clear && priv->clear_color == 0)
+               if (priv->clear && priv->clear_color == 0 && 0)
                        op = PictOpSrc;
                if ((color >> 24) == 0)
                        return true;

restores normal behaviour? I'll be the one in the corner weeping.
Comment 2 Da Fox 2012-03-17 16:07:49 UTC
(In reply to comment #1)
> There's only one condition left from that original patch, so can you confirm if
> 
> diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
> index 3a93450..e22eb37 100644
> --- a/src/sna/sna_trapezoids.c
> +++ b/src/sna/sna_trapezoids.c
> @@ -4127,7 +4127,7 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src,
> PicturePt
> 
>         switch (op) {
>         case PictOpAdd:
> -               if (priv->clear && priv->clear_color == 0)
> +               if (priv->clear && priv->clear_color == 0 && 0)
>                         op = PictOpSrc;
>                 if ((color >> 24) == 0)
>                         return true;
> 
> restores normal behaviour? I'll be the one in the corner weeping.

With this patch textfields appear normal again.
Comment 3 Chris Wilson 2012-03-17 16:13:59 UTC
Thanks, know why? Sob.
Comment 4 Chris Wilson 2012-03-17 16:49:44 UTC
I think this is the right explanation:

diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index 3a93450..eb9ec2d 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -4226,7 +4226,7 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePt
        DBG(("%s: move-to-cpu\n", __FUNCTION__));
        region.data = NULL;
        if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
-                                            op == PictOpSrc ? MOVE_WRITE : MOVE
+                                            MOVE_WRITE | MOVE_READ))
                return true;
 
        get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y);
Comment 5 Chris Wilson 2012-03-17 16:59:01 UTC
Created attachment 58625 [details] [review]
Clear outside the ADD for the pending clear

Better still.
Comment 6 Chris Wilson 2012-03-18 09:59:26 UTC
commit 97cd0c7da51024400e8900e46f51620a5f7ad402
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Sat Mar 17 23:57:46 2012 +0000

    sna/traps: Upon reducing an ADD to a SRC, we need to apply the pending clear
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47444
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.