Bug 22474

Summary: patch: GPU hangs playing movie in portrait mode
Product: xorg Reporter: Barry Scott <barry.scott>
Component: Driver/intelAssignee: Gordon Jin <gordon.jin>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: cworth, eric, haihao.xiang, Lukasz.Kurylo, zhenyu.z.wang
Version: gitKeywords: NEEDINFO
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
Patch that fixes XVPutImage in portrait mode
none
Patch with scanline clipping. none

Description Barry Scott 2009-06-25 06:49:44 UTC
When the screen is rotated the calculation of scan lines for
MI_LOAD_SCAN_LINES_INCL must apply the f_framebuffer_to_crtc
transformation. Otherwise the GPU will hang waiting for a line
that is not valid.

Testing in all four rotations.

The patch assumes that the scan lines returned from the transformation
are always valid for the crtc.

This patch has only been tested on a single head configuration.
Comment 1 Gordon Jin 2009-06-25 18:53:22 UTC
patch?
Comment 2 Barry Scott 2009-06-26 02:24:04 UTC
Created attachment 27155 [details] [review]
Patch that fixes XVPutImage in portrait mode

Opss, here is the patch
Comment 3 Gordon Jin 2009-06-26 02:41:58 UTC
anyone CCed could review/commit?
Comment 4 Wang Zhenyu 2009-06-29 22:44:01 UTC
Looks fine with me. Barry, please send patch to intel-gfx@lists.freedesktop.org for other people to review. 
Comment 5 Lukasz Kurylo 2009-06-30 00:03:41 UTC
He already did. But unfortunately this doesn't work in dualhead configuration. Even after I've added clipping to scanline calculations it crashes. 
Comment 6 Lukasz Kurylo 2009-06-30 00:11:12 UTC
Created attachment 27250 [details] [review]
Patch with scanline clipping.
Comment 7 Barry Scott 2009-07-01 04:23:20 UTC
All my patches where sent to the intel-gfx list and got no replies except for
 Lukasz's on dualhead issues.

Do you need me to resend?
Comment 8 Ian Romanick 2009-07-02 13:48:47 UTC
(In reply to comment #5)
> He already did. But unfortunately this doesn't work in dualhead configuration.
> Even after I've added clipping to scanline calculations it crashes. 

Does his patch make things worse for dualhead?  Is there a backtrace for the crash, or is it a GPU crash?

If it doesn't make things worse, I'm inclined to commit it as-is.
Comment 9 Lukasz Kurylo 2009-07-03 00:03:41 UTC
It does NOT make thing worse, just doesn't fix crash for dualhead.
Comment 10 Eric Anholt 2009-07-15 16:49:45 UTC
commit b74bf3f9a65af9e72921d4e9028d9d4d023f8bc6
Author: Barry Scott <barry.scott@onelan.co.uk>
Date:   Mon Jul 13 16:34:20 2009 -0700

    Fix XV scan line calculation when rotated.

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.