Bug 23775

Summary: pitch too high for CL5446 at 1360x768
Product: xorg Reporter: Stefan Potyra <sistpoty>
Component: Driver/cirrusAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: fhimpe, jeremyhu
Version: unspecifiedKeywords: patch
Hardware: Other   
OS: All   
URL: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-cirrus/+bug/424354
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:
Attachments:
Description Flags
patch against alp_driver.c to add a check for pitch values
none
limit the maximum pitch on the GD5446 to 4088 none

Description Stefan Potyra 2009-09-07 07:45:19 UTC
Created attachment 29308 [details] [review]
patch against alp_driver.c to add a check for pitch values

Hi,

as seen testing Ubuntu 9.10 Alpha 5:
the GD 5446 uses 9 bits to store the pitch value, which then get shifted by 3 bits to the left in the graphic card. For the resolution of 1360x768 however, X sets the pitch to 1408, which hence results to an actual used pitch by the card of 128. As a result the screen is garbled.

While I don't have the real hardware to test it (a GD 5446 with 4 Mb is somewhat rare), FAUmachine simulates exactly this graphic card.

I've tested the attached patch using the current xserver-xorg from Ubuntu 9.10, and it works within FAUmachine.

Cheers,
   Stefan.
Comment 1 Jeremy Huddleston Sequoia 2011-10-17 01:28:35 UTC
It looks like the 2048 you set initially is never read. It's better to just not 
initialize it there (or initialize it to the defualt value and don't set it in 
default:).

Can you send the updated patch to xorg-devel for review?
Comment 2 Jeremy Huddleston Sequoia 2011-10-17 01:31:36 UTC
*** Bug 21070 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Potyra 2011-10-20 11:52:37 UTC
Created attachment 52605 [details] [review]
limit the maximum pitch on the GD5446 to 4088

Reworked patch. Thanks for the review!
Comment 4 Jeremy Huddleston Sequoia 2011-10-20 12:22:17 UTC
The GD5436 is similar.  Is this needed for the GD5436 as well?
Comment 5 Stefan Potyra 2011-10-20 12:37:15 UTC
Indeed, looking at the Cirrus Logic - Alpine Family - CL-GD543X/'4X - Technical Reference Manual, it looks as it is applicable for the GD5436 as well. Sadly, I have no means to test it there.
Comment 6 Jeremy Huddleston Sequoia 2011-10-20 14:50:38 UTC
commit f5a8080f149a2f2658b7773ae7db7c67c52c4199
Author: Stefan Potyra <sistpoty@ubuntu.com>
Date:   Thu Oct 20 14:44:44 2011 -0700

    Limit the maximul pitch of GD5436 and GD5446
    
    Limit the maximum supported pitch of the GD5446 to 4088, since the internal
    pitch register is only 9 bit (and contains the pitch left shifted by 3).
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=23775
    
    Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>

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.