# Thinkpad x120e video blackout

## pking

I am trying to get gentoo up and running on a Thinkpad x120e. According to the gentoo wiki (http://en.gentoo-wiki.com/wiki/Lenovo_ThinkPad_x120e) the kernel uses radeon/PALM_me.bin and radeon/PALM_pfp.bin blobs, which I've built into the kernel; I have also set up exactly the kernel settings for video on that page. But what happens is that when the Thinkpad boots up, it gets all the way to loading udev and then the screen suddenly goes black. The computer is still up and running -- I can type blindly into it and reboot -- and, what it more, if I pass grub the "nomodesetting" option the screen blanking does not occur. A search for the problem turned up the gentoo wiki radeon page, which suggests that the problem is "incorrect firmware". Well, okay, but how do I figure out what the correct firmware is? I tried compiling a uvesafb module to load to see whether I could get some information out of dmesg about what the kernel was looking for, but all that did was give me a hard freeze.

This is with kernel 3.2.1-r2, compiled for x86_64 as recommended. No idea what to do next, and I am just about as puzzled by the fact that no one else seems to have reported this problem -- other than elsewhere here in the wiki, which is marked "solved"  by adding radeon/R600_rcl.bin and R700_rcl.bin, which I did to no avail. Any ideas? Am I doomed to a lovely screen with horrible resolution ever after?

----------

## Gusar

Compile radeon as module and you don't need to care which exact firmware your specific card needs.

----------

## pking

Thanks for the suggestion. I already am compiling radeon as a module, which loads on boot; I take it you mean to leave out the "include-in-kernel" option for the firmware? I didn't know that KMS would work without it, given that it has to load things at boot time.

----------

## pking

No luck.

I have radeon as a module; I am not compiling the firmware blobs in the kernel; everything is a module that I can think of -- and the problem still occurs. I can get a bit more exact: the screen goes black right after dmesg says "Processing uevents..."

I do get a message in dmesg, repeated, that says: 

```
[Firmware Bug]: ACPI: No _BQC cannot determine initial brightness
```

but it isn't clear that this is the problem. I have /boot on an ext2 partition and / on an ext4 partition, and I do get warnings about failure to mount / as either ext3 or ext2, before it finds ext4. Otherwise dmesg doesn't offer much of a clue. Perhaps an interaction with the Thinkpad ACPI stuff? Anyone?

----------

## Gusar

The screen goes black when KMS kicks in (when udev loads the radeon module), which makes a lot of sense.

That message indicates issues with the backlight because of buggy acpi. But I've never seen it before so the only advice I can give is: google it. At a quick glance it gives some interesting results there, including instructions on messing with the DSDT.

----------

## Hu

 *pking wrote:*   

> But what happens is that when the Thinkpad boots up, it gets all the way to loading udev and then the screen suddenly goes black. A search for the problem turned up the gentoo wiki radeon page, which suggests that the problem is "incorrect firmware".

 That page is wrong.  Missing firmware would result in a 60 second hang while searching for it.  Incorrect firmware would probably fail to load.  The symptom you report is typical of a kernel that has been built without framebuffer support.  Once KMS activates, you cannot use the low resolution 80x25 text console.  Your choices are the high resolution framebuffer text console or to run an X server.

----------

## pking

Agreed, it's when KMS tries to kick in. But the kernel does have framebuffer support built in, I think; here's a snippet of .config:

CONFIG_VGA_CONSOLE=y

CONFIG_VGACON_SOFT_SCROLLBACK=y

CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64

CONFIG_DUMMY_CONSOLE=y

CONFIG_FRAMEBUFFER_CONSOLE=y

CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y

My understanding is that we are supposed to turn on the framebuffer support but not select any particular driver, and that's what I've tried to do:

CONFIG_VGA_ARB=y

CONFIG_VGA_ARB_MAX_GPUS=16

CONFIG_VGA_SWITCHEROO=y

CONFIG_DRM=y

CONFIG_DRM_KMS_HELPER=y

CONFIG_DRM_TTM=y

# CONFIG_DRM_TDFX is not set

# CONFIG_DRM_R128 is not set

CONFIG_DRM_RADEON=y

CONFIG_DRM_RADEON_KMS=y

# CONFIG_DRM_I810 is not set

# CONFIG_DRM_I915 is not set

# CONFIG_DRM_MGA is not set

# CONFIG_DRM_SIS is not set

# CONFIG_DRM_VIA is not set

# CONFIG_DRM_SAVAGE is not set

# CONFIG_DRM_VMWGFX is not set

# CONFIG_STUB_POULSBO is not set

# CONFIG_VGASTATE is not set

CONFIG_VIDEO_OUTPUT_CONTROL=y

CONFIG_FB=y

CONFIG_FIRMWARE_EDID=y

# CONFIG_FB_DDC is not set

# CONFIG_FB_BOOT_VESA_SUPPORT is not set

CONFIG_FB_CFB_FILLRECT=y

CONFIG_FB_CFB_COPYAREA=y

CONFIG_FB_CFB_IMAGEBLIT=y

# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set

# CONFIG_FB_SYS_FILLRECT is not set

# CONFIG_FB_SYS_COPYAREA is not set

# CONFIG_FB_SYS_IMAGEBLIT is not set

# CONFIG_FB_FOREIGN_ENDIAN is not set

# CONFIG_FB_SYS_FOPS is not set

# CONFIG_FB_WMT_GE_ROPS is not set

# CONFIG_FB_SVGALIB is not set

# CONFIG_FB_MACMODES is not set

# CONFIG_FB_BACKLIGHT is not set

CONFIG_FB_MODE_HELPERS=y

# CONFIG_FB_TILEBLITTING is not set

#

# Frame buffer hardware drivers

#

# CONFIG_FB_CIRRUS is not set

# CONFIG_FB_PM2 is not set

# CONFIG_FB_CYBER2000 is not set

# CONFIG_FB_ARC is not set

# CONFIG_FB_ASILIANT is not set

# CONFIG_FB_IMSTT is not set

# CONFIG_FB_VGA16 is not set

# CONFIG_FB_UVESA is not set

# CONFIG_FB_VESA is not set

# CONFIG_FB_EFI is not set

# CONFIG_FB_N411 is not set

# CONFIG_FB_HGA is not set

# CONFIG_FB_S1D13XXX is not set

# CONFIG_FB_NVIDIA is not set

# CONFIG_FB_RIVA is not set

# CONFIG_FB_LE80578 is not set

# CONFIG_FB_INTEL is not set

# CONFIG_FB_MATROX is not set

# CONFIG_FB_RADEON is not set

# CONFIG_FB_ATY128 is not set

# CONFIG_FB_ATY is not set

# CONFIG_FB_S3 is not set

# CONFIG_FB_SAVAGE is not set

# CONFIG_FB_SIS is not set

# CONFIG_FB_VIA is not set

# CONFIG_FB_NEOMAGIC is not set

# CONFIG_FB_KYRO is not set

# CONFIG_FB_3DFX is not set

# CONFIG_FB_VOODOO1 is not set

# CONFIG_FB_VT8623 is not set

# CONFIG_FB_TRIDENT is not set

# CONFIG_FB_ARK is not set

# CONFIG_FB_PM3 is not set

# CONFIG_FB_CARMINE is not set

# CONFIG_FB_GEODE is not set

# CONFIG_FB_SMSCUFX is not set

# CONFIG_FB_UDL is not set

# CONFIG_FB_VIRTUAL is not set

# CONFIG_FB_METRONOME is not set

# CONFIG_FB_MB862XX is not set

# CONFIG_FB_BROADSHEET is not set

CONFIG_BACKLIGHT_LCD_SUPPORT=y

CONFIG_LCD_CLASS_DEVICE=m

CONFIG_LCD_PLATFORM=m

CONFIG_BACKLIGHT_CLASS_DEVICE=y

Perhaps there is an obvious mistake in all this? I tried it with the radeonfb set, but that didn't work either.

For what it's worth, X runs like a dream in full 1366x768 resolution. This is just a console problem. But since I prefer to work at the console, it's a serious problem for me.

----------

## Circuitsoft

I had mine working, but didn't like the 6-second pause while psmouse initializes. In trying to fix it, I changed things in my Kconfig, and I now get the symptom you describe. Dummy me didn't back up the old config to diff it.

Next step, start over with a new kernel from the LiveCD I used to install.

----------

## pking

@Circuitsoft: If you get it working again, please let me know how you did it!

I can boot the x120e passing the "nomodeset" option to the kernel, and when I run X everything is fine -- until I quit X, in which case the screen goes black. But this is the same problem all over again, I suspect; upon exiting X, once more KMS tries to kick in, and whatever went wrong before at boot (or would have if I hadn't used the "nomodeset" option) still goes wrong now, and hence a black screen. I can shutdown by typing blindly, though, so the computer is still running underneath, for all the good that does.

I'm still at a loss as to what to try changing in the kernel configuration. Maybe there's something in the documentation I've missed.

And after all this, the fun of trying to figure out the wireless card. (Anyone know where to get the firmware mentioned in the gentoo wiki page?)

----------

## Gusar

Like I said, google for the acpi message, you'll find instructions on how to modify the DSDT.

----------

## Hu

I have always set FB_RADEON=y in my KMS-enabled Radeon-based systems.  I have always had a working framebuffer console.  I have never tested whether this is coincidence or causation.  You state that you enabled radeonfb, which appears to be controlled by the FB_RADEON option.  Did you enable radeonfb and leave enabled all the other KMS-related options you have quoted in this thread?

----------

## pking

@Gusar: I found Jim Rees's blog, which reports the problem for the x120e, offers a fixed DSDT solution -- but he also points out that a one-liner put into /etc/local.d/ does the same job as well. This fixes the "reset to full brightness" on

 each reboot, but, of course, does nothing for the black-screen-on-boot problem I was having.

@Hu: Perhaps; it didn't work when I had uvesafb enabled, though. However...

I may have found the solution. I set out to duplicate the settings in the Gentoo Wiki page on the x120e for the video settings. I found that I kept getting framebuffer control set as a module rather than built-in. After a bit of digging I came the conclusion that the option CONFIG_VIDEO_OUTPUT_CONTROL was responsible. I turned it off, and thereby lost the acpi controls over the screen -- but now I can boot into the radeon KMS screen, and return to it from X correctly. Here's the relevant snippet from the working kernel .config:

```

# Graphics support

#

CONFIG_AGP=y

CONFIG_AGP_AMD64=y

CONFIG_AGP_INTEL=y

# CONFIG_AGP_SIS is not set

# CONFIG_AGP_VIA is not set

CONFIG_VGA_ARB=y

CONFIG_VGA_ARB_MAX_GPUS=16

CONFIG_VGA_SWITCHEROO=y

CONFIG_DRM=m

CONFIG_DRM_KMS_HELPER=m

CONFIG_DRM_TTM=m

# CONFIG_DRM_TDFX is not set

# CONFIG_DRM_R128 is not set

CONFIG_DRM_RADEON=m

CONFIG_DRM_RADEON_KMS=y

# CONFIG_DRM_I810 is not set

# CONFIG_DRM_I915 is not set

# CONFIG_DRM_MGA is not set

# CONFIG_DRM_SIS is not set

# CONFIG_DRM_VIA is not set

# CONFIG_DRM_SAVAGE is not set

# CONFIG_DRM_VMWGFX is not set

# CONFIG_STUB_POULSBO is not set

# CONFIG_VGASTATE is not set

# CONFIG_VIDEO_OUTPUT_CONTROL is not set

CONFIG_FB=y

CONFIG_FIRMWARE_EDID=y

CONFIG_FB_DDC=m

# CONFIG_FB_BOOT_VESA_SUPPORT is not set

CONFIG_FB_CFB_FILLRECT=m

CONFIG_FB_CFB_COPYAREA=m

CONFIG_FB_CFB_IMAGEBLIT=m

# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set

# CONFIG_FB_SYS_FILLRECT is not set

# CONFIG_FB_SYS_COPYAREA is not set

# CONFIG_FB_SYS_IMAGEBLIT is not set

# CONFIG_FB_FOREIGN_ENDIAN is not set

# CONFIG_FB_SYS_FOPS is not set

# CONFIG_FB_WMT_GE_ROPS is not set

# CONFIG_FB_SVGALIB is not set

# CONFIG_FB_MACMODES is not set

CONFIG_FB_BACKLIGHT=y

CONFIG_FB_MODE_HELPERS=y

CONFIG_FB_TILEBLITTING=y

#

# Frame buffer hardware drivers

#

# CONFIG_FB_CIRRUS is not set

# CONFIG_FB_PM2 is not set

# CONFIG_FB_CYBER2000 is not set

# CONFIG_FB_ARC is not set

# CONFIG_FB_ASILIANT is not set

# CONFIG_FB_IMSTT is not set

# CONFIG_FB_VGA16 is not set

# CONFIG_FB_UVESA is not set

# CONFIG_FB_VESA is not set

# CONFIG_FB_EFI is not set

# CONFIG_FB_N411 is not set

# CONFIG_FB_HGA is not set

# CONFIG_FB_S1D13XXX is not set

# CONFIG_FB_NVIDIA is not set

# CONFIG_FB_RIVA is not set

# CONFIG_FB_LE80578 is not set

# CONFIG_FB_INTEL is not set

# CONFIG_FB_MATROX is not set

CONFIG_FB_RADEON=m

CONFIG_FB_RADEON_I2C=y

CONFIG_FB_RADEON_BACKLIGHT=y

# CONFIG_FB_RADEON_DEBUG is not set

# CONFIG_FB_ATY128 is not set

# CONFIG_FB_ATY is not set

# CONFIG_FB_S3 is not set

# CONFIG_FB_SAVAGE is not set

# CONFIG_FB_SIS is not set

# CONFIG_FB_VIA is not set

# CONFIG_FB_NEOMAGIC is not set

# CONFIG_FB_KYRO is not set

# CONFIG_FB_3DFX is not set

# CONFIG_FB_VOODOO1 is not set

# CONFIG_FB_VT8623 is not set

# CONFIG_FB_TRIDENT is not set

# CONFIG_FB_ARK is not set

# CONFIG_FB_PM3 is not set

# CONFIG_FB_CARMINE is not set

# CONFIG_FB_GEODE is not set

# CONFIG_FB_SMSCUFX is not set

# CONFIG_FB_UDL is not set

# CONFIG_FB_VIRTUAL is not set

# CONFIG_FB_METRONOME is not set

# CONFIG_FB_MB862XX is not set

# CONFIG_FB_BROADSHEET is not set

CONFIG_BACKLIGHT_LCD_SUPPORT=y

# CONFIG_LCD_CLASS_DEVICE is not set

CONFIG_BACKLIGHT_CLASS_DEVICE=y

# CONFIG_BACKLIGHT_GENERIC is not set

# CONFIG_BACKLIGHT_PROGEAR is not set

# CONFIG_BACKLIGHT_APPLE is not set

# CONFIG_BACKLIGHT_SAHARA is not set

# CONFIG_BACKLIGHT_ADP8860 is not set

# CONFIG_BACKLIGHT_ADP8870 is not set

#

# Display device support

#

CONFIG_DISPLAY_SUPPORT=y

#

# Display hardware drivers

#

#

# Console display driver support

#

CONFIG_VGA_CONSOLE=y

CONFIG_VGACON_SOFT_SCROLLBACK=y

CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64

CONFIG_DUMMY_CONSOLE=y

CONFIG_FRAMEBUFFER_CONSOLE=y

CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y

# CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set

CONFIG_FONTS=y

CONFIG_FONT_8x8=y

CONFIG_FONT_8x16=y

# CONFIG_FONT_6x11 is not set

CONFIG_FONT_7x14=y

# CONFIG_FONT_PEARL_8x8 is not set

# CONFIG_FONT_ACORN_8x8 is not set

CONFIG_FONT_MINI_4x6=y

# CONFIG_FONT_SUN8x16 is not set

# CONFIG_FONT_SUN12x22 is not set

# CONFIG_FONT_10x18 is not set

CONFIG_LOGO=y

# CONFIG_LOGO_LINUX_MONO is not set

# CONFIG_LOGO_LINUX_VGA16 is not set

CONFIG_LOGO_LINUX_CLUT224=y

```

The only reason I'm not dead sure that's the solution is that I also set the regular radeon framebuffer driver to be built, in line with the suggestion given above. But for now things are working, and I can tweak much more easily.

For what it's worth I also found the relevant bit of firmware to download to get the wireless card working. So 95% there, just have to set up sound now.

Thanks to one and all for the advice and assistance. If I do run the problem to earth I'll post the information here later on. Thanks again!

----------

## Circuitsoft

I got mine working again last night; just hadn't gotten around to it because X came up fast enough that it didn't hurt anything.

My working .config

----------

## pking

@Circuitsoft: Tried to adapt your working .config file by copying the options in the device driver sections (graphics, power, and thinkpad-acpi). But I met the same fate as before: it boots three-quarters of the way up and then I get a completely blank screen, right when KMS should kick in. The only noteworthy difference between your working.config and my adaptation were that I left the firmware blobs built into the kernel. I confess to being quite baffled at this point. In the next day or two I'll do what they tell you not to -- just copy/paste your working.config file and build a kernel from it directly, to see whether it boots. At the moment, as noted, I can boot into KMS reliably, but I don't have acpi control over the video, which means no suspend/resume. And, just for oddness, even though I boot into KMS I don't get the correct consolefont. Curiouser and curiouser.

One question: Since you have no firmware listed in your working.config -- how do you get the radeon video drivers and the realtek wireless driver to work? I thought they had to be incorporated in the kernel.

----------

## Gusar

 *pking wrote:*   

> I thought they had to be incorporated in the kernel.

 

Only if the drivers are built in. But when they're modules, they can get the firmware from the filesystem.

----------

## pking

@Gusar: Thanks for the tip! Modular builds for me from now on.

@Circuitsoft: I copied and pasted your .Kconfig and rebuilt my kernel directly from it. Aside from a few hiccups, it worked (!) -- mostly. That is, the x120e does boot up into video; there is a long pause at "processing uevents" but it does return in the end -- but alas, still no suspend/resume (I'm working on it), and the wireless card doesn't initialize (perhaps an unload/reload will fix it). But a big step forward. Thanks!

----------

## pking

Better and better. The long delay seems to be just the modules sorting themselves out; subsequent boots are fast. The wireless card didn't know where to find its firmware, and that has been remedied. The only outstanding problem is that there is no suspend/resume. I can live without it, but it's nicer to have it, if possible; I'll keep working at it for a while yet.

----------

## Hu

Could you elaborate on the way in which S3 now fails for you?

With regard to modular vs. monolithic, including the drivers in the kernel is fine if you include the correct firmware via CONFIG_EXTRA_FIRMWARE.  You can often, though not always, get the name of the firmware from the error messages if you run a kernel that does not have the relevant firmware embedded.

----------

## pking

If I run:

```
acpitool -s
```

to suspend the x120e, I get the following message:

```
Function Do_Suspend : could not open file : /proc/acpi/sleep

You must have wrote access to /proc/acpi/sleep to suspend your computer.
```

But when I got the same message running the command as root, I tried listing the contents of /proc/acpi, and I find that there is no "sleep" entry there -- although there are event and wakeup entries, and directories for button and ibm. So something is not being created somewhere, despite "suspend" being enabled in the kernel. For the Kconfig, see the pastebin listing from CircuitSoft given above, which is what I'm using, and which has:

```
CONFIG_ARCH_SUSPEND_POSSIBLE=y

CONFIG_SUSPEND=y

CONFIG_SUSPEND_FREEZER=y
```

Any guesses?

----------

## pking

Curiouser and curiouser.

I just checked on my ThinkPad W510, and it doesn't have /proc/acpi/sleep either -- but suspend is working perfectly on it. I tried enabling the deprecated PROCFS_POWER option for acpi in the kernel, but it made no difference. Nor did installing acpid, which calls acpitool anyhow. Odd. The manpage for acpitool says that it works with /proc/acpi/sleep or with /sys/class/power, so presumably on the W510 it's working with the latter -- but then why not likewise on the x120e?

Still puzzled, still searching. Lots of old / outmoded information out there.

----------

## pking

Got it!

The x120e goes into suspend properly with the command:

echo mem > /sys/power/state

and resumes afterwards, flawlessly. There must be some sort of bug with acpitool. Anyhow, once this was discovered, a slight change in the /etc/acpi/default.sh script to call the above command rather than acpitool -s, and all works as expected -- even the suspend-on-close function. Yay!

Now to get the ThinkPad buttons working properly...

----------

## pking

<< sigh >>

Too excited, too soon.

I now have suspend / resume working as expected. Except.

Now that I've successfully suspended the x120e, I seem to have permanently messed up the wireless, which was working flawlessly before. And by "permanently" I mean: not even a reboot clears up the problem. Now I can boot up without a problem, but, even without putting the laptop into suspend, I can't initialize the wireless -- why not? Even if I load/unload the modules, it doesn't come back. Perhaps it's simply turned off? At the moment, after a reboot, issuing:

```
iwlist wlan0 power
```

results in "no power management information". But attempting to initialize wlan0 gives me the messages "no such device" -- the sort of thing I got before the wireless was built with the firmware. Oddly enough, now it is built with the firmware, and was working fine until I tried suspend/resume. The Fn+F5 key does not, alas, turn the wireless back on...

As usual, any and all advice welcome. So close, yet so frustrating.

----------

## pking

Apparently fixed. I was bitten by the well-known udev problem -- sometimes, it seems, udev gets confused and starts renaming interfaces each time. The solution is to clean out the persistant-rules file (or just delete it entirely to be recreated). The upshot is that I've rebooted a few times and each time been able to suspend/resume, complete with wireless connections. So I think that problem is for the moment solved.

Pretty soon I'll get to the point of enjoying this little machine!

----------

