Bug 13732 - [i965 TTM] 32-bit app on 64-bit OS aborts
Summary: [i965 TTM] 32-bit app on 64-bit OS aborts
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: high critical
Assignee: haihao
QA Contact:
URL:
Whiteboard:
Keywords:
: 13640 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-12-19 01:12 UTC by Shuang He
Modified: 2008-10-12 19:07 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:


Attachments
xorg conf (3.82 KB, text/plain)
2007-12-19 01:17 UTC, Shuang He
Details
xorg log (26.34 KB, text/plain)
2007-12-19 01:19 UTC, Shuang He
Details
a 32 bit ioctl compatibility routine to handle execbuffer (2.87 KB, patch)
2007-12-21 00:31 UTC, haihao
Details | Splinter Review

Description Shuang He 2007-12-19 01:12:01 UTC
System Environment:
--------------------------
--Platform: FC6
--Xf86_video_intel:5cbb4110116f6d4187fd27660a78203caa1da46b

--Mesa:ffee86f69711e96c5a9ae68376aaf8a044c73dc8  
--DRM:2db6400396ea5c8a5ce54fe9e211b9d01a11d506
--Kernel:2.6.22

Bug detailed description:
--------------------------
with DRI enabled
running 32-bit glxgears on 64-bit OS will get abort with:
DRM_I830_EXECBUFFER: -14

Reproduce steps:
----------------
start X
run 32-bit glxgears


Current result:
----------------
glxgears abort with "DRM_I830_EXECBUFFER: -14"

Expected result:
----------------
glxgears runs normally
Comment 1 Shuang He 2007-12-19 01:17:16 UTC
Created attachment 13211 [details]
xorg conf
Comment 2 Shuang He 2007-12-19 01:19:27 UTC
Created attachment 13212 [details]
xorg log
Comment 3 Colin.Joe 2007-12-19 18:35:55 UTC
I have tested quake 3  & doom 3 on i965 (compatibility) , and I found the some problem ,abort with "DRM_I830_EXECBUFFER: -14" or abort with "DRM_I830_EXECBUFFER: -16".

Comment 4 WuNian 2007-12-20 01:21:54 UTC
Seems to run any 32 bit 3D app on 64 bit system will result in this bug.
After 32 bit app exit with message: "DRM_I830_EXECBUFFER: -14", then run 64 bit's glxgears, glxgears also abort with same message.  If we reboot machine, then run 64 bit glxgears, it also abort. We need boot machine after shutdown machine for a while, then run 64 bit glxgears, glxgears just can run normally.
Comment 5 haihao 2007-12-21 00:31:56 UTC
Created attachment 13272 [details] [review]
a 32 bit ioctl compatibility routine to handle execbuffer

The root cause is the field 'cliprects' of drm_i915_batchbuffer is a pointer and drm_i915_exechbuffer includes drm_i915_batchbuffer field. So DRM must take account  for this pointer under compatibility mode. There are two methods to fix this issue
1. redefine cliprects as 'uint64_t'. 
2. provide a 32-bit ioctl compatibility routine to handle execbuffer.

I prefer 2 because I'm afraid 1 impacts Mesa or others.
Comment 6 haihao 2007-12-21 00:40:03 UTC
Hi, eric
   Could you review this patch?
Comment 7 Eric Anholt 2007-12-21 13:34:12 UTC
+ struct _drm_i915_batchbuffer batch;

Don't you mean struct _drm_i915_batchbuffer32?

-struct drm_i915_execbuffer {
+typedef struct drm_i915_execbuffer {

We're not typedeffing this stuff any more.  Please use struct drm_i915_execbuffer.
Comment 8 Michael Fu 2007-12-24 16:47:38 UTC
*** Bug 13640 has been marked as a duplicate of this bug. ***
Comment 9 Michael Fu 2007-12-24 16:48:56 UTC
*** Bug 13615 has been marked as a duplicate of this bug. ***
Comment 10 haihao 2007-12-25 00:58:18 UTC
(In reply to comment #7)
> + struct _drm_i915_batchbuffer batch;
> 
> Don't you mean struct _drm_i915_batchbuffer32?
> 
> -struct drm_i915_execbuffer {
> +typedef struct drm_i915_execbuffer {
> 
> We're not typedeffing this stuff any more.  Please use struct
> drm_i915_execbuffer.

Thanks. I will correct it.

> 

Comment 11 haihao 2007-12-25 00:59:42 UTC
fix in drm (5d8d64ad3881c10bc3cd3fd5cab1ac14268da5ce)
Comment 12 Shuang He 2007-12-25 19:33:12 UTC
after update drm, glxgears abort after about 0.4 second with following output:

[root@x-g965 shuang]# ./glxgears
libGL warning: 3D driver claims to not support visual 0x21
libGL warning: 3D driver claims to not support visual 0x21
libGL warning: 3D driver claims to not support visual 0x21
libGL warning: 3D driver claims to not support visual 0x21
libGL warning: 3D driver claims to not support visual 0x21
libGL warning: 3D driver claims to not support visual 0x21
libGL warning: 3D driver claims to not support visual 0x22
libGL warning: 3D driver claims to not support visual 0x22
libGL warning: 3D driver claims to not support visual 0x22
libGL warning: 3D driver claims to not support visual 0x22
libGL warning: 3D driver claims to not support visual 0x22
libGL warning: 3D driver claims to not support visual 0x22
libGL warning: 3D driver claims to not support visual 0x21
libGL warning: 3D driver claims to not support visual 0x22
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
drmFenceUnreference failed (fence buffers): Invalid argument
intel_bufmgr_ttm.c:618: Error -22 waiting for fence fence buffers.
Aborted
Comment 13 Shuang He 2007-12-25 19:34:07 UTC
and with INTEL_NO_TTM set, glxgears can run smoothly
Comment 14 haihao 2007-12-26 01:13:40 UTC
fixed in drm b9417f41418321d5081547a3a3386dcccae7541f
Comment 15 Shuang He 2008-10-12 19:07:27 UTC
verified 


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.