radeon: workaround broken vt switch on newer chips

2013-01-06 Thread Stefan Sperling
I have the following radeon chipset in a thinkpad x130e notebook:

[   643.577] (--) RADEON(0): Chipset: AMD Radeon HD 6300 Series Graphics 
(ChipID = 0x9806)

In the driver this is called a PALM generation chip. The radeon driver
contains no UMS code for PALM -- support for it is KMS-only.

I'll describe the symptoms of the problem I'm seeing in some detail
in case someone sees different issues or no problem at all with newer
radeons.

Initially, starting up X results in a perfect display in the proper
resolution (except DRI and XVideo don't work, but that's expected).
A VT switch from X to the console leaves the screen blank (black).
Switching back to X results in a display that's half-shifted out to the right
of the monitor with the shifted-out portion appearing back on the other side.
Switching back to console again will leave the screen blank (black).
Switching back to X now either brings back the previous shifted display,
but this time it wobbles and flickers a lot, or it might leave the display
black, but there's a small bar at the top of the display which flickers.
Repeating this eventually results in a black screen in both X and console.

The patch below disables the code to restore text mode on PALM and above.
This causes the driver to simply blank the display when the user switches
out of X. Switching back to X now works reliably, even though the text
console stays dark once X is started. Furthermore, exiting X and then
blindly typing 'startx' into the invisble console brings back a proper
X display. I can also start xdm, kill it, and it comes back.

I realise this is an awful hack but at least user-facing behaviour
is less broken this way until a proper fix has been devised.

Should I commit this?

Index: src/radeon_driver.c
===
RCS file: /cvs/xenocara/driver/xf86-video-ati/src/radeon_driver.c,v
retrieving revision 1.17
diff -u -p -r1.17 radeon_driver.c
--- src/radeon_driver.c 8 Aug 2012 16:25:22 -   1.17
+++ src/radeon_driver.c 6 Jan 2013 15:19:32 -
@@ -5840,7 +5840,14 @@ static void RADEONRestore(ScrnInfoPtr pS
 
 RADEONBlank(pScrn);
 
-if (IS_DCE4_VARIANT) {
+if (IS_DCE41_VARIANT) {
+   /* 
+* XXX Don't restore text mode. The driver is unable to do so,
+* and furthermore it makes switching back to X is impossible.
+* Requires KMS or equivalent UMS code for proper operation.
+*/
+   return;
+} else if (IS_DCE4_VARIANT) {
RADEONRestoreMemMapRegisters(pScrn, restore);
dce4_restore(pScrn, restore);
//XXX



Re: radeon: workaround broken vt switch on newer chips

2013-01-06 Thread Stefan Sperling
On Sun, Jan 06, 2013 at 04:42:20PM +0100, Stefan Sperling wrote:
 The radeon driver
 contains no UMS code for PALM -- support for it is KMS-only.

Actually, this is not quite true. There is some degree of support for it.
I can use xrandr to switch between resolutions.



Re: [PATCH] awk: initialisation of struct

2013-01-06 Thread Michael W. Bombardieri
On Thu, Jan 03, 2013 at 09:23:50PM -0800, Philip Guenther wrote:
 On Thu, Jan 3, 2013 at 8:48 PM, Michael W. Bombardieri m...@ii.net wrote:
  I am submitting a patch for awk. struct Cell has 7 fields;
  the final field is an optional next pointer.
 ...
  Splint identified that instances of Cell are initialised with only 6
  fields, e.g.
 
  run.c:78:24: Initializer block for falsecell has 6 fields, but Cell has 7
  fields: 2, 12, 0, 0, 0.0, 01
 
 Patches to awk should be sent to the upstream maintainer listed in
 /usr/src/usr.bin/awk/README
 
 (I would tend to defer to that person's opinion on points of C style...)
 

bwk@ got back to me. He will include this style change in awk.

 
 Philip Guenther