Bug 55810 - [GM965 SNA] Corrupted glyphs in FontForge
Summary: [GM965 SNA] Corrupted glyphs in FontForge
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Chris Wilson
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-09 15:04 UTC by chr.ohm
Modified: 2012-10-09 16:28 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description chr.ohm 2012-10-09 15:04:58 UTC
Opening a TrueType font in FontForge, sometimes glyphs are corrupted, scrolling through a font it looks like the background doesn't always get cleared. It happened in 2.20.0, was fixed in 2.20.1, and happens again since commit e3f6c48d18c316899c71b6fc34971039c6f9e5f8. Reverting that on top of current master fixes it again.

Intel driver from git, rest is Ubuntu 12.04.
Comment 1 Chris Wilson 2012-10-09 15:16:14 UTC
I would say the implication is that drawable_gc_flags() is choosing the wrong hint then. Can you please try:

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 3d8392f..14817a5 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4097,9 +4097,7 @@ fallback:
 	if (!sna_gc_move_to_cpu(gc, drawable, &region))
 		goto out;
 	if (!sna_drawable_move_region_to_cpu(drawable, &region,
-					      format == XYPixmap ?
-					      MOVE_READ | MOVE_WRITE :
-					      drawable_gc_flags(drawable, gc, false)))
+					     MOVE_READ | MOVE_WRITE))
 		goto out_gc;
Comment 2 chr.ohm 2012-10-09 15:34:13 UTC
That patch helps, and unlike the revert, doesn't seem to add other problems so far. Thanks!
Comment 3 Chris Wilson 2012-10-09 15:43:09 UTC
Ok, let me just scratch my head a bit to find the mistake in calling drawable_gc_flags() here... Just in case the bug runs a bit deeper. Thanks
Comment 4 Chris Wilson 2012-10-09 15:58:18 UTC
Do you mind quickly testing:

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 3d8392f..3973c9d 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2338,7 +2338,7 @@ drawable_gc_flags(DrawablePtr draw, GCPtr gc, bool partial)
 		return MOVE_READ | MOVE_WRITE;
 	}
 
-	if (fb_gc(gc)->and) {
+	if (fb_gc(gc)->and | fb_gc(gc)->bgand) {
 		DBG(("%s: read due to rrop %d:%x\n",
 		     __FUNCTION__, gc->alu, (unsigned)fb_gc(gc)->and));
 		return MOVE_READ | MOVE_WRITE;
Comment 5 chr.ohm 2012-10-09 16:07:41 UTC
Works as well.
Comment 6 Chris Wilson 2012-10-09 16:28:53 UTC
Thanks a lot,

commit 8bbfa88a8691f6c1b2903090c3cd3159126ef563
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Oct 9 17:26:39 2012 +0100

    sna: Also check the bg rrop for reads when deciding upon fallback placement
    
    Reported-and-tested-by: chr.ohm@gmx.net
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55810
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Hopefully that will also fix a few other spurious errors.


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.