[Sandybridge] Attempting to use Xv textured video hangs the system.

Bug #654876 reported by Robert Hooker
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xf86-video-intel
Fix Released
Critical
xserver-xorg-video-intel (Ubuntu)
Fix Released
Medium
Robert Hooker
Maverick
Fix Released
High
Robert Hooker

Bug Description

--- SRU JUSTIFICATION NOTES ---

IMPACT: Sandy Bridge machines (with generation 6 intel GPUs) do not have code in the driver to handle Xv acceleration, but due to the way its coded it advertises that it works and attempts to use a generic GM45 generation code path for it which hangs the system 100% of the time. This confuses gstreamer which does auto detection and every app that plays back video with it will hang the system unless Xv is forcibly disabled.

RESOLUTION: Disable Xv only on this generation of devices by adding an XVideo option to the intel driver that only disables it on generation 6 devices. The option was universally enabled previously.

TEST CASE:
1) Boot ubuntu maverick on a Sandy Bridge machine
2) Launch gstreamer-properties
3) Go to the video tab, under default output press "Test"
4) System hangs without this fix. Switching the output to "X Window System (No Xv)" works correctly.

REGRESSION POTENTIAL: Extremely low, this only changes the behavior for devices that match the IS_GEN6 macro which only contains Sandy Bridge devices.

SRU PATCH PROPOSALS:
https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/654876/+attachment/1699567/+files/xserver-xorg-video-intel_2.12.0-1ubuntu5.1.debdiff

--- ORIGINAL DESCRIPTION ---

Binary package hint: xserver-xorg-video-intel

xserver-xorg-video-intel does not have support for Sandybridge Xv video acceleration, but it advertises support and attempting to use it is causing a system hang. Given that these devices will be released before 11.04 is released, I believe it would be in our best interest to disable Xv for Maverick for a better user experience. The change only affects these specific devices (covered by the IS_GEN6 macro) so the regression potential is extremely low.

Upstream addressed this issue in this commit:
http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=8784c4f5a1524fb979b00c7ce7981cbc1dcf0ec0

author Chris Wilson <email address hidden> 2010-10-01 20:40:36 (GMT)
committer Chris Wilson <email address hidden> 2010-10-01 20:45:15 (GMT)
commit 8784c4f5a1524fb979b00c7ce7981cbc1dcf0ec0
tree d73f10e7631195c2ecb70d87aa7f3ba00da93e09
parent 345c963e443ec325f1ff530512a356ddb318ff70

video: Disable TextureAdaptor for Sandybridge
The acceleration code does not yet exist, so we try to use gen4 shaders
which hangs the chip and makes everybody upset. Disable it until such a
time as support is written for Sandybridge XVideo.

Reported-by: Matthias Hopf <email address hidden>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30500
Signed-off-by: Chris Wilson <email address hidden>

Patch will follow soon and has been tested by me on 2 sandybridge machines to verify that desktop applications that autodetect Xv support no longer crash the system (cheese, totem visualizations, rhythmbox visualizer).

Revision history for this message
In , Mhopf-suse (mhopf-suse) wrote :

Created an attachment (id=39070)
Disable XVideo on SandyBridge by default

We will be using this patch until XVideo is working fine on SandyBridge.
It re-adds the XVideo option (why had it been removed in the first place?) and defaults to Enable on all platforms but SandyBridge.

Please consider this for the next release :-)

Revision history for this message
In , Chris Wilson (ickle) wrote :

