Bug 27417 - [xv] corrupt output with textured video for certain width/height like 620x480
Summary: [xv] corrupt output with textured video for certain width/height like 620x480
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Daniel Vetter
QA Contact: Xorg Project Team
Depends on:
Reported: 2010-04-01 13:03 UTC by Sven Arvidsson
Modified: 2010-04-08 11:24 UTC (History)
4 users (show)

See Also:
i915 platform:
i915 features:

screenshot of the bug (251.50 KB, image/png)
2010-04-01 13:03 UTC, Sven Arvidsson
no flags Details
fix chroma pitch on gen4 and later (1.82 KB, patch)
2010-04-08 01:28 UTC, Daniel Vetter
no flags Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Arvidsson 2010-04-01 13:03:06 UTC
Created attachment 34601 [details]
screenshot of the bug

Some H264 videos are completely corrupt when played back using textured video . I'm attaching a screenshot of the bug, and a short video which should be enough to reproduce the problem.

I think this is a regression, I will do some more testing and a bisect if possible.

System environment:
-- chipset: G45 / ICH10R
-- system architecture: 32-bit
-- Linux distribution: Debian unstable
-- Machine or mobo model: Asus P5Q-EM
-- Display connector: DVI
-- xf86-video-intel: 440b4d207b730112169827d0b90b46596659b504
-- xserver:
-- mesa: 7e246e6aa63979d53731a591f4caee3651c1d96b
-- drm: cc20ed8100834b7a5129ed403dee6c0e15d82cd1
-- kernel:
Comment 1 Sven Arvidsson 2010-04-01 13:09:43 UTC
Video which should reproduce the bug:
Comment 2 Sven Arvidsson 2010-04-02 07:32:55 UTC
Did some more testing and this problem only happens for videos with a certain aspect ratio, file type doesn't matter. 

The size of the video in the previous comment is 620 x 480, another video with the same problem is 700 x 576.
Comment 3 Shuang He 2010-04-02 07:38:01 UTC
I can reproduce this issue on G45 just use the video you uploaded
Comment 4 Sven Arvidsson 2010-04-02 09:20:22 UTC
As I suspected, this is a regression from 2.10.0, bisecting lead to this:

cb06aa32d433f54affe87da2cf964f0308d3c258 is the first bad commit
commit cb06aa32d433f54affe87da2cf964f0308d3c258
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Mar 1 22:57:39 2010 +0100

    Xv: fixup XvMC on i915
    I've accidentally broken i915 xvmc due to alignment constrains that
    break my assumption that Y-pitch == UV-pitch*2. Fix this up by consistenly
    using dstPitch2 for the Y-pitch. This also unifies the dst pitch
    computation slightly, now that the i915 xvmc special case is gone.
    Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=25949
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
    (Minor edit to support compilation without INTEL_XVMC defined by
    Carl Worth <cworth@cworth.org>)

:040000 040000 581e91ddb28f783bf765ea1259d4bcab9488ca75 dd733a90fcc54f47d26e811c416fbb61da888899 M	src
Comment 5 Nick Bowler 2010-04-05 05:59:16 UTC
*** Bug 27453 has been marked as a duplicate of this bug. ***
Comment 6 Nick Bowler 2010-04-05 06:00:52 UTC
As mentioned in the duplicate bug, what matters is the *width* of the video.

Reverting the implicated commit resolves the issue.
Comment 7 Daniel Vetter 2010-04-08 01:28:46 UTC
Created attachment 34802 [details] [review]
fix chroma pitch on gen4 and later

Can you please test the attached patch?
Comment 8 Sven Arvidsson 2010-04-08 05:33:52 UTC
The patch works for me, thanks!
Comment 9 Nick Bowler 2010-04-08 06:30:18 UTC
Solves the issue here as well.  Thanks.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct.