Bug 23775 - pitch too high for CL5446 at 1360x768
Summary: pitch too high for CL5446 at 1360x768
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/cirrus (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard: 2011BRB_Reviewed
Keywords: patch
: 21070 (view as bug list)
Depends on:
Reported: 2009-09-07 07:45 UTC by Stefan Potyra
Modified: 2011-10-20 14:50 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

patch against alp_driver.c to add a check for pitch values (889 bytes, patch)
2009-09-07 07:45 UTC, Stefan Potyra
no flags Details | Splinter Review
limit the maximum pitch on the GD5446 to 4088 (1.23 KB, patch)
2011-10-20 11:52 UTC, Stefan Potyra
no flags Details | Splinter Review

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


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.

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 

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.