Bug 310841

Summary: PATCH: fix crash with BadAlloc X-error when using yuv overlay on i810 vga
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: SDLAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.2.13-1.fc8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-22 15:47:17 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 390261    
Attachments:
Description Flags
PATCH: fix crash with BadAlloc X-error when using yuv overlay on i810 vga none

Description Hans de Goede 2007-09-28 13:10:50 UTC
When running boswars: "yum install boswars" on a machine with intel
integrated graphics it crashes when it tries to play the initial theora
splashscreen video:
X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  140 (XVideo)
  Minor opcode of failed request:  19 ()
  Serial number of failed request:  25
  Current serial number in output stream:  26
boswars: xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed.
Aborted

I recognized this problem from a few years back, when I encountered it while
working on the Xv blitter for xmame. The problem is that for some reason
creation the Xvport and XvImage succeeds, and failure (lack of resources / hw
capability?) is only indicated during the first XvPut[Shm]Image. I've written a
patch (attached) for SDL using the work around for this I developed for xmame
(and which is still used successfully in xmame after many years of usage).

I've also reported this upstream:
http://bugzilla.libsdl.org/show_bug.cgi?id=495

Comment 1 Hans de Goede 2007-09-28 13:10:50 UTC
Created attachment 210281 [details]
PATCH: fix crash with BadAlloc X-error when using yuv overlay on i810 vga

Comment 2 Thomas Woerner 2007-10-02 09:16:10 UTC
Do you know if there is a fix planned for the i810 driver? I think it should get
fixed there.

Comment 3 Hans de Goede 2007-10-02 12:49:42 UTC
This has been filed upstream long ago:
https://bugs.freedesktop.org/show_bug.cgi?id=6849

Notice there are other reports like this one. Upstream's reaction is always to add:
Option "LinearAlloc" "<value>"

With value something of 6Mb or more to xorg.conf, this reserves a buffer when
starting X before graphics memory becomes fragmented (I think) and thus works
around this at the cost of memory use.

It might be an idea to add this option to xorg.conf's generated during install,
thereby fixing this for things like playing high ress ogg videos too, but even
then we will still need this workaround for exisiting setup's, as an upgrade
doesn't regenerate xorg.conf.

If you agree this option should be in generated xorg.conf by default (I have my
doubts, why isn't it the default in the driver then?), then I'll file a seperate
bug for that.


Comment 4 Adam Jackson 2007-10-30 17:40:01 UTC
We shouldn't need to bother anymore, afaict.  Textured video is the default now,
which doesn't have this problem.  And at least one major fix to Xv allocation
bugs has been made in our F8 driver.

Comment 5 Hans de Goede 2007-10-30 18:10:39 UTC
Hmm, I developed and tested this patch on a pretty up2date rawhide system, since
when is it the default? And is it the default for all chips or only for newer
models?


Comment 6 Bill Nottingham 2007-10-30 23:54:24 UTC
There have been three different Xv changes to the intel driver since 10/15.

Comment 7 Hans de Goede 2007-10-31 07:46:41 UTC
Bos Wars may be copied only under the terms of the GNU General Public License
which must be distributed with this program.

DISCLAIMER:
This software is provided as-is.  The author(s) can not be held liable for any
damage that might arise from the use of this software.
Use it at your own risk.

X Error of failed request:  BadAlloc (insufficient resources for operation)
  Major opcode of failed request:  140 (XVideo)
  Minor opcode of failed request:  19 ()
  Serial number of failed request:  27
  Current serial number in output stream:  28
boswars: xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed.
Aborted

[hans@localhost ~]$ rpm -q xorg-x11-drv-i810
xorg-x11-drv-i810-2.1.1-7.fc8
[hans@localhost ~]$

---

Note that this i810 bug has been around for atleast 3 years, I first encountered
and worked around it before I joined Fedora, when I was still working on xmame.

It would be great for this bug to fixed at the driver level, but seeing how long
it already exists I don't see this happening.


Comment 8 Fedora Update System 2008-01-11 22:11:15 UTC
SDL-1.2.13-1.fc8 has been pushed to the Fedora 8 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update SDL'

Comment 9 Fedora Update System 2008-01-22 15:47:12 UTC
SDL-1.2.13-1.fc8 has been pushed to the Fedora 8 stable repository.  If problems still persist, please make note of it in this bug report.