In the short-term there is nothing we can do but to disable XVideo on Sandybridge -- the shaders have not yet been written. :(

commit 8784c4f5a1524fb979b00c7ce7981cbc1dcf0ec0
Author: Chris Wilson <email address hidden>
Date: Fri Oct 1 21:40:36 2010 +0100

    video: Disable TextureAdaptor for Sandybridge

    The acceleration code does not yet exist, so we try to use gen4 shaders
    which hangs the chip and makes everybody upset. Disable it until such a
    time as support is written for Sandybridge XVideo.

    Reported-by: Matthias Hopf <email address hidden>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30500
    Signed-off-by: Chris Wilson <email address hidden>

Revision history for this message
In , Robert Hooker (sarvatt) wrote :

(In reply to comment #2)
> In the short-term there is nothing we can do but to disable XVideo on
> Sandybridge -- the shaders have not yet been written. :(
>
> commit 8784c4f5a1524fb979b00c7ce7981cbc1dcf0ec0
> Author: Chris Wilson <email address hidden>
> Date: Fri Oct 1 21:40:36 2010 +0100
>
> video: Disable TextureAdaptor for Sandybridge
>
> The acceleration code does not yet exist, so we try to use gen4 shaders
> which hangs the chip and makes everybody upset. Disable it until such a
> time as support is written for Sandybridge XVideo.
>
> Reported-by: Matthias Hopf <email address hidden>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30500
> Signed-off-by: Chris Wilson <email address hidden>

I don't think this commit is actually working? gstreamer still tries to use Xv and is hanging. The patch attached to this bug works.

X-Video Extension version 2.2
screen #0
  Adaptor #0: "Intel(R) Textured Video"
    number of ports: 16
    port base: 81
    operations supported: PutImage
    supported visuals:
      depth 24, visualID 0x21
    number of attributes: 3
      "XV_BRIGHTNESS" (range -128 to 127)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_CONTRAST" (range 0 to 255)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_SYNC_TO_VBLANK" (range -1 to 1)
              client settable attribute
              client gettable attribute (current value is 1)
    maximum XvImage size: 2048 x 2048
    Number of image formats: 5
      id: 0x32595559 (YUY2)
        guid: 59555932-0000-0010-8000-00aa00389b71
        bits per pixel: 16
        number of planes: 1
        type: YUV (packed)
      id: 0x32315659 (YV12)
        guid: 59563132-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)
      id: 0x30323449 (I420)
        guid: 49343230-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)
      id: 0x59565955 (UYVY)
        guid: 55595659-0000-0010-8000-00aa00389b71
        bits per pixel: 16
        number of planes: 1
        type: YUV (packed)
      id: 0x434d5658 (XVMC)
        guid: 58564d43-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)

Revision history for this message
In , Robert Hooker (sarvatt) wrote :

Created an attachment (id=39160)
Xorg.0.log

Xorg.0.log from an xf86-video-intel git checkout from 455f2939a661764 on a sandybridge-m GT2 device.

Revision history for this message
In , Robert Hooker (sarvatt) wrote :

After the sandybridge shadow changes it is working.

[ 75.441] (WW) intel(0): Disabling Xv because no adaptors could be initialized.

Revision history for this message
Robert Hooker (sarvatt) wrote :

Binary package hint: xserver-xorg-video-intel

xserver-xorg-video-intel does not have support for Sandybridge Xv video acceleration, but it advertises support and attempting to use it is causing a system hang. Given that these devices will be released before 11.04 is released, I believe it would be in our best interest to disable Xv for Maverick for a better user experience. The change only affects these specific devices (covered by the IS_GEN6 macro) so the regression potential is extremely low.

Upstream addressed this issue in this commit:
http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/commit/?id=8784c4f5a1524fb979b00c7ce7981cbc1dcf0ec0

author Chris Wilson <email address hidden> 2010-10-01 20:40:36 (GMT)
committer Chris Wilson <email address hidden> 2010-10-01 20:45:15 (GMT)
commit 8784c4f5a1524fb979b00c7ce7981cbc1dcf0ec0
tree d73f10e7631195c2ecb70d87aa7f3ba00da93e09
parent 345c963e443ec325f1ff530512a356ddb318ff70

video: Disable TextureAdaptor for Sandybridge
The acceleration code does not yet exist, so we try to use gen4 shaders
which hangs the chip and makes everybody upset. Disable it until such a
time as support is written for Sandybridge XVideo.

Reported-by: Matthias Hopf <email address hidden>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=30500
Signed-off-by: Chris Wilson <email address hidden>

Patch will follow soon and has been tested by me on 2 sandybridge machines to verify that desktop applications that autodetect Xv support no longer crash the system (cheese, totem visualizations, rhythmbox visualizer).

Revision history for this message
In , Sndirsch-suse (sndirsch-suse) wrote :

