Bug 36745 - wine 1.3.19 and 3Dmark2001SE Dragothic demo upset kernel 2.6.38.4
Summary: wine 1.3.19 and 3Dmark2001SE Dragothic demo upset kernel 2.6.38.4
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r300 (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-01 09:19 UTC by Andrew Randrianasulu
Modified: 2011-06-30 03:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
glxinfo (12.07 KB, text/plain)
2011-05-01 09:20 UTC, Andrew Randrianasulu
Details
X log (369.64 KB, text/plain)
2011-05-01 09:21 UTC, Andrew Randrianasulu
Details
last 350 lines from /var/log/messages (26.11 KB, text/plain)
2011-05-01 09:25 UTC, Andrew Randrianasulu
Details
dmesg from 2.6.39-rc5+ with additional debug in r300.c (122.41 KB, text/plain)
2011-05-02 19:21 UTC, Andrew Randrianasulu
Details
stderr log with export RADEON_DEBUG=draw, bz2 compressed (3.66 KB, application/octet-stream)
2011-05-02 19:54 UTC, Andrew Randrianasulu
Details
more debug in dmesg (103.33 KB, text/plain)
2011-05-03 04:08 UTC, Andrew Randrianasulu
Details

Description Andrew Randrianasulu 2011-05-01 09:19:44 UTC
After installing my Slackware (+ self-compiled X stack) on this new machine with rv350 AGP card inside, I run few usual tests, and found that two demo scenes from 3Dmark2001SE build 330 (Dragothic low/high detail) renders incorrectly.

hardware:
GPU
r300: DRM version: 2.8.0, Name: ATI RV350, ID: 0x4152, GB: 1, Z: 1
r300: GART size: 61 MB, VRAM size: 128 MB
r300: AA compression: NO, Z compression: NO, HiZ: NO

cpu:
Intel(R) Pentium(R) 4 CPU 1.80GHz

256Mb system memory

Software:

drm - ba11501bb9f5bd98110dfe1385b4501c0a9a643a ("configure: version bump for 2.4.25 release")

mesa - fb8786bda320fef12219bf71ea83d703be6aa48f ("st/mesa: remove set-but-unused variables")

xserver - 1.9 branch at 90955857b20d0f5431f1c87f76adf1b89ec3f661 ("xfree86: loader: fix memory leaks in LoaderListDirs")

xf86-video-ati - 903e90c31cf0319be9297529aa7b8daa1756cf63 ("EXA/Xv: used cached bo tiling flags for accel setup on 6xx+")

kernel - 2.6.38.4 mainline

wine - wine-1.3.19

Messages on console looks like:
fixme:d3d:state_clipping Clipping disabled, but ARB_depth_clamp isn't supported.
fixme:d3d:state_clipping Clipping disabled, but ARB_depth_clamp isn't supported.
radeon: The kernel rejected CS, see dmesg for more information.


(one about missing ARB_depth_clamp probably harmless, i saw it long ago with nvfx/nv40 gallium driver and older wine version)

in dmesg:
[drm:r100_cs_track_check] *ERROR* [drm] color buffer 0 (46 3455865856 46 768)
[drm:radeon_cs_ioctl] *ERROR* Invalid command stream !
[drm:r100_cs_track_check] *ERROR* [drm] Buffer too small for color buffer 0 (need 88604718 have 28672) !
Comment 1 Andrew Randrianasulu 2011-05-01 09:20:27 UTC
Created attachment 46223 [details]
glxinfo
Comment 2 Andrew Randrianasulu 2011-05-01 09:21:19 UTC
Created attachment 46224 [details]
X log
Comment 3 Andrew Randrianasulu 2011-05-01 09:25:06 UTC
Created attachment 46225 [details]
last 350 lines from /var/log/messages
Comment 4 Andrew Randrianasulu 2011-05-01 09:34:03 UTC
Currently I use zram module, it may interfere with ttm/drm memory management, but for me "Buffer too small for color buffer 0" sounds like buffer in VRAM ... but I can unload it, or disable color tiling/pageflip for testing, if needed. This machine much faster (compared to celeron-400), but I ran this test for first time on it, so I can't say if it was regression or not.
Comment 5 Andrew Randrianasulu 2011-05-01 12:03:48 UTC
Disabling colortiling and/or pageflips has no effect on this bug. Also changing texture mode in 3Dmark itself from default "compressed" to 32-bit does nothing.
Comment 6 Andrew Randrianasulu 2011-05-02 00:58:53 UTC
Bug still here with 2.6.39-rc5+ (3fd9952)
Comment 7 Andrew Randrianasulu 2011-05-02 19:21:56 UTC
Created attachment 46266 [details]
dmesg from 2.6.39-rc5+ with additional debug in r300.c

I've just added some DRM_ERROR in function r300_packet3_check, like this:

	case PACKET3_3D_DRAW_INDX_2:
		track->vap_vf_cntl = radeon_get_ib_value(p, idx);
		r = r100_cs_track_check(p->rdev, track);
		if (r) {
			DRM_ERROR("Error from packet3_draw_indx_2!\n");
			return r;
		}
		break;

because r100_cs_track_check clearly reported wrong track->cb[i].cpp
Comment 8 Andrew Randrianasulu 2011-05-02 19:54:07 UTC
Created attachment 46268 [details]
stderr log with export RADEON_DEBUG=draw, bz2 compressed
Comment 9 Michel Dänzer 2011-05-03 01:37:50 UTC
Can you print track->num_arrays when this happens? I suspect track->arrays[] may be overflowing and clobbering track->cb[].
Comment 10 Andrew Randrianasulu 2011-05-03 04:08:42 UTC
Created attachment 46284 [details]
more debug in dmesg

I've added DRM_ERROR("[drm] num_arrays, %u\n", track->num_arrays); into r100_cs_track_check(), but it prints just "3"
Comment 11 Andrew Randrianasulu 2011-05-04 12:40:23 UTC
Hm, just tested 2.6.37 - it is free from this bug!
Comment 12 Alex Deucher 2011-05-04 14:20:39 UTC
(In reply to comment #11)
> Hm, just tested 2.6.37 - it is free from this bug!

Can you bisect?
Comment 13 Andrew Randrianasulu 2011-05-05 12:05:16 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Hm, just tested 2.6.37 - it is free from this bug!
> 
> Can you bisect?

Incomplete log:

guest@slax:~/src/linux-bisect$ git bisect log
git bisect start
# good: [3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5] Linux 2.6.37
git bisect good 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5
# bad: [521cb40b0c44418a4fd36dc633f575813d59a43d] Linux 2.6.38
git bisect bad 521cb40b0c44418a4fd36dc633f575813d59a43d
# good: [5943a268002fce97885f2ca08827ff1b0312068c] Merge branch 'timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
git bisect good 5943a268002fce97885f2ca08827ff1b0312068c
# good: [7d209c8110ecd49db46da786437485e8ef67f414] alpha: kill off alpha_do_IRQ
git bisect good 7d209c8110ecd49db46da786437485e8ef67f414
# good: [78d2978874e4e10e97dfd4fd79db45bdc0748550] CRED: Fix kernel panic upon security_file_alloc() failure.
git bisect good 78d2978874e4e10e97dfd4fd79db45bdc0748550
# bad: [c486da34390846b430896a407b47f0cea3a4189c] sysctl: ipv6: use correct net in ipv6_sysctl_rtcache_flush
git bisect bad c486da34390846b430896a407b47f0cea3a4189c
# skip: [68c3d4b26623e92656588061405d9dbdf97c0706] Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging
git bisect skip 68c3d4b26623e92656588061405d9dbdf97c0706

[skip because X was unstartable with this kernel - hang]
Comment 14 Andrew Randrianasulu 2011-05-06 03:48:44 UTC
guest@slax:~/src/linux-bisect$ git bisect bad
501834349e872ed4115eea3beef65ca9eeb5528e is the first bad commit
commit 501834349e872ed4115eea3beef65ca9eeb5528e
Author: Marek OlЕЎГЎk <maraeo@gmail.com>
Date:   Mon Feb 14 01:01:09 2011 +0100

    drm/radeon/kms: fix tracking of BLENDCNTL, COLOR_CHANNEL_MASK, and GB_Z on r300

    Also move ZB_DEPTHCLEARVALUE to the list of safe regs.

    Signed-off-by: Marek OlЕЎГЎk <maraeo@gmail.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

:040000 040000 63bb0565c7887abb72f93967caea0606d028df09 c3a86a556f8c4ee1313bdc12e1f86cb44bacb742 M     drivers
Comment 15 Marek Olšák 2011-05-14 19:07:14 UTC
Andrew,

could you please make an OpenGL trace file using apitrace?

Get it here:
https://github.com/apitrace/apitrace

Compile it using cmake, then run something like:

TRACE_FILE=/home/..user../3dmark.trace LD_PRELOAD=/path-to-apitrace/glxtrace.so ./executable

where executable is 3Dmark2001SE. Then send the 3dmark.trace file to me.

That will capture all the 3D commands and I can replay it here.
Comment 16 Andrew Randrianasulu 2011-05-16 19:28:03 UTC
(In reply to comment #15)
> Andrew,
> 
> could you please make an OpenGL trace file using apitrace?
> 
> Get it here:
> https://github.com/apitrace/apitrace
> 
> Compile it using cmake, then run something like:
> 
> TRACE_FILE=/home/..user../3dmark.trace LD_PRELOAD=/path-to-apitrace/glxtrace.so
> ./executable
> 
> where executable is 3Dmark2001SE. Then send the 3dmark.trace file to me.
> 
> That will capture all the 3D commands and I can replay it here.

file is 37M big (bz2 compressed)
Comment 17 Andrew Randrianasulu 2011-05-16 20:23:42 UTC
(In reply to comment #16)
> (In reply to comment #15)
> > Andrew,
> > 
> > could you please make an OpenGL trace file using apitrace?
> > 
> > Get it here:
> > https://github.com/apitrace/apitrace
> > 
> > Compile it using cmake, then run something like:
> > 
> > TRACE_FILE=/home/..user../3dmark.trace LD_PRELOAD=/path-to-apitrace/glxtrace.so
> > ./executable
> > 
> > where executable is 3Dmark2001SE. Then send the 3dmark.trace file to me.
> > 
> > That will capture all the 3D commands and I can replay it here.
> 
> file is 37M big (bz2 compressed)

https://rapidshare.com/files/1581552170/3dmark.trace.gz
Comment 18 Marek Olšák 2011-06-10 07:47:02 UTC
Thanks for the trace.

The fix is here:
http://lists.freedesktop.org/archives/dri-devel/2011-June/011985.html


(In reply to comment #9)
> Can you print track->num_arrays when this happens? I suspect track->arrays[]
> may be overflowing and clobbering track->cb[].

You were right.
Comment 19 Andrew Randrianasulu 2011-06-10 11:17:39 UTC
(In reply to comment #18)
> Thanks for the trace.
> 
> The fix is here:
> http://lists.freedesktop.org/archives/dri-devel/2011-June/011985.html
> 
> 
> (In reply to comment #9)
> > Can you print track->num_arrays when this happens? I suspect track->arrays[]
> > may be overflowing and clobbering track->cb[].
> 
> You were right.

Yes, confired fixed. I'll wait until fix land into mainline (Linus's 2.6 master - actually 3.0.0-rc at the moment .... should one rename all git trees too? Heh.) and hopefully will mark this closed (after re-testing).
Comment 20 Andrew Randrianasulu 2011-06-14 23:31:33 UTC
Fixed in mainline kernel (3.0.0-rc3+)
Comment 21 Florian Mickler 2011-06-30 03:33:05 UTC
A patch referencing this bug report has been merged in Linux v3.0-rc4:

commit a27bb4b209dd6c327fa4e7185f2487f9508a58db
Author: Marek Olšák <maraeo@gmail.com>
Date:   Fri Jun 10 14:41:26 2011 +0000

    drm/radeon/kms: do bounds checking for 3D_LOAD_VBPNTR and bump array limit


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.