Bug 8845 - XVideo function XvCreateImage error
Summary: XVideo function XvCreateImage error
Status: CLOSED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: git
Hardware: x86 (IA32) Linux (All)
: high minor
Assignee: Eric Anholt
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-31 18:47 UTC by WuNian
Modified: 2007-03-04 04:19 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
source file (6.63 KB, text/plain)
2006-10-31 18:48 UTC, WuNian
no flags Details

Description WuNian 2006-10-31 18:47:56 UTC
I wrote a program which call XvCreateImage function. With the i965 driver, If
the Image's size is more than 2000x2000,  then the function (Line 113 in my
source file) will cause program exit without any prompt. With i915 driver, the
function work without error.
Attachment is the source file.
Comment 1 WuNian 2006-10-31 18:48:26 UTC
Created attachment 7611 [details]
source file
Comment 2 Eric Anholt 2006-11-02 18:51:21 UTC
Yeah, looks like we're exposing limits that are overly large for the memory we
set aside for video.
Comment 3 Eric Anholt 2007-01-11 00:08:03 UTC
Wow, there are a few interesting bugs I found looking at this:

1) we'll always ultimately restrict the image to the overlay sizes (1980x1088
for i915-class) in the current code.
2) our overlay sizes are overly restrictive, as the hardware can do 2048x2048.
3) Above 1920x1088 (1080, but rounded up to a 16-pixel boundary to appease
software), we run into the limits of the bigrequests extension.

I've got fixes for 1) and 2) ready.

3) is the one being hit in particular by this bug.  My plan is to reduce our xv
limits advertised to fit within the bigrequests limit.  Then we can
independently change bigrequests if that's what we decide.
Comment 4 Alan Hourihane 2007-01-11 03:15:50 UTC
I'm not quite sure what config you've setup for your i915 vs i965, because they
can use textured video or hw overlay.

But as Eric says, the current driver (for hw overlay) restricts the size to
1920x1088. But in the case of textured overlay, it doesn't seem to - I think
that's a bug in the textured code.

You should be using XvQueryBestSize() to determine the limits so your app
doesn't crash.

It's true that the hw overlay can support upto 2048x2048, but I've not tested
the code and therefore that's why it's currently limited to 1920x1088.

Additionally, you need to ensure you are using the Option "LinearAlloc" to give
more memory to the overlay allocator. I suggest a value of 8192 which will give
8MB of memory to it.

Eric, why don't you limit the textured overlay size in I830QueryImageAttributes() ??
Comment 5 Alan Hourihane 2007-01-11 03:18:12 UTC
Oh, and allocating 1920x1088 works perfectly well with the LinearAlloc option,
so no need to go messing with bigrequests or reducing xv limits - please.
Comment 6 Alan Hourihane 2007-01-11 05:38:48 UTC
I see the limits are restricted as part of the pEncodings. So not to worry about
that bit.

So anyway, if it's i965 that's causing a crash then it's textured video that has
a problem as hw overlay isn't supported on i965.

Assigning back to you Eric.
Comment 7 Eric Anholt 2007-01-11 11:15:49 UTC
Sorry, Alan, not sure why this would have been assigned to you.  I did fix it,
by setting all of our limits to 1920x1088, which is just under the bigrequests
limit.
Comment 8 WuNian 2007-01-28 17:59:51 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.