Skip to contentSkip to conversation

Graphics corruption issues

PATCH In review Peter Clifton 1 participant 3 messages Apr 22, 2010 – Apr 25, 2010 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Graphics corruption issues

Here is a patch for some graphics corruption issues I discovered since this commit:

commit 1cc2c2c44ac72460cf1c4e6bdc13c612235809c9

Author: Chris Wilson <[email protected]>
Date:   Wed Apr 14 11:18:25 2010 +0100

i830: Use pixman_blt directly for performing the in-memory copy

In order to avoid an infinite recursion after enabling CopyArea to use the put_image acceleration to either stream a blit or to copy in-place, we cannot call CopyArea from put_image for the fallback path. Instead, we can simply call pixman_blt directly, which coincidentally is a tiny bit faster.

I've also attached a cosmetic clean-up in the same area.

Signature · 11 lines
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
Quoted 1 line

From 1185713519550a73414058caddf6e5ec50774955 Mon Sep 17 00:00:00 2001

From: Peter Clifton <[email protected]>
Date: Thu, 22 Apr 2010 18:59:49 +0100
Subject: [PATCH 1/2] i830: pixman_blt may fail, ensure we pass this result down

Fixes visual corruption noticed in the background of OpenOffice Impress slides and slide preview seen since commit 1cc2c2c44ac72460cf1c4e6bdc13c612235809c9

---
 src/i830_uxa.c |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)
src/i830_uxa.c +8 -9
index 984069e..4f0c250 100644
@@ -832,17 +832,16 @@ static Bool i830_uxa_put_image(PixmapPtr pixmap,
 			return FALSE;
 		}
 
-		pixman_blt((uint32_t *)src, priv->bo->virtual,
-			   src_pitch / sizeof(uint32_t),
-			   pixmap->devKind / sizeof(uint32_t),
-			   pixmap->drawable.bitsPerPixel,
-			   pixmap->drawable.bitsPerPixel,
-			   0, 0,
-			   x, y,
-			   w, h);
+		ret = pixman_blt((uint32_t *)src, priv->bo->virtual,
+				 src_pitch / sizeof(uint32_t),
+				 pixmap->devKind / sizeof(uint32_t),
+				 pixmap->drawable.bitsPerPixel,
+				 pixmap->drawable.bitsPerPixel,
+				 0, 0,
+				 x, y,
+				 w, h);
 
 		drm_intel_gem_bo_unmap_gtt(priv->bo);
-		ret = TRUE;
 	}
 
 	return ret;
Signature · 1 line
1.7.0.4
Quoted 1 line

From aadc0723ac9d36317a3f62ec08ad2fce78970090 Mon Sep 17 00:00:00 2001

From: Peter Clifton <[email protected]>
Date: Thu, 22 Apr 2010 19:01:13 +0100
Subject: [PATCH 2/2] i830: Use the i830_pixmap_pitch() helper function for clarity

---
 src/i830_uxa.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
src/i830_uxa.c +4 -1
index 4f0c250..38c98fe 100644
@@ -774,6 +774,7 @@ static Bool i830_uxa_put_image(PixmapPtr pixmap,
 	struct intel_pixmap *priv;
 	GCPtr gc;
 	Bool ret;
+	int dst_pitch;
 
 	if (x == 0 && y == 0 &&
 	    w == pixmap->drawable.width &&
@@ -832,9 +833,11 @@ static Bool i830_uxa_put_image(PixmapPtr pixmap,
 			return FALSE;
 		}
 
+		dst_pitch = i830_pixmap_pitch(pixmap);
+
 		ret = pixman_blt((uint32_t *)src, priv->bo->virtual,
 				 src_pitch / sizeof(uint32_t),
-				 pixmap->devKind / sizeof(uint32_t),
+				 dst_pitch / sizeof(uint32_t),
 				 pixmap->drawable.bitsPerPixel,
 				 pixmap->drawable.bitsPerPixel,
 				 0, 0,
Signature · 1 line
1.7.0.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to a message not in the archive
Quoted 2 lines · Alexander Lam

Oh my bad. *facepalm*
I didn't see that you had already posted them inline.

They were attached, with a suggested viewing hint of inline - so I think your original comment was correct.

I'm not familiar with how to send mails straight from git, and I thought non-attached versions of the patch pasted into my mail client (evolution) would be more likely to produce a corrupt patch, munging tabs, spaces etc..

Thanks for your comments and testing though. I'm not entirely sure if returning FALSE when pixman can't do a blit is sufficient, but it "seems to help" here. Perhaps Chris can comment.

Signature · 11 lines
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
#4 lore raw
In reply to a message not in the archive
Quoted 2 lines · Alexander Lam

It is usually preferred to post patches inline or else nobody will look at them ;D.

FWIW, we're actually pretty awful at patch triage in gEDA (the project I work on).. there are patches languishing in the bug tracker, and in various people's INBOX, so I can easily relate to the issue.

Sadly, in our case.. the more complex the patch (perhaps the more effort the submitter has had to go to fix the bug / add a feature), the more likely it is to sit in limbo waiting for someone sufficiently familiar with the existing code to review the patch.

Signature · 11 lines
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)