Bug 62343

Summary: Incorrect image in vlc if non-default crop factor is selected (XVideo).
Product: xorg Reporter: Roman Elshin <roman.elshin>
Component: Driver/intelAssignee: Chris Wilson <chris>
Status: RESOLVED FIXED QA Contact: Intel GFX Bugs mailing list <intel-gfx-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Xorg log
none
vlc screenshot none

Description Roman Elshin 2013-03-14 15:51:48 UTC
Created attachment 76531 [details]
Xorg log

It work right if OpenGL GLX video out is used by vlc.
Comment 1 Roman Elshin 2013-03-14 15:55:22 UTC
Created attachment 76532 [details]
vlc screenshot
Comment 2 Chris Wilson 2013-03-14 16:23:25 UTC
"non-default crop factor is selected" and how does one do that?
Comment 3 Roman Elshin 2013-03-14 16:59:05 UTC
vlc has submenu "crop" in "video" menu that allow to select between default, 16:10,16:9..., selection any other than default giving incorrect result
Comment 4 Chris Wilson 2013-03-14 22:05:05 UTC
Thanks, I was little disturbed because I thought I had fixed it for 2.21.4. As it turns out the fix was missing a vital little cast to avoid an integer division:

commit 94cb10c3f2b9bbb6ae3c76faebe9fc88691224a9
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Mar 14 22:02:09 2013 +0000

    sna/gen5+: Add missing float casts in computation of scaled src offsets
    
    Without the casts, the division ends up as 0 rather than the fractional
    offset into the texture.
    
    The casts were missed in the claimed fix:
    
    commit 89038ddb96aabc4bc1f04402b2aca0ce546e8bf3
    Author: Chris Wilson <chris@chris-wilson.co.uk>
    Date:   Thu Feb 28 14:35:54 2013 +0000
    
        sna/video: Correct scaling of source offsets
    
    Reported-by: Roman Elshin <roman.elshin@gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=62343
    Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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.