Bug 47827 - Can't play video on i830 with Xv
Summary: Can't play video on i830 with Xv
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Daniel Vetter
QA Contact:
URL:
Whiteboard:
Keywords:
: 50888 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-03-24 19:29 UTC by Kurt Roeckx
Modified: 2017-07-24 23:02 UTC (History)
6 users (show)

See Also:
i915 platform:
i915 features:


Attachments
dmesg (53.80 KB, text/plain)
2012-06-13 15:59 UTC, Kurt Roeckx
no flags Details
Xorg log (25.52 KB, text/plain)
2012-06-13 16:01 UTC, Kurt Roeckx
no flags Details
fix overlay on i830M (2.79 KB, patch)
2012-10-22 10:44 UTC, Daniel Vetter
no flags Details | Splinter Review

Description Kurt Roeckx 2012-03-24 19:29:14 UTC
When I try to play a video on an i830 I get a blank screen.

mplayer (with -v) tells me:
X11 error: BadAlloc (insufficient resources for operation)
Type: 0, display: 0x9ba2e18, resourceid: 4a, serial: 9f
Error code: b, request code: 84, minor code: 13

Which comes from this code in mplayer:
static int x11_errorhandler(Display * display, XErrorEvent * event)
{
#define MSGLEN 60
    char msg[MSGLEN];

    XGetErrorText(display, event->error_code, (char *) &msg, MSGLEN);

    mp_msg(MSGT_VO, MSGL_ERR, "X11 error: %s\n", msg);

    mp_msg(MSGT_VO, MSGL_V,
           "Type: %x, display: %p, resourceid: %lx, serial: %lx\n",
           event->type, event->display, event->resourceid, event->serial);
    mp_msg(MSGT_VO, MSGL_V,
           "Error code: %x, request code: %x, minor code: %x\n",
           event->error_code, event->request_code, event->minor_code);

//    abort();
    //exit_player("X11 error");
    return 0;
#undef MSGLEN
}

I've tried looking where this BadAlloc could come from, but don't see anything in libxv or other places that generate it.  So I have to think it's the server that generates it or something.

Trying to look up the request code (0x84, 132), I can't find that code, I only see up to 119, 127.

Anyway, I have no idea where the problem could be.

Using something other to play the movie like x11 or gl works, but it too slow to be usable.

This used to work without problems.


Kurt
Comment 1 Chris Wilson 2012-06-12 03:41:20 UTC
It's more than likely a hung GPU... But lets first have a look at your Xorg.log and dmesg to check that we have the right drivers and are trying to do the right things.
Comment 2 Kurt Roeckx 2012-06-13 15:59:30 UTC
Created attachment 62993 [details]
dmesg
Comment 3 Kurt Roeckx 2012-06-13 16:01:15 UTC
Created attachment 62994 [details]
Xorg log
Comment 4 Kurt Roeckx 2012-06-13 16:14:05 UTC
(In reply to comment #1)
> It's more than likely a hung GPU... But lets first have a look at your Xorg.log
> and dmesg to check that we have the right drivers and are trying to do the
> right things.

The GPU isn't hung, at least not completely.  The window that is supposed to have the video in it just is blue.

However if I try it 2 or 3 times, the GPU does seem to hang itself up after a few seconds and I need to power cycle it.

The dmesg and Xorg.log files are from before playing any video, but nothing got added after trying to play anything.


Kurt
Comment 5 Chris Wilson 2012-06-15 04:25:46 UTC
Hmm, I wonder...

Can you please clone xf86-video-intel.git and ./configure with --enable-sna --enable-debug=full (it will be slow!) and attach the Xorg.0.log for when you try to play the video?
Comment 6 Kurt Roeckx 2012-06-17 14:30:15 UTC
(In reply to comment #5)
> Hmm, I wonder...
> 
> Can you please clone xf86-video-intel.git and ./configure with --enable-sna
> --enable-debug=full (it will be slow!) and attach the Xorg.0.log for when you
> try to play the video?

That seems to have no effect at all, nothing changed in the log, it doesn't seem slower.  That is using 8695c4c77666cd07eab51efcbc7c4f11c85250fd.
Comment 7 Chris Wilson 2012-06-18 03:41:39 UTC
Sigh. And nowadays you either need Option "AccelMethod" "sna" or ./configure --disable-uxa --enable-sna
Comment 8 Kurt Roeckx 2012-06-20 14:38:21 UTC
(In reply to comment #7)
> Sigh. And nowadays you either need Option "AccelMethod" "sna" or ./configure
> --disable-uxa --enable-sna

I already added the option, which only results in the log file showing that that option is on.
Comment 9 Chris Wilson 2012-10-20 16:52:06 UTC
The overlay code between all gen2 is the same in the Xserver, and the limitations shared between 830 and 845. I know 845 works, and I know Daniel has an 830 he can test...
Comment 10 Chris Wilson 2012-10-21 20:25:33 UTC
Note:

1.5.12 Clock Gating Disable for Display Register
Address Offset:	06200h–06203h

Bit 3
Ovrunit Clock Gating Disable.
0 = Clock gating controlled by unit enabling logic
1 = Disable clock gating function
DevALM Errata ALM049: Overlay Clock Gating Must be Disabled:  Overlay & L2 Cache clock gating must be disabled in order to prevent device hangs when turning off overlay.SW must turn off Ovrunit clock gating (6200h) and L2 Cache clock gating (C8h).
Comment 11 Chris Wilson 2012-10-22 09:52:40 UTC
*** Bug 50888 has been marked as a duplicate of this bug. ***
Comment 12 Chris Wilson 2012-10-22 09:54:20 UTC
I've a tree with some fixes and experiments for overlay, that I'd like some feedback with:

http://cgit.freedesktop.org/~ickle/linux-2.6/log/?h=xv-overlay

Rhys, I've commented out the BUG_ON() that you were hitting to see if we trigger any others...
Comment 13 Daniel Vetter 2012-10-22 10:44:07 UTC
Created attachment 68911 [details] [review]
fix overlay on i830M

The attached patch fixes overlay hangs on subsequent runs on my i830M. Please test.
Comment 14 Rhys 2012-10-22 20:26:17 UTC
Just tested with the xv-overlay tree. The 1st attempt at XV now works, but the 2nd fails. I get the log below on the netconsole:
[  212.384092] [drm:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed... GPU hung                                 

I'll add in Daniel's patch in my next build
Comment 15 Rhys 2012-10-22 21:17:09 UTC
XV seems to be working reliably with Daniel's patch that doesn't disable the overlay. :-)
Comment 16 Daniel Vetter 2012-10-23 11:03:44 UTC
Fix merged into drm-intel-fixes with cc: stable, should land in relevant stable kernels soon:

commit a9193983f4f292a82a00c72971c17ec0ee8c6c15
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Oct 22 12:55:55 2012 +0200

    drm/i915: fix overlay on i830M


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.