Bug 28459 - [r300g] Heroes of Newerth slow and corrupted with libtxc_dxtn.so
Summary: [r300g] Heroes of Newerth slow and corrupted with libtxc_dxtn.so
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r300 (show other bugs)
Version: git
Hardware: Other Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
: 27756 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-09 01:36 UTC by Pavel Ondračka
Modified: 2010-08-02 23:59 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
possible fix (1.42 KB, patch)
2010-06-11 05:35 UTC, Roland Scheidegger
Details | Splinter Review
fix r1xx/r2xx/r3xx (4.05 KB, patch)
2010-06-11 15:55 UTC, Alex Deucher
Details | Splinter Review

Description Pavel Ondračka 2010-06-09 01:36:52 UTC
I wanted to try compressed texture support with r300g so I installed  libtxc_dxtn.so and I got some nice improvements (for example in Neverwinter Nights textures looks many times better). However in Heroes of Newerth (HoN) there is big slowdown in menu and while in game it is so slow it almost looks like frozen and there is massive corruption.

Terminal output:
radeon: Bad CS, dumping...
VENDORID:DEVICEID 0x1002:0x71C5
0x00001007
0x00000004
...
tons of similar hexadecimal output

Dmesg shows this:
[drm:r100_cs_track_texture_check] *ERROR* Texture of unit 0 needs 8320 bytes but is 4096
[drm:r100_cs_track_texture_print] *ERROR* pitch                      1
[drm:r100_cs_track_texture_print] *ERROR* use_pitch                  0
[drm:r100_cs_track_texture_print] *ERROR* width                      1
[drm:r100_cs_track_texture_print] *ERROR* width_11                   0
[drm:r100_cs_track_texture_print] *ERROR* height                     128
[drm:r100_cs_track_texture_print] *ERROR* height_11                  0
[drm:r100_cs_track_texture_print] *ERROR* num levels                 7
[drm:r100_cs_track_texture_print] *ERROR* depth                      0
[drm:r100_cs_track_texture_print] *ERROR* bpp                        4
[drm:r100_cs_track_texture_print] *ERROR* coordinate type            0
[drm:r100_cs_track_texture_print] *ERROR* width round to power of 2  0
[drm:r100_cs_track_texture_print] *ERROR* height round to power of 2 0
[drm:r100_cs_track_texture_print] *ERROR* compress format            2
[drm:radeon_cs_ioctl] *ERROR* Invalid command stream !

mesa: ebd98b3496d750a6595382e75267361d2b1e47e2
kernel: 2.6.33.5-112.fc13
GPU: ATI Technologies Inc M56P [Radeon Mobility X1600] (RV530)
Comment 1 Roland Scheidegger 2010-06-09 07:26:17 UTC
(In reply to comment #0)
> I wanted to try compressed texture support with r300g so I installed 
> libtxc_dxtn.so and I got some nice improvements (for example in Neverwinter
> Nights textures looks many times better). However in Heroes of Newerth (HoN)
> there is big slowdown in menu and while in game it is so slow it almost looks
> like frozen and there is massive corruption.

might be bug in the drm checker. 
> [drm:r100_cs_track_texture_print] *ERROR* bpp                        4
> [drm:r100_cs_track_texture_print] *ERROR* compress format            2
Dunno how that would happen, but compressed textures should always show up with a bpp of 1 (with 4 the calculated size will be 4 times as big as needed). I know there were some bugs wrt compressed textures in that area, but pretty sure it should be fixed in 2.6.33...
Comment 2 Pavel Ondračka 2010-06-09 07:30:11 UTC
Should I try some newer kernel?
Comment 3 Marek Olšák 2010-06-09 07:54:13 UTC
Yes, please give it a try.
Comment 4 Pavel Ondračka 2010-06-09 07:58:18 UTC
Which one, 2.6.34 or 2.6.35-rc2?
Comment 5 Marek Olšák 2010-06-09 08:55:38 UTC
Either this:

git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-linus

or 2.6.34 or any later version.
Comment 6 Pavel Ondračka 2010-06-10 04:01:41 UTC
Sadly, this bug is present also with kernel 2.6.35-rc2. Do you need any more info or logs?
Comment 7 Roland Scheidegger 2010-06-10 05:17:58 UTC
I think an explanation could be that there are two packets for the same texture unit in the command stream - if the first one is compressed, it would set cpp to 1 and set the compress bits, but if the second one is uncompressed it would set cpp according to format but the compress bits would stay as it's only written if the format is compressed.
Comment 8 Roland Scheidegger 2010-06-11 05:35:00 UTC
Created attachment 36214 [details] [review]
possible fix

If my theory is right, the attached patch might help (that's just a quick try, r100/r200 would need the same).
Comment 9 Fabio Pedretti 2010-06-11 09:01:00 UTC
(In reply to comment #8)
> Created an attachment (id=36214) [details]
> possible fix
> 
> If my theory is right, the attached patch might help (that's just a quick try,
> r100/r200 would need the same).

I was having the same crash problem with sauerbraten game (bug #27756) and this patch seems to fix it (tested with linux 2.6.34). When submitting the patch could you push it also to linux stable branch 2.6.32/33/34? 

There are still 2 similar bugs that would be nice to have fixed: bug #27755 and bug #27507.

Thanks.
Comment 10 Fabio Pedretti 2010-06-11 09:01:12 UTC
*** Bug 27756 has been marked as a duplicate of this bug. ***
Comment 11 Pavel Ondračka 2010-06-11 12:07:10 UTC
Thank you Roland, with your patch Heroes of Newerth works fine again. This bug can be closed after your patch is committed.
Comment 12 Alex Deucher 2010-06-11 15:55:20 UTC
Created attachment 36226 [details] [review]
fix r1xx/r2xx/r3xx

This patch combines Roland's patch with the same fixes for r1xx and r2xx.  Roland, if you want to sign off on it, I'll send it to Dave.
Comment 13 Roland Scheidegger 2010-06-12 06:57:13 UTC
Review of attachment 36226 [details] [review]:

Signed-off-by: Roland Scheidegger <sroland@vmware.com>
Comment 14 Alex Deucher 2010-06-12 09:13:01 UTC
Sent to Dave.
Comment 15 Marek Olšák 2010-06-21 14:05:06 UTC
The patch has been committed to:
git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6.git drm-fixes
And should appear in the next kernel. Closing,
Comment 16 madbiologist 2010-07-06 20:32:30 UTC
This patch has been included in kernel 2.6.35-rc4.
Comment 17 Fabio Pedretti 2010-08-02 23:59:18 UTC
This is also fixed in 2.6.34.2.


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.