Bug 26471 - Missing background graphics/texture in frogatto with R600 (RV670)
Summary: Missing background graphics/texture in frogatto with R600 (RV670)
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/R600 (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-08 08:11 UTC by Nils Kneuper
Modified: 2010-02-12 17:34 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
scene1, hardware accelerated, broken background (32.21 KB, image/jpeg)
2010-02-08 08:11 UTC, Nils Kneuper
Details
scene2, hardware accelerated, broken background (48.60 KB, image/jpeg)
2010-02-08 08:12 UTC, Nils Kneuper
Details
scene1, software mode, expected result (63.39 KB, image/jpeg)
2010-02-08 08:12 UTC, Nils Kneuper
Details
scene2, software mode, expected result (48.60 KB, image/jpeg)
2010-02-08 08:13 UTC, Nils Kneuper
Details
Xorg.0.log (26.35 KB, text/plain)
2010-02-08 08:21 UTC, Nils Kneuper
Details
xorg.conf (3.77 KB, text/plain)
2010-02-08 08:21 UTC, Nils Kneuper
Details
dmesg (30.24 KB, application/octet-stream)
2010-02-08 08:21 UTC, Nils Kneuper
Details
Frogatto intro scene screenshot r1713 (8.40 KB, image/png)
2010-02-09 13:39 UTC, Andrius Štikonas
Details
norm (5.83 KB, patch)
2010-02-10 03:25 UTC, Andre Maasikas
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nils Kneuper 2010-02-08 08:11:28 UTC
Created attachment 33154 [details]
scene1, hardware accelerated, broken background

I have a problem with the background texture as used in frogatto (a sidescrolling jump&run). The problem can be seen in the attached screenshots frogatto_texture-prob1.jpg and frogatto_texture-prob2.jpg. The expected result can be observed in frogatto_software-mode_scene1.jpg and frogatto_software-mode_scene2.jpg (created using the software renderer via LIBGL_ALWAYS_SOFTWARE=1). My graphics card is a generic HD3850 (RV670) with 512MB ram.

To reproduce this issues you will first have to get frogatto and build it yourself, to do so do the following steps:
0) get the build dependencies, I am not sure about those. From the flags used in the command I'd assume these: 
- libsdl
- sdl-image
- sdl-ttf
- sdl-mixer (probably with vorbis support)
- boost-{regex, system, thread, iostreams}
- x11
- mesa (GL and GLU required)
- glew
1) get the svn checkout eg using "svn checkout http://frogatto.googlecode.com/svn/trunk/ frogatto-read-only"
2) cd frogatto-read-only
3) edit "Makefile" and remove every occurence of "-lprofiler" (seems to break building due to whatever reason, not fixed yet for upstream, but this way it is possible to compile+run it)
4) compile using "make"
5) run the resulting binary by typing "./game" (controls are the arrow keys plus 'a' and 's', exit the game by pushing 'esc')

After step 5) you should see the missing background texture when using the git version of mesa (currently as of today 7.8-devel). There is no problem when using the software renderer and there is also no problem on a system with an Intel i945 based chip and mesa 7.7 or mesa 7.6. I don't know if it ever worked for r6xx hardware with mesa.
Someone yesterday mentioned in #radeon that s3tc is broken on r600. I don't know if s3tc is used, but I don't think so. Is there some easy way to check this in the sources?

Here is the software stack used:
Gentoo unstable (arch: amd64)
mesa, xf86-video-radeon and libdrm from git-master
KMS active
kernel 2.6.33-rc7
Comment 1 Nils Kneuper 2010-02-08 08:12:09 UTC
Created attachment 33155 [details]
 scene2, hardware accelerated, broken background
Comment 2 Nils Kneuper 2010-02-08 08:12:57 UTC
Created attachment 33156 [details]
scene1, software mode, expected result
Comment 3 Nils Kneuper 2010-02-08 08:13:20 UTC
Created attachment 33157 [details]
scene2, software mode, expected result
Comment 4 Nils Kneuper 2010-02-08 08:21:12 UTC
Created attachment 33158 [details]
Xorg.0.log
Comment 5 Nils Kneuper 2010-02-08 08:21:24 UTC
Created attachment 33159 [details]
xorg.conf
Comment 6 Nils Kneuper 2010-02-08 08:21:42 UTC
Created attachment 33160 [details]
dmesg
Comment 7 Nils Kneuper 2010-02-08 16:20:47 UTC
shadowmaster (another Wesnoth dev) just told me that he has the same problems with frogatto. Here some info about his system:
01:05.0 VGA compatible controller: ATI Technologies Inc RS780M/RS780MN [Radeon HD 3200 Graphics]
Linux 2.6.32.5 on Debian Squeeze
running Mesa 7.7 (release)
lastest-ish drm from the git repository
latest-ish ddx from the radeon repository
no KMS

