[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#615197: xserver-xorg-video-intel: Screen corruptions to due insufficient clipping



On Sun, 15 May 2011 21:51:59 +0200, Julien Cristau <jcristau@debian.org> wrote:
> On Sun, May 15, 2011 at 21:34:26 +0200, Thomas Richter wrote:
> > Sorry, I don't quite get the question. All what the code does is
> > that it checks whether the current line (fullY1) is between the top
> > edge of the current rectangle in the damage region (pbox->y1<=
> > fullY1) and above
> > the bottom edge of the damage region (pbox->y2>  fullY1). It is
> > probably written in a somewhat unconventional way. A nicer way to
> > put it is:
> > 
> > fullY1 >= pbox->y1 && fullY1 < pbox->y2
> > 
> > Thus, line at or below the top edge, and above the bottom edge. A
> > rectangle doesn't have to be invalid to have fullY1 >= pbox->y1 and
> > fullY1 < pbox->y2. I'm not quite clear what the break is used for,
> > but
> > I assume that the rectangles are ordered by increasing Y coordinate, and
> > that the code can terminate early if it detects a rectangle in the
> > damage region that has a top edge below the line.
> > 

The clip rectangles are YX banded, so that if we see a rectangle which
starts below the point of interest, we know all further rectangles are
below the point.

The question that remains is then does this rectangle, which we know has
to start above (or equal to) the point extend beyond the point. So we need
to test:

diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index 0650ac2..56f219c 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -178,7 +178,7 @@ uxa_fill_spans(DrawablePtr pDrawable, GCPtr pGC, int
n,
                                if (pbox->y1 > fullY1)
                                        break;
 
-                               if (pbox->y1 <= fullY1) {
+                               if (pbox->y2 > fullY1) {
                                        partX1 = pbox->x1;
                                        if (partX1 < fullX1)
                                                partX1 = fullX1;

which is probably what you said originally. If you send a patch along
these lines, I will gladly apply it. And if you have a test case to hand,
better yet -- collecting examples of where I goofed to prevent repeating
my mistakes...

Thanks,
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



Reply to: