Bug 30322 - d3d1x doesn't work on x86-64 with r300g
Summary: d3d1x doesn't work on x86-64 with r300g
Status: RESOLVED WONTFIX
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium blocker
Assignee: Luca Barbieri
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-21 22:18 UTC by Sergey Kondakov
Modified: 2012-09-15 23:35 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
config.log from latest failed build (40.39 KB, text/plain)
2010-09-22 04:06 UTC, Sergey Kondakov
Details
GALLIUM_DRIVER=softpipe strace ./d3d11gears (28.46 KB, application/octet-stream)
2010-09-22 06:43 UTC, Sergey Kondakov
Details
GALLIUM_DRIVER=softpipe strace ./d3d11gears_32 (32.67 KB, application/octet-stream)
2010-09-22 11:40 UTC, Sergey Kondakov
Details
RADEON_DEBUG=all LIBGL_DEBUG=verbose d3d11gears (4.33 KB, application/octet-stream)
2010-09-28 08:08 UTC, Sergey Kondakov
Details

Description Sergey Kondakov 2010-09-21 22:18:15 UTC
mesa: 41ef78c5af9a8b0ac80d9bd5375700a8bd0643f8 (master)

building failes with:
x86_64-pc-linux-gnu-g++ -m32 -c -I. -I../../../../../src/gallium/include -I../../../../../src/gallium/auxiliary -I../../../../../src/gallium/drivers -Iinclude -I../gd3dapi -I../d3dapi -I../w32api -I../d3d1xstutil/include -I../include -I../../../include -I../../../auxiliary -I../../../state_trackers/egl/common -march=k8-sse3 -O2 -mfpmath=sse,387 -frename-registers -ftree-vectorize -floop-interchange -floop-strip-mine -floop-block -ftree-loop-distribution -floop-parallelize-all -Wno-error -pipe -ffast-math -Wall -fvisibility=hidden -fno-strict-aliasing -m32  -fPIC -m32 -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DUSE_XCB -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XCB_DRI2 -DHAVE_LIBUDEV -DHAVE_XEXTPROTO_71 -DDXGI_DRIVER_SEARCH_DIR=\"/usr/lib32/egl\" -DGALLIUM_DXGI_USE_X11 -DGALLIUM_DXGI_USE_DRM src/dxgi_native.cpp -o src/dxgi_native.o
In file included from ../w32api/objbase.h:20:0,
                 from ../d3d1xstutil/include/d3d1xstutil.h:45,
                 from src/dxgi_private.h:34,
                 from src/dxgi_native.cpp:27:
../w32api/rpcndr.h:174:1: warning: ‘_MIDL_STUB_MESSAGE’ has a field ‘_MIDL_STUB_MESSAGE::SavedContextHandles’ whose type uses the anonymous namespace
../w32api/rpcndr.h:470:32: warning: ‘_SCONTEXT_QUEUE’ has a field ‘_SCONTEXT_QUEUE::ArrayOfObjects’ whose type uses the anonymous namespace
src/dxgi_native.cpp: In constructor ‘GalliumDXGIFactory::GalliumDXGIFactory(const native_platform*, void*, void* (*)(void*, HWND__*), void*)’:
src/dxgi_native.cpp:80:141: error: conditional expression between distinct pointer types ‘void* (*)(void*, HWND__*)’ and ‘void* (*)(void*, HWND__*)’ lacks a cast
src/dxgi_native.cpp:80:141: error: invalid conversion from ‘void* (*)(void*, HWND__*)’ to ‘void*’
src/dxgi_native.cpp:80:141: error: invalid conversion from ‘void* (*)(void*, HWND__*)’ to ‘void*’
src/dxgi_native.cpp:80:192: error: invalid conversion from ‘void*’ to ‘void* (*)(void*, HWND__*)’
gmake[5]: *** [src/dxgi_native.o] Error 1
gmake[5]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium/state_trackers/d3d1x/dxgi'
gmake[4]: *** [all] Error 2
gmake[4]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium/state_trackers/d3d1x'
gmake[3]: *** [subdirs] Error 1
gmake[3]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium/state_trackers'
gmake[2]: *** [default] Error 1
gmake[2]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src'
make: *** [default] Error 1

gcc version 4.5.1 (Gentoo 4.5.1 p1.0, pie-0.4.5)
wine version 1.3.3

changing CFLAGS to something safer didn't helped
Comment 1 Sergey Kondakov 2010-09-22 01:50:01 UTC
recent changes has made some effect: commit a0e510320009766faa5ff8c0ed744e87f8095df7 now failes with:

x86_64-pc-linux-gnu-g++ -m32 -c -I. -I../../../../../src/gallium/include -I../../../../../src/gallium/auxiliary -I../../../../../src/gallium/drivers -Id3d10app -Id3d11app -I../gd3dapi  -I../d3dapi -I../w32api -march=k8-sse3 -O2 -pipe -ffast-math -Wall -fvisibility=hidden -fno-strict-aliasing -m32  -fPIC -m32 -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DUSE_XCB -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XCB_DRI2 -DHAVE_LIBUDEV -DHAVE_XEXTPROTO_71  d3d10tri/d3d10tri.cpp -o d3d10tri/d3d10tri.o
In file included from ../w32api/objbase.h:20:0,
                 from d3d10app/d3d10app.h:32,
                 from d3d10tri/d3d10tri.cpp:27:
../w32api/rpcndr.h:174:1: warning: ‘_MIDL_STUB_MESSAGE’ has a field ‘_MIDL_STUB_MESSAGE::SavedContextHandles’ whose type uses the anonymous namespace
../w32api/rpcndr.h:470:32: warning: ‘_SCONTEXT_QUEUE’ has a field ‘_SCONTEXT_QUEUE::ArrayOfObjects’ whose type uses the anonymous namespace
gmake[5]: *** No rule to make target `../../../winsys/sw/wrapper/libwsw.a', needed by `bin/d3d10tri'.  Stop.
gmake[5]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium/state_trackers/d3d1x/progs'
gmake[4]: *** [all] Error 2
gmake[4]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium/state_trackers/d3d1x'
gmake[3]: *** [subdirs] Error 1
gmake[3]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium/state_trackers'
gmake[2]: *** [default] Error 1
gmake[2]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src/gallium'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-libs/mesa-9999-r2/work/32/Mesa-9999/src'
make: *** [default] Error 1

this looks like just building script issue.
Comment 2 Luca Barbieri 2010-09-22 02:40:05 UTC
This should be fixed too, let me know if there are any more issues, or if the demos work.
Comment 3 Sergey Kondakov 2010-09-22 04:04:07 UTC
unfortunately, same error persists after commit feb9c8c510f2deb1267b17bc10a4aff49e482630
failed build was configured with "--prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib32 --with-x --with-x-libraries=/usr/lib32 --enable-32-bit --disable-64-bit --disable-debug --enable-glx-tls --disable-gles1 --disable-gles2 --with-driver=dri --enable-egl --enable-glu --enable-glw --with-egl-platforms=x11,drm --enable-motif --with-x --enable-xcb --with-dri-drivers=,swrast,radeon,r200,r300,r600 --enable-gallium-swrast --with-state-trackers=,glx,egl,d3d1x,dri,vega,xorg --disable-gallium-svga --disable-gallium-i915 --disable-gallium-i965 --enable-gallium-radeon --enable-gallium-r600 --disable-gallium-nouveau --enable-gallium-llvm --without-demos --disable-glut --disable-gallium-llvm" options.

it's building on 64bit host in 32bit version.
Comment 4 Sergey Kondakov 2010-09-22 04:06:45 UTC
Created attachment 38869 [details]
config.log from latest failed build

feb9c8c510f2deb1267b17bc10a4aff49e482630
Comment 5 Luca Barbieri 2010-09-22 04:39:25 UTC
Should be fixed now.
Let me know if the normal build succeeds, if building progs after that succeeds, and if the demos actually work.
Comment 6 Sergey Kondakov 2010-09-22 06:38:56 UTC
normal build (32 and 64 bit) succeeds but 'make' in src/gallium/state_trackers/d3d1x/progs results in:
x86_64-pc-linux-gnu-g++ -c -I. -I../../../../../src/gallium/include -I../../../../../src/gallium/auxiliary -I../../../../../src/gallium/drivers -Id3d10app -Id3d11app -I../gd3dapi  -I../d3dapi -I../w32api -march=k8-sse3 -O2 -pipe -ffast-math -Wall -fvisibility=hidden -fno-strict-aliasing -m64  -fPIC  -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DUSE_XCB -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XCB_DRI2 -DHAVE_LIBUDEV -DHAVE_XEXTPROTO_71 -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS -DHAVE_LLVM=0x0207 -I/usr/include  -DNDEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -fPIC d3d10tri/d3d10tri.cpp -o d3d10tri/d3d10tri.o
In file included from ../w32api/windef.h:252:0,
                 from ../w32api/windows.h:41,
                 from d3d10app/d3d10app.h:31,
                 from d3d10tri/d3d10tri.cpp:27:
../w32api/winnt.h:644:35: warning: attributes ignored on elaborated-type-specifier that is not a forward declaration
In file included from ../w32api/objbase.h:20:0,
                 from d3d10app/d3d10app.h:32,
                 from d3d10tri/d3d10tri.cpp:27:
../w32api/rpcndr.h:174:1: warning: ‘_MIDL_STUB_MESSAGE’ has a field ‘_MIDL_STUB_MESSAGE::SavedContextHandles’ whose type uses the anonymous namespace
../w32api/rpcndr.h:470:32: warning: ‘_SCONTEXT_QUEUE’ has a field ‘_SCONTEXT_QUEUE::ArrayOfObjects’ whose type uses the anonymous namespace
make: *** No rule to make target `../../../winsys/sw/fbdev/libfbdev.a', needed by `bin/d3d10tri'.  Stop.

after doing 'make' in src/gallium/winsys/sw/fbdev i end up with error:
make: *** No rule to make target `../../../../../lib/libEGL.so', needed by `bin/d3d10tri'.  Stop.

since it has "/lib/libEGL.so" written in its Makefile but real path is "/lib64/libEGL.so" for 64bit build.

changing that makes progs to build.

looks like those progs really should be in MesaDemos package and repository just like glxgears, openvg and gles test programs. and binaries - removed.
it'll be cleanlier and also will make building them easier.

about test run: 
all of them segfaulted after writing "libEGL warning: use software fallback" into terminal but maybe i just need to restart X. i will write after that if they will work but this bug probably should be considered FIXED now.
Comment 7 Sergey Kondakov 2010-09-22 06:43:13 UTC
Created attachment 38877 [details]
GALLIUM_DRIVER=softpipe strace ./d3d11gears

strace output
Comment 8 Luca Barbieri 2010-09-22 07:36:59 UTC
The segfault should also be fixed in a further commit.
Do they work now for you?

And yes, they should probably be eventually moved to mesa-demos, but right now that's not a good idea since the state tracker doesn't yet install any library.
Comment 9 Sergey Kondakov 2010-09-22 11:38:56 UTC
any of 64 bit testing binaries segfaults until they even able to form a window, as they were before.
32 bit versions fail too but they manage to form a window and die just before they could draw anything.
Comment 10 Sergey Kondakov 2010-09-22 11:40:27 UTC
Created attachment 38885 [details]
GALLIUM_DRIVER=softpipe strace ./d3d11gears_32

bd6b8107ad551d8c7439102b8e9027abf901b139
Comment 11 Luca Barbieri 2010-09-22 12:03:28 UTC
Thanks for your report.

It looks like you are using the r300 hardware driver, which hasn't yet been tested with d3d1x but would be great to have working.

Could you post a gdb backtrace of the segfault?
Comment 12 Sergey Kondakov 2010-09-22 20:01:20 UTC
tested now :) working demos would be nice though, with all of those "gallium state tracker to driver transparency" and all...

anyway, backtrace from 64 bit version:
[Thread debugging using libthread_db enabled]
libEGL warning: use software fallback

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff66966b8 in _Unwind_SetGR () from /lib/libgcc_s.so.1
(gdb) backtrace
#0  0x00007ffff66966b8 in _Unwind_SetGR () from /lib/libgcc_s.so.1
#1  0x00007ffff6bde287 in __gxx_personality_v0 () from /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/libstdc++.so.6
#2  0x00007ffff669843b in ?? () from /lib/libgcc_s.so.1
#3  0x00007fff00000000 in ?? ()
#4  0xffffffffffffff60 in ?? ()
#5  0x00007fff00000000 in ?? ()
#6  0xffffffffffffff70 in ?? ()
#7  0x00007fff00000000 in ?? ()
#8  0xffffffffffffff80 in ?? ()
#9  0x0000000000000000 in ?? ()

and from 32 bit:
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x080aaed1 in dri2_display_get_configs ()
(gdb) backtrace
#0  0x080aaed1 in dri2_display_get_configs ()
#1  0x0807f69e in GalliumDXGIAdapter::GalliumDXGIAdapter(GalliumDXGIFactory*, native_platform const*, void*) ()
#2  0x0807fb7d in GalliumDXGIFactory::EnumAdapters1(unsigned int, IDXGIAdapter1**) ()
#3  0x080509b4 in D3D11CreateDevice ()
#4  0x08050b22 in D3D11CreateDeviceAndSwapChain ()
#5  0x0804bc9b in main ()

i should probably build mesa/gallium with '-g' and try with newest updates... but i hope this tells you something useful anyway.
Comment 13 Sergey Kondakov 2010-09-25 06:14:58 UTC
with commit 16a457bba6909d0c34036277eb3a56f27f425c3d
64 bit version now draws a window (as 32bit before) and dies with that in gdb:
Program received signal SIGSEGV, Segmentation fault.
GalliumD3D11ScreenImpl<true>::GalliumD3D11ScreenImpl (this=0x71a1d0, screen=0x1, immediate_pipe=0x1, owns_immediate_pipe=7208032, creation_flags=4294955888, adapter=0x0)
    at d3d11_screen.h:90
90      d3d11_screen.h: No such file or directory.
        in d3d11_screen.h
(gdb) bt
#0  GalliumD3D11ScreenImpl<true>::GalliumD3D11ScreenImpl (this=0x71a1d0, screen=0x1, immediate_pipe=0x1, owns_immediate_pipe=7208032, creation_flags=4294955888, 
    adapter=0x0) at d3d11_screen.h:90
#1  0x000000000040b473 in GalliumD3D11DeviceCreate (screen=0x1, context=<value optimized out>, owns_context=7208032, creation_flags=4294955888, adapter=0x0, 
    ppDevice=0x6d5840) at d3d11.cpp:229
#2  0x000000000040a14e in D3D11CreateDevice (adapter=0x6dfc60, driver_type=<value optimized out>, software=<value optimized out>, flags=1, feature_levels=0x0, 
    num_feature_levels=0, sdk_version=7, out_device=0x7fffffffd530, feature_level=0x7fffffffd84c, out_immediate_context=0x7fffffffd520) at dxgid3d11.cpp:77
#3  0x000000000040a492 in D3D11CreateDeviceAndSwapChain (adapter=<value optimized out>, driver_type=<value optimized out>, software=<value optimized out>, 
    flags=<value optimized out>, feature_levels=0x0, num_feature_levels=0, sdk_version=7, pSwapChainDesc=0x7fffffffd7b0, out_swap_chain=0x6cfa38, out_device=0x6cfa40, 
    feature_level=0x7fffffffd84c, out_immediate_context=0x6cfa48) at dxgid3d11.cpp:109
#4  0x00000000004057d8 in main (argc=1, argv=0x7fffffffd958) at d3d11app/d3d11x11main.cpp:63

32bit version now fails with:
r300: Implementation error: Bad param 30
d3d11gears_32: r300_vs.c:113: set_vertex_inputs_outputs: Assertion `0' failed.
zsh: abort      ./d3d11gears_32

and a lot of output in gdb (1190 lines of semirandom numbers)
Comment 14 Sergey Kondakov 2010-09-27 08:11:41 UTC
after last changes commit 58a31758e3b8249b12f0e797034bec235343aa15 fails to build progs with:
x86_64-pc-linux-gnu-g++ -march=k8-sse3 -O2 -ffast-math -mmmx -m3dnow -msse -msse2 -pipe -Wall -fvisibility=hidden -fno-strict-aliasing -m64  -fPIC  -D_GNU_SOURCE -DPTHREADS -DHAVE_POSIX_MEMALIGN -DUSE_XCB -DGLX_USE_TLS -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DGLX_DIRECT_RENDERING -DGLX_INDIRECT_RENDERING -DHAVE_ALIAS -DHAVE_XCB_DRI2 -DHAVE_LIBUDEV -DHAVE_XEXTPROTO_71 -DHAVE_UDIS86 -DGALLIUM_LLVMPIPE -D__STDC_CONSTANT_MACROS -DHAVE_LLVM=0x0207  d3d10app/d3d10x11main.o d3d10tri/d3d10tri.o -o bin/d3d10tri -Wl,--start-group  ../dxgid3d10/libdxgid3d10.a ../gd3d10/libgd3d10.a ../dxgi/libdxgi.a ../gd3d1x/libgd3d1x.a ../d3d1xshader/libd3d1xshader.a ../d3d1xstutil/libd3d1xstutil.a ../../egl/libegl.a ../../../auxiliary/libgallium.a ../../../winsys/sw/wrapper/libwsw.a ../../../winsys/sw/xlib/libws_xlib.a ../../../winsys/sw/dri/libswdri.a ../../../../../lib64/libEGL.so ../../../winsys/sw/fbdev/libfbdev.a ../../../winsys/sw/xlib/libws_xlib.a -Wl,--end-group -ldl -lX11 -lXext -lXfixes
../../egl/libegl.a(x11_screen.o): In function `x11_screen_enable_dri2':
x11_screen.c:(.text+0x400): undefined reference to `drmGetMagic'
collect2: ld returned 1 exit status
make: *** [bin/d3d10tri] Error 1
Comment 15 Sergey Kondakov 2010-09-28 07:53:40 UTC
hurray, with commit e0b93c5bebab8ebd2e387d6031f97c6bc4328dbf 64bit version does not fail anymore! instead, it draws garbage and says:
radeon: The kernel rejected CS, see dmesg for more information.

dmesg says: 
[drm:r100_cs_track_check] *ERROR* [drm] Buffer too small for color buffer 0 (need 16775168 have 1048576) !
[drm:r100_cs_track_check] *ERROR* [drm] color buffer 0 (16382 2 0 512)
[drm:radeon_cs_ioctl] *ERROR* Invalid command stream !

it all repeats infinitely until i kill it.
my kernel is 2.6.35.

32bit version fails the same way as before.

probably, i should test it on r700 hardware which should be actually "dx10&11 capable".
Comment 16 Sergey Kondakov 2010-09-28 08:08:55 UTC
Created attachment 39013 [details]
RADEON_DEBUG=all LIBGL_DEBUG=verbose d3d11gears

repeated output from
RADEON_DEBUG=all LIBGL_DEBUG=verbose d3d11gears
Comment 17 Sergey Kondakov 2010-09-29 01:38:30 UTC
ok, results on r600g are a little more consistent - 32 and 64 versions say the same:
EE r600_state_inlines.h/r600_translate_colorswap:354 - unsupported colorswap format 67
EE r600_state_inlines.h/r600_translate_colorswap:354 - unsupported colorswap format 67
EE r600_state_inlines.h/r600_translate_colorswap:354 - unsupported colorswap format 67
draw common failed -22
draw common failed -22
draw common failed -22

and don't die but still draw same garbage.

in dmesg it's:
[drm:radeon_cs_ioctl] *ERROR* Invalid command stream !
radeon 0000:01:00.0: z/stencil with no depth buffer
radeon 0000:01:00.0: r600_packet3_check:1108 invalid cmd stream 630
Comment 18 Ivan Sukin 2010-10-11 10:46:22 UTC
(In reply to comment #15)
> hurray, with commit e0b93c5bebab8ebd2e387d6031f97c6bc4328dbf 64bit version does
> not fail anymore! instead, it draws garbage and says:
> radeon: The kernel rejected CS, see dmesg for more information.
> 
> dmesg says: 
> [drm:r100_cs_track_check] *ERROR* [drm] Buffer too small for color buffer 0
> (need 16775168 have 1048576) !
> [drm:r100_cs_track_check] *ERROR* [drm] color buffer 0 (16382 2 0 512)
> [drm:radeon_cs_ioctl] *ERROR* Invalid command stream !
> 
> it all repeats infinitely until i kill it.
> my kernel is 2.6.35.
> 
> 32bit version fails the same way as before.
> 
> probably, i should test it on r700 hardware which should be actually "dx10&11
> capable".

I have this bug on r300g.


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.