Bugzilla – Bug 20473
[855GM] garbled 3D with latest xf86-video-intel git, with tiling on
Last modified: 2009-08-24 12:31:54 UTC
Created attachment 23539 [details]
Garbled glxgears screenshot
I am getting garbled 3D with latest xf86-video-intel git. I am using xorg-server 1.6, Linux 2.6.29-rc7 with kernel modesetting, libdrm 2.4.5 and Mesa 7.3 on an i686 Gentoo system.
It is an IBM R51 laptop with integrated 855GM video.
A work-around I have found is to disable tiling in xorg.conf.
Created attachment 23540 [details]
Is it the same if without kernel modesetting?
Without kernel modesetting if I have tiling on, the whole screen is garbled (even KDM login screen). With tiling off, everything looks OK.
Anything else I could test?
I filed a new bug #20781 about whole screen being garbled, as it is probably a different problem.
Coming back to the 3D corruption, I can now confirm that if I have tiling on, glxgears picture is garbled in both KMS and non-KMS cases. And turning tiling off fixes it in both cases.
we can reproduce this issue on our 855gm against the latest driver:
Xserver: (server-1.6-branch) 60c161545af80eb78eb790a05bde79409dfdf16e
Kernel: (drm-intel-2.6.29) 0e56a4d653b66d4729f944b23935a00c4472f987
I seem to have a similar issue on my i855GM (IBM Thinkpad X40). It looks like glxgears renders correctly, but when drawing to the frontbuffer, the tiling is screwed up.
The interesting thing is that with mes-7.3, when a make the glxgears window wider than 512 pixels (height doesn't matter), it looks all right again. My back-of-the-envelope calc shows that this should be that 512 is the max width for a tiled surface (with 4 bytes per pixel). With mesa-7.4, widening the window does not help at all. Additionally, it doesn't render into the whole area but only the upper left corner. But the gears get bigger (still tiled, of course).
I tried to bisect my window-wider-than-512-pixel observation. Results:
Last version of mesa where a window wider than 512 pixels fixes my issue.
The version in between. Here I just get a completely black glxgears window. Nothing changes when resizing.
This is the first commit where a window wider than 512 pixels doesn't fix it. Furthermore it looks like the viewport is somehow not updated. glxgears only ever renders into the upper-left corner of the window with an area the size when it was started.
I've just checked and with -fullscreen, glxgears seems to work even with the bad commits (window is wider than 512 pixels). Looks like an independant problem. Should I file another bug report about this viewport issue?
I've just checked the master branch of mesa. Both gallium and non-gallium have the tiling issue. But gallium does not have the viewport issue, i.e. it draws into the whole window and if it's wider than 512 pixels, everything is alright.
(In reply to comment #7)
The viewport issue also affects running GoogleEarth, showing only a small map in the upper-left corner of the window (bug 21099).
This seems to be caused by an error in
/mesa-master/src/mesa/drivers/dri/i915/i915_state.c somewhere in "Update the
viewport transformation matrix".
Replacing this file with the one of
fixes the glxgears and GoogleEarth issue (using UXA with tiling disabled).
(In reply to comment #9)
Also renders glxgears correctly when tiling is enabled.
This also affects 845G
I've just checked the master branch of mesa (Mesa 7.6-devel) and the master branch of the video-intel driver (2.7.99).
I am using Debian kernel 2.6.30-rc4-686, modesetting enabled.
Both issues (garbled 3D and window not wider than 512 pixels) are fixed.
In Mesa 7.5.rc1 the garbled 3D is fixed but the window problem is still present!
On Fri, May 08, 2009 at 10:37:03PM -0700, email@example.com wrote:
> --- Comment #12 from Jos van Wolput <firstname.lastname@example.org> 2009-05-08 22:36:55 PST ---
> I've just checked the master branch of mesa (Mesa 7.6-devel) and the master
> branch of the video-intel driver (2.7.99).
> I am using Debian kernel 2.6.30-rc4-686, modesetting enabled.
> Both issues (garbled 3D and window not wider than 512 pixels) are fixed.
> In Mesa 7.5.rc1 the garbled 3D is fixed but the window problem is still
I've just retested latest 2d-ddx and mesa (both times master branch). The
problem still exists on my setup (debian, too, and a recent kernel:
- using the gallium drivers I get tiled output and all the effects of the
broken viewport isse.
- with normal mesa dri (so file lib/i915_dri.so in the mesa tree)
rendering is fine _but_ this is only due to falling back to software
rendering. LIBGL_DEBUG=verbose shows
libGL error: dlopen lib/i915_dri.so failed (lib/i915_dri.so: undefined
This is with the latest libdrm-intel from debian. No compile time errors.
(In reply to comment #13)
You're right! I didn't notice the error (lib/i915_dri.so: undefined symbol: intel_generate_mipmap,falling back to software rendering ). Sorry!
Created attachment 25702 [details] [review]
fix link-time breakage of i915_dri.so in latest mesa -master
This fixes the issue (fallback to software renderer) I mentioned in comment #13. Please check & apply.
Created attachment 25714 [details] [review]
fix window wider than 512 pixels
fix window wider than 512 pixels issue of i915_dri.so in latest mesa-master and mesa_7_5_rc1
On Sun, May 10, 2009 at 10:45:51PM -0700, email@example.com wrote:
> --- Comment #16 from Jos van Wolput <firstname.lastname@example.org> 2009-05-10 22:45:50 PST ---
> Created an attachment (id=25714)
> --> (http://bugs.freedesktop.org/attachment.cgi?id=25714)
> fix window wider than 512 pixels
> fix window wider than 512 pixels issue of i915_dri.so in latest mesa-master and
I've tested your patch (I've had to recreate it because it was
whitespace-mangled). It results in a run-time linker error (run with
LIBGL_DEBUG=verbose to see) and the resulting fallback to
software-rendering makes the viewport issue disappear.
Created attachment 25725 [details] [review]
debug patch: show driDrawable coords
While tinkering around a came up with this debug patch. When using glxgears it shows clearly that the driDrawable in the intel GLContext is not updated when resizing the window. Therefore the transformation matrix calculations right after my printf statement are bogus.
The resulting bogus matrix agrees with what I deduced from looking at the output of glxgears: Statically fixed bottom (when shrinking vertically the gears actually move downwards out of the window) and truncated at a fixed width.
Warning: this patch totally floods stderr.
Can someone with more knowledge of the innards of mesa/dri please look where the driDrawable is not updated, but should be? My grep-fu is no quite up to this task ... ;)
Thanks for the bisects and the details -- led me pretty quickly to some problems that should have it fixed now. One was that the kernel tiling code for 8xx was quite broken. Patch in for-review and on the mailing list:
Author: Eric Anholt <email@example.com>
Date: Tue May 26 17:44:56 2009 -0700
drm/i915: Fix tiling pitch handling on 8xx.
The pitch field is an exponent on pre-965, so we were rejecting buffers
on 8xx that we shouldn't have. 915 got lucky in that the largest legal
value happened to match (8KB / 512 = 0x10), but 8xx has a smaller tile width
Additionally, we programmed that bad value into the register on 8xx, so the
only pitch that would work correctly was 4096 (512-1023 pixels), while other
would probably give bad rendering or hangs.
Another was that Viewport and DepthRange had been dropped on 8xx since the black-window commit you noted. Pushed to Mesa master:
Author: Eric Anholt <firstname.lastname@example.org>
Date: Tue May 26 19:48:08 2009 -0700
i915: Restore the Viewport and DepthRange functions on 8xx.
Fixes failed viewport updates on glxgears (and other apps) resize since
I can verify this fixes glxgears on my 845. I also no longer get the line
(EE) intel(0): Failed to set tiling on front buffer: Invalid argument
in my Xorg.0.log.
I've also tested your patches and glxgears works again (855GM). But the gallium driver is still broken: It still suffers from the viewport-update-issue (tiling is fixed like with the normal dri driver). Should I open a new bug report to track this?
We don't have anything to do with the gallium driver, so it would only be appropriate in a separate bug report so that someone that cares about Gallium could handle it.
(In reply to comment #19)
> Another was that Viewport and DepthRange had been dropped on 8xx since the
> black-window commit you noted. Pushed to Mesa master:
> commit 0e83e8f51af07a3066519f169f07d9afbf23252e
> Author: Eric Anholt <email@example.com>
> Date: Tue May 26 19:48:08 2009 -0700
> i915: Restore the Viewport and DepthRange functions on 8xx.
> Fixes failed viewport updates on glxgears (and other apps) resize since
> Bug #20473.
Hi Eric, could you nominate this patch for inclusion in mesa's 7.5 branch?
Mass version move, cvs -> git