Bug 19888

Summary: [GME965] opengl.org example of glDrawPixels doesn't draw correctly
Product: Mesa Reporter: smith <stopads>
Component: Drivers/DRI/i965Assignee: Gordon Jin <gordon.jin>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Bundle of files showing rendering output, log files, etc.
Picture of bad rendering
Picture of good rendering, taken from opengl.org site
Source code of example, from opengl.org site
verbose output of glxinfo
verbose output of Xorg log file
Xorg config file
lspci output (more system info, if desired)
dmesg output (more system info, as suggested)

Description smith 2009-02-01 21:28:01 UTC
Created attachment 22458 [details]
Bundle of files showing rendering output, log files, etc.

The attached example is from "examples.zip", downloaded from http://www.opengl.org/resources/code/samples/glut_examples/examples/examples.html

One of the examples demonstrates texture versus pixel drawing: abgr.c.

I compiled it like this:
gcc -o abgr abgr.c -lglut -lGLU -lGL
Then run it:
./abgr

You should see cleanly drawn bars, but as you can see (attached), my Fedora 10 system doesn't render them correctly.  I ran the same code on older hardware (not Intel) with Fedora 9 and it looks perfect.

I'm running the Intel 2.6.28 kernel from http://intellinuxgraphics.org/2008Q4.html.  Otherwise I'm running an up-to-date Fedora 10 on an Intel GME965 chipset.  It also occurs on the latest 2.6.27 kernels.

It's 100% repeatable.  I have also tried displaying real jpeg images with Objective-C code (which doesn't use GLUT in any way... I think), and see the same "interleave" rendering.  Performance is also dismal, but let's solve one thing at a time!

I also tried using the latest releases from git (intel, drm, mesa, xserver 1.6 branch), and got the following error:
$ ./abgr
No protocol specified
GLUT: Fatal Error in abgr: could not open display: :0.0

Let me know if i can provide more info.  This should be easy to test, since I'm demonstrating the problem with "known" sample code.

Thanks!

$ uname -a
Linux kontron-f10 2.6.28 #1 SMP Mon Jan 19 17:42:49 EST 2009 i686 i686 i386 GNU/Linux
Comment 1 Gordon Jin 2009-02-02 04:06:47 UTC
Thanks for filing the bug. But please refer to http://www.intellinuxgraphics.org/how_to_report_bug.html. It will be better not to use zipped attachment.
Comment 2 smith 2009-02-02 08:10:20 UTC
Created attachment 22479 [details]
Picture of bad rendering
Comment 3 smith 2009-02-02 08:11:15 UTC
Created attachment 22480 [details]
Picture of good rendering, taken from opengl.org site
Comment 4 smith 2009-02-02 08:11:47 UTC
Created attachment 22481 [details]
Source code of example, from opengl.org site
Comment 5 smith 2009-02-02 08:12:28 UTC
Created attachment 22482 [details]
verbose output of glxinfo
Comment 6 smith 2009-02-02 08:13:16 UTC
Created attachment 22483 [details]
verbose output of Xorg log file
Comment 7 smith 2009-02-02 08:13:45 UTC
Created attachment 22484 [details]
Xorg config file
Comment 8 smith 2009-02-02 08:14:33 UTC
Created attachment 22485 [details]
lspci output (more system info, if desired)
Comment 9 smith 2009-02-02 08:17:42 UTC
Created attachment 22486 [details]
dmesg output (more system info, as suggested)
Comment 10 smith 2009-02-02 08:20:38 UTC
Also, here is some more info (recommended by the bug reporting link):

I'm using a DVI connection to a HP LP2065 panel.

$ pkg-config --modversion libdrm
2.4.0

$ glxinfo
OpenGL version string: 1.4 Mesa 7.3-devel

$ more /var/log/Xorg.0.log
X.Org X Server 1.5.3
(II) Loading /usr/lib/xorg/modules/drivers//intel_drv.so
(II) Module intel: vendor="X.Org Foundation"
	compiled for 1.5.3, module version = 2.5.0
	Module class: X.Org Video Driver
	ABI class: X.Org Video Driver, version 4.1

Thanks!  Please let me know if I can provide anything else.
Comment 11 smith 2009-02-02 12:51:18 UTC
It occurred to me that this bug may get pushed to low priority because "it's just a trivial example".  I selected the example because it's easier to post than pieces of my real project, plus it's easy to test, easy to obtain, and known to work.  So, while it may seem insignificant, the attached example mimics my real-world problem.

Thanks again.
Comment 12 Eric Anholt 2009-02-03 17:06:33 UTC
This is a problem with detecting tile swizzling for software fallbacks on your chipset.  It should go away if you update to current Mesa, as drawpixels will be accelerated instead of being a software fallback.
Comment 13 Gordon Jin 2009-02-03 22:24:09 UTC
Closing this according to Eric's comment. Please reopen if you find mesa master still not working.
Comment 14 smith 2009-02-04 08:00:53 UTC
I have a chicken and egg problem.  I downloaded the latest Mesa, but Bug #19935 is preventing me from running the example. 

I guess I'll try to gather the tarball versions used by Fedora and do another build, but I suspect the latest Mesa will ask for newer sources, which will trigger Bug #19935 again.  Please let me know if you have a better idea.

Thanks. 
Comment 15 smith 2009-02-04 11:02:02 UTC
Good news, it works now... almost.  

glDrawPixels works correctly with the latest Mesa, however, now my keyboard is not responding to the up arrow correctly.  When I push the up arrow, a "save screenshot" dialog appears!  I'll do some searching to see if there's a fix for this problem.  If I can't find anything, I'll open a new bug.

For others with the glDrawPixels problem, here are my build versions based on Fedora 10, which were required avoid the problems of Bug #19935 (still unresolved at this time):

dri2proto-1.99.3.tar.bz2
libdrm-2.4.3.tar.bz2
mesa-mesa_7_4_branch-2009-02-03_22-40-16.tar.bz2 (I tried master too)
util-macros-1.1.6.tar.bz2
xf86-input-evdev-2.1.0.tar.bz2
xf86-input-keyboard-1.3.0.tar.bz2
xf86-input-mouse-1.3.0.tar.bz2
xf86-video-intel-2.5.0.tar.bz2
xf86-video-vesa-2.0.0.tar.bz2
xorg-server-1.5.3.tar.bz2

Note that Fedora 10 is based on libdrm-2.4.0 and dri2proto-1.99.1.  I had to upgrade these two components to satisfy the Mesa build requirements.

Thanks for your help.  

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.