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

2011-05-16 Thread Chris Wilson
On Sun, 15 May 2011 21:51:59 +0200, Julien Cristau jcris...@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



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2011-05-15 Thread Thomas Richter

Hi Cyril,


Thomas Richtert...@math.tu-berlin.de  (26/02/2011):

Apparently, clipping the line drawing or rectangle drawing operation
to the visible part of the xpdf main window does not work correctly
and renders also into the requester window on top of it instead of
clipping to the visible part only.

This bug does not go away by disabling the Tiling option, or the
Dri2 extension, or the AIGLX option of the X server. The old
i810 intel driver, however, handled this correctly in the lenny
distribution.

This bug may be a duplicate of 592855,596085,614296,554427,558396.

Note that the kernel is already a 2.6.35.11, not the native Debian
kernel. However, the bug also appears on with native Debian kernel as
well.


(FWIW, since you're talking about the kernel, there's 2.6.37 in sid
and 2.6.38rc* in experimental)

If that's only an issue on the X intel driver side, you may want to
check what happens with src:libdrm and src:xserver-xorg-video-intel
rebuilt on squeeze. We plan to provide with backports, as described
here:
   http://pkg-xorg.alioth.debian.org/reference/squeeze-backports.html


I finally found the bug. It persists in 2.15.0. A patch for the bug is 
included.


The bug is in uxa/uxa-accel.c, in the function uxa_fill_spans(). The 
problem is that the clipping performed in lines 180ff does not include a 
check for y2 of the clipped region. The fixed code reads as follows:


pbox = REGION_RECTS(pClip);
while (nbox--) {
if (pbox-y1  fullY1)
break;
if (pbox-y1 = fullY1  pbox-y2  fullY1 /*--bug here */ ) {
partX1 = pbox-x1;
if (partX1  fullX1)
partX1 = fullX1;

partX2 = pbox-x2;
if (partX2  fullX2)
partX2 = fullX2;

if (partX2  partX1) {
uxa_screen-info-composite(dst_pixmap,
0, 0, 0, 0,
partX1 + off_x,
fullY1 + off_y,
partX2 - partX1, 1);
}
}
pbox++;
}

The bug is the missing check of fullY1 against the lower bottom of the 
clipping rectangle, pbox-y2.


Greetings,
Thomas



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2011-05-15 Thread Julien Cristau
On Sun, May 15, 2011 at 20:11:04 +0200, Thomas Richter wrote:

 I finally found the bug. It persists in 2.15.0. A patch for the bug
 is included.
 
Thanks for your investigation.

 The bug is in uxa/uxa-accel.c, in the function uxa_fill_spans(). The
 problem is that the clipping performed in lines 180ff does not
 include a check for y2 of the clipped region. The fixed code reads
 as follows:
 
 pbox = REGION_RECTS(pClip);
 while (nbox--) {
   if (pbox-y1  fullY1)
   break;
   if (pbox-y1 = fullY1  pbox-y2  fullY1 /*--bug here */ ) {
   partX1 = pbox-x1;
   if (partX1  fullX1)
   partX1 = fullX1;
 
   partX2 = pbox-x2;
   if (partX2  fullX2)
   partX2 = fullX2;
 
   if (partX2  partX1) {
   uxa_screen-info-composite(dst_pixmap,
   0, 0, 0, 0,
   partX1 + off_x,
   fullY1 + off_y,
   partX2 - partX1, 1);
   }
   }
   pbox++;
 }
 
 The bug is the missing check of fullY1 against the lower bottom of
 the clipping rectangle, pbox-y2.
 
Asked upstream, one question for you:
21:16  ickle pbox-y2  pbox-y1 is an invalid rect
21:18  ickle the previous line should be pbox-y1 = fullY1 break
21:18  ickle can you ask if it appears to be just an off-by-one?

ie what are the values of pbox-y1 and pbox-y2?

Cheers,
Julien



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2011-05-15 Thread Julien Cristau
On Sun, May 15, 2011 at 21:34:26 +0200, Thomas Richter wrote:

 On 15.05.2011 21:21, Julien Cristau wrote:
 Asked upstream, one question for you:
 21:16  ickle  pbox-y2  pbox-y1 is an invalid rect
 21:18  ickle  the previous line should be pbox-y1= fullY1 break
 21:18  ickle  can you ask if it appears to be just an off-by-one?
 
 ie what are the values of pbox-y1 and pbox-y2?
 
 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.
 
cc:ing Chris so he can answer directly.

Cheers,
Julien



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



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

2011-02-26 Thread Thomas Richter

Package: xserver-xorg-video-intel
Version: 2:2.13.0-5
Severity: important

*** Please type your report below this line ***