(In reply to comment #5)
> After the sandybridge shadow changes it is working.
>
> [ 75.441] (WW) intel(0): Disabling Xv because no adaptors could be
> initialized.

--- a/src/intel_video.c
+++ b/src/intel_video.c
@@ -363,7 +363,7 @@ void I830InitVideo(ScreenPtr screen)
         * supported hardware.
         */
        if (scrn->bitsPerPixel >= 16 &&
- (IS_I9XX(intel) || IS_I965G(intel)) &&
+ (IS_I9XX(intel) || (IS_I965G(intel) && !IS_GEN6(intel))) &&
            !intel->use_shadow) {
                texturedAdaptor = I830SetupImageVideoTextured(screen);
                if (texturedAdaptor != NULL) {

The reason is that && has a higher precedence than || in C. I guess we want
to fix commit 8784c4f5a1524fb979b00c7ce7981cbc1dcf0ec0 instead. ;-)

Revision history for this message
In , Idr (idr) wrote :

Using [SNB] as the tag for bugs specific to Sandybridge hardware.

Revision history for this message
In , Sndirsch-suse (sndirsch-suse) wrote :

I didn't read the code carefully. The issue is not the operator precedence, but
the problem is that IS_965G(...) is already part of IS_9XX(...). I'm going to attach a fix.

Revision history for this message
In , Sndirsch-suse (sndirsch-suse) wrote :

Created an attachment (id=39201)
xf86-video-intel-fix-8784c4f.diff

fix for commit #8784c4f

Changed in xserver-xorg-video-intel:
importance: Unknown → Critical
status: Unknown → Confirmed
Robert Hooker (sarvatt)
Changed in xserver-xorg-video-intel (Ubuntu):
assignee: nobody → Robert Hooker (sarvatt)
importance: Undecided → Medium
milestone: none → maverick-updates
status: New → Fix Committed
Robert Hooker (sarvatt)
tags: added: maverick
tags: added: patch
Revision history for this message
Robert Hooker (sarvatt) wrote :

Package available in this PPA which has been extensively tested on 2 sandybridge machines and a 945 GME to confirm it does fix the problem and does not regress non-sandybridge.

https://edge.launchpad.net/~sarvatt/+archive/sru3

Bryce Harrington (bryce)
Changed in xserver-xorg-video-intel (Ubuntu Maverick):
assignee: nobody → Robert Hooker (sarvatt)
importance: Undecided → High
status: New → In Progress
Robert Hooker (sarvatt)
description: updated
description: updated
Revision history for this message
Robert Hooker (sarvatt) wrote :

Sorry about that, there was a problem in the previous debdiff, new one attached.

description: updated
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted xserver-xorg-video-intel into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in xserver-xorg-video-intel (Ubuntu Maverick):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Chris Van Hoof (vanhoof) wrote :

Verified this on a default 10.10 install + all updates on a sandybridge based machine. Prior to this fix, any use of Xv would lock the desktop environment up. Using 2:2.12.0-1ubuntu5.1 from -proposed, I'm now able to render video with applications like totem, and rhythmbox successfully

--chris

tags: added: verification-done
removed: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Do we also have a non-Sandybridge i830 based chipset for testing anywhere, so that we can confirm that Xv still works on those?

Revision history for this message
Kent Baxley (kentb) wrote :

I'm using the following Intel graphics with Xv and the 2:2.12.0-1ubuntu5.1 version of the package and have not seen any issues with applications such as Cheese and Totem in full screen mode:

00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller [8086:2a42] (rev 07) (prog-if 00 [VGA controller])

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xserver-xorg-video-intel - 2:2.12.0-1ubuntu5.1

---------------
xserver-xorg-video-intel (2:2.12.0-1ubuntu5.1) maverick-proposed; urgency=low

  * debian/patches/108_sandybridge_disable_Xv.patch: Disable Xv code
    on sandybridge generation GPU's only, support does not exist in
    this driver release and it attempts to use an old code path that
    causes a GPU hang every time it is used. (LP: #654876)
 -- Robert Hooker <email address hidden> Thu, 07 Oct 2010 13:04:33 -0400

Changed in xserver-xorg-video-intel (Ubuntu Maverick):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Robert, is this fixed in the natty version? If so, please close the task. Thanks!

Robert Hooker (sarvatt)
Changed in xserver-xorg-video-intel (Ubuntu):
status: Fix Committed → Fix Released
Changed in xserver-xorg-video-intel:
importance: Critical → Unknown
status: Confirmed → Fix Released
Changed in xserver-xorg-video-intel:
importance: Unknown → Critical
Chris Van Hoof (vanhoof)
tags: added: hwe-blocker
tags: added: testcase
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.