So it looks like it does not depend on KMS and that the issue is no regression (since it does already exist in 7.7).
Comment 8 Nils Kneuper 2010-02-09 06:56:49 UTC
To make sure to get a version that does compile and link, please use this checkout link:
svn checkout -r 1712 http://frogatto.googlecode.com/svn/trunk/ frogatto-read-only

You still have to update the Makefile, this sed command does the job:
sed -i "s/ -lprofiler//g" Makefile
Comment 9 Michael de Lang 2010-02-09 08:52:36 UTC
I can confirm this on a Radeon 4550(RV710).
Comment 10 Andrius Štikonas 2010-02-09 13:34:41 UTC
Frogatto started working after revision 1713

r1713: Integrated the rectangle rotation code into the blitting routines to actually be used when an object is to be rotated.

So this bug can be caused by broken blitting on r600.
Comment 11 Andrius Štikonas 2010-02-09 13:39:21 UTC
Created attachment 33197 [details]
Frogatto intro scene screenshot r1713

The diff of the revision that broken Frogatto even worse.

http://code.google.com/p/frogatto/source/detail?r=1713#
Comment 12 Alex Deucher 2010-02-09 13:45:38 UTC
(In reply to comment #10)
> Frogatto started working after revision 1713
> 
> r1713: Integrated the rectangle rotation code into the blitting routines to
> actually be used when an object is to be rotated.
> 
> So this bug can be caused by broken blitting on r600.
> 

Sounds like an app bug if it's fixed in a newer version of the app.  The r600 driver in mesa 7.6 and 7.7 doesn't accelerate CopyTex(Sub)Image (which is what the 'blit' code in the r600 driver does), only mesa master does.
Comment 13 Nils Kneuper 2010-02-09 14:16:24 UTC
Okay, some updates.
1) As testcase you can also use rev1715. In this one there is no change to the makefile required. If you got the libs, you should be able to compile things with a simple "make". Yes, in >=r1713 basically all textures "vanished".


2) In IRC, talking with agd5f and Jetrel (one of the people working on frogatto) we found the reason for those missing textures. Here is the respective part from the logs of #radeon:

[22:47:36] <agd5f> Ivanovic, stikonas: does it work any better/worse with mesa 7.7 branch?
[22:51:40] <Ivanovic> agd5f: no visible difference for me in frogatto r1712
[22:51:58] <Ivanovic> agd5f: that with both, git master and mesa 7.7 (release version) it looks identical
[22:52:08] <agd5f> Ivanovic: ok.  so probably not the blit code
[22:52:51] <agd5f> Ivanovic: if you use non-float values for vertex attributes that may be a problem
[23:09:07] <Ivanovic> agd5f: just talked to jetrel (he is online in irc, though he tends to not join too many chans...), he said that they intentionally use shorts for the vertex attributes since this is just the precision required
[23:09:21] <Ivanovic> agd5f: this should explain the reason for the problems, right?
[23:09:54] <Ivanovic> the reason for this is the reduced memory bandwidth compared to using floats
[23:09:56] <agd5f> Ivanovic: yes.  they are broken right now in git
[23:10:48] <Ivanovic> okay
[23:11:15] <Ivanovic> agd5f: want me to add this as comment to the bugreport or will you take care of it? (that is: i would just paste this part of the changelog)
[23:12:19] <agd5f> Ivanovic: yes please
Comment 14 Andre Maasikas 2010-02-10 03:25:32 UTC
Created attachment 33209 [details] [review]
norm

patch to try
Comment 15 Nils Kneuper 2010-02-10 04:56:56 UTC
(In reply to comment #14)
> Created an attachment (id=33209) [details]
> norm
> 
> patch to try
> 

Yes, this patch fixes the issues. Textures are not displayed correctly in forgatto. Thanks!
Comment 16 Andrius Štikonas 2010-02-10 05:48:36 UTC
I can also confirm, that this patch fixes the textures.
Comment 17 Ignacio R. Morelle 2010-02-10 18:17:27 UTC
(In reply to comment #14)
> Created an attachment (id=33209) [details]
> norm
> 
> patch to try
> 

The patch solves the problem here with a Radeon HD 3200 (RS780M/RS780MN) controller on Debian Squeeze (amd64, custom Linux 2.6.32.5 build, no KMS, latest radeon ddx and libdrm from the git repos). All textures were previously missing with the same latest build of the application, using both Mesa 7.7 and later HEAD from the git master (before applying the patch, that is).


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.