The xserver-xorg-video-intel display driver does not seem to clip some
render operations appropriately to the containing window. To reproduce
this bug, open for example a document with xpdf and then open the
requester to search for a string in the document. Drag this requester
over the window boundaries of xpdf. The result is that when xpdf
repaints its window, the render operation that redraws the boundary of
the xpdf main window also renders into the requester, partially
overwriting its contents - vertical or horizontal grey lines distort
its contents.

Apparently, clipping the line drawing or rectangle drawing operation
to the visible part of the xpdf main window does not work correctly
and renders also into the requester window on top of it instead of
clipping to the visible part only.

This bug does not go away by disabling the Tiling option, or the
Dri2 extension, or the AIGLX option of the X server. The old i810
intel driver, however, handled this correctly in the lenny distribution.

This bug may be a duplicate of 592855,596085,614296,554427,558396.

Note that the kernel is already a 2.6.35.11, not the native Debian
kernel. However, the bug also appears on with native Debian kernel as
well.


-- Package-specific info:
/var/lib/x11/X.roster does not exist.

/var/lib/x11/X.md5sum does not exist.

X server symlink status:
lrwxrwxrwx 1 root root 13 Aug 25  2007 /etc/X11/X - /usr/bin/Xorg
-rwxr-xr-x 1 root root 1889440 Jan 12 04:12 /usr/bin/Xorg

/var/lib/x11/xorg.conf.roster does not exist.

VGA-compatible devices on PCI bus:
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 
943/940GML Express Integrated Graphics Controller (rev 03)


/var/lib/x11/xorg.conf.md5sum does not exist.

Xorg X server configuration file status:
-rw-r--r-- 1 root root 5127 Feb 23 11:32 /etc/X11/xorg.conf

Contents of /etc/X11/xorg.conf:
# /etc/X11/xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the /etc/X11/xorg.conf manual page.
# (Type man /etc/X11/xorg.conf at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section Files
FontPathunix/:7100
FontPathunix/:7101
FontPath/usr/share/fonts/X11/misc
#FontPath   /usr/X11R6/lib/X11/fonts/misc
# path to defoma fonts
FontPath/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType
#FontPath   /var/lib/defoma/gs.d/dirs/fonts
EndSection

Section Module
Loadi2c
Loadbitmap
Loadddc
Loaddri
Loadextmod
Loadfreetype
Loadglx
Loadint10
Loadvbe
Loadsynaptics
EndSection

Section InputDevice
Identifier  Generic Keyboard
Driver  kbd
Option  SendCoreEvents  on
Option  XkbRulesxorg
Option  XkbModelpc105
Option  XkbLayout   de
Option  XkbVariant  thor
EndSection

Section InputDevice
Identifier  Configured Mouse
Driver  mouse
Option  SendCoreEvents  on
Option  Device  /dev/input/mice
Option  ProtocolImPS/2
EndSection

Section InputDevice
Identifier  Synaptics Touchpad
Driver  synaptics
Option  SendCoreEvents  true
Option  Device  
/dev/input/by-path/platform-i8042/serio-4-event-mouse
Option  Protocolauto-dev
Option  HorizScrollDelta0
Option  SHMConfig   on
Option  UpDownScrolling off
Option  MaxTapTime  200
Option  MaxDoubleTapTime400
Option  FastTapson
Option  FingerHigh  60
Option  PalmDetect  on
Option  PalmMinWidth6
Option  LockedDrags off
EndSection


Section InputDevice
Identifier  stylus
Driver  wacom
Option  ForceDevice ISDV4
Option  Device  /dev/ttyS0
Option  InputFashionPen
Option  Namec100
Option  ForceDevice ISDV4
Option

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

2011-02-26 Thread Cyril Brulebois
Hi,

Thomas Richter t...@math.tu-berlin.de (26/02/2011):
 Apparently, clipping the line drawing or rectangle drawing operation
 to the visible part of the xpdf main window does not work correctly
 and renders also into the requester window on top of it instead of
 clipping to the visible part only.
 
 This bug does not go away by disabling the Tiling option, or the
 Dri2 extension, or the AIGLX option of the X server. The old
 i810 intel driver, however, handled this correctly in the lenny
 distribution.
 
 This bug may be a duplicate of 592855,596085,614296,554427,558396.
 
 Note that the kernel is already a 2.6.35.11, not the native Debian
 kernel. However, the bug also appears on with native Debian kernel as
 well.

(FWIW, since you're talking about the kernel, there's 2.6.37 in sid
and 2.6.38rc* in experimental)

If that's only an issue on the X intel driver side, you may want to
check what happens with src:libdrm and src:xserver-xorg-video-intel
rebuilt on squeeze. We plan to provide with backports, as described
here:
  http://pkg-xorg.alioth.debian.org/reference/squeeze-backports.html

KiBi.


signature.asc
Description: Digital signature