# [solved]gentoo-sources-2.6.32/KMS/RadeonHD4770=>black screen

## Chris_tian

Hi,

I am using gentoo-sources-2.6.32 with KMS enabled (and radeon mode setting enabled by default). I have disabled all framebuffer related modules (except framebuffer console support).

While the startup scripts are executed the console screen turns black at some point (while/after udev is startet). X is not started automatically at the moment thus not causing the blank screen or lockups. I can only workaround the problem by passing nomodeset as kernel parameter. Any ideas how to fix this problem are appreciated. 

Thanks in advance

P.S.: According to the log file kms is working:

```
Dec  3 21:17:19  kernel: [drm] Initialized drm 1.1.0 20060810

Dec  3 21:17:19  kernel: [drm] radeon defaulting to kernel modesetting.

Dec  3 21:17:19  kernel: [drm] radeon kernel modesetting enabled.

Dec  3 21:17:19  kernel: ACPI: PCI Interrupt Link [APC3] enabled at IRQ 18

Dec  3 21:17:19  kernel: radeon 0000:05:00.0: PCI INT A -> Link[APC3] -> GSI 18 (level, low) -> IRQ 18

Dec  3 21:17:19  kernel: radeon 0000:05:00.0: setting latency timer to 64

Dec  3 21:17:19  kernel: [drm] radeon: Initializing kernel modesetting.

Dec  3 21:17:19  kernel: [drm] register mmio base: 0xFDDE0000

Dec  3 21:17:19  kernel: [drm] register mmio size: 65536

Dec  3 21:17:19  kernel: [drm] Clocks initialized !

Dec  3 21:17:19  kernel: [drm] Detected VRAM RAM=256M, BAR=256M

Dec  3 21:17:19  kernel: [drm] RAM width 128bits DDR

Dec  3 21:17:19  kernel: [TTM] Zone  kernel: Available graphics memory: 443948 kiB.

Dec  3 21:17:19  kernel: [TTM] Zone highmem: Available graphics memory: 1037296 kiB.

Dec  3 21:17:19  kernel: [drm] radeon: 256M of VRAM memory ready

Dec  3 21:17:19  kernel: [drm] radeon: 512M of GTT memory ready.

Dec  3 21:17:19  kernel: [drm] Loading RV730 CP Microcode

Dec  3 21:17:19  kernel: platform radeon_cp.0: firmware: requesting radeon/RV730_pfp.bin

Dec  3 21:17:19  kernel: platform radeon_cp.0: firmware: requesting radeon/RV730_me.bin

Dec  3 21:17:19  kernel: [drm] GART: num cpu pages 131072, num gpu pages 131072

Dec  3 21:17:19  kernel: [drm] ring test succeeded in 1 usecs

Dec  3 21:17:19  kernel: [drm] radeon: ib pool ready.

Dec  3 21:17:19  kernel: [drm] ib test succeeded in 0 usecs

Dec  3 21:17:19  kernel: [drm] Radeon Display Connectors

Dec  3 21:17:19  kernel: [drm] Connector 0:

Dec  3 21:17:19  kernel: [drm]   DVI-I

Dec  3 21:17:19  kernel: [drm]   DDC: 0x7f10 0x7f10 0x7f14 0x7f14 0x7f18 0x7f18 0x7f1c 0x7f1c

Dec  3 21:17:19  kernel: [drm]   Encoders:

Dec  3 21:17:19  kernel: [drm]     CRT2: INTERNAL_KLDSCP_DAC2

Dec  3 21:17:19  kernel: [drm]     DFP2: INTERNAL_UNIPHY1

Dec  3 21:17:19  kernel: [drm] Connector 1:

Dec  3 21:17:19  kernel: [drm]   DIN

Dec  3 21:17:19  kernel: [drm]   Encoders:

Dec  3 21:17:19  kernel: [drm]     TV1: INTERNAL_KLDSCP_DAC2

Dec  3 21:17:19  kernel: [drm] Connector 2:

Dec  3 21:17:19  kernel: [drm]   DVI-I

Dec  3 21:17:19  kernel: [drm]   DDC: 0x7e20 0x7e20 0x7e24 0x7e24 0x7e28 0x7e28 0x7e2c 0x7e2c

Dec  3 21:17:19  kernel: [drm]   Encoders:

Dec  3 21:17:19  kernel: [drm]     CRT1: INTERNAL_KLDSCP_DAC1

Dec  3 21:17:19  kernel: [drm]     DFP1: INTERNAL_UNIPHY

Dec  3 21:17:19  kernel: [drm] fb mappable at 0xD0141000

Dec  3 21:17:19  kernel: [drm] vram apper at 0xD0000000

Dec  3 21:17:19  kernel: [drm] size 7257600

Dec  3 21:17:19  kernel: [drm] fb depth is 24

Dec  3 21:17:19  kernel: [drm]    pitch is 6912

Dec  3 21:17:19  kernel: fb0: radeondrmfb frame buffer device

Dec  3 21:17:19  kernel: [drm] Initialized radeon 2.0.0 20080528 for 0000:05:00.0 on minor 0

```

Edit: changed wrong kernel version number in my postLast edited by Chris_tian on Sat Dec 19, 2009 4:01 pm; edited 2 times in total

----------

## Chris_tian

Update ...

I booted again with kms disabled, then I executed following commands

```
modprobe fbcon 

modprobe radeon modeset=1
```

KMS was enabled and the terminal had the native screen resolution and everything was displayed as it should have been. So now I am wondering why I am getting a black screen when booting without the nomodeset kernel parameter and how can I fix this ?

----------

## azp

I have the same issue. If I'm booting with KMS enabled, it works up until X usually starts, then everything goes black. I can still log in via SSH and fix stuff, but it is impossible to get the screen back.

If I do /etc/init.d/xdm stop, it's still black.

I've tried recompiling the xorg packages (mesa, video-ati, xorg-server) but it doesn't help.

----------

## grumblebear

The black screen on startup is caused by fbcon not being loaded automatically. So put it in /etc/modules.autoload.d/kernel-2.6.

Console should be fine then, but for X to work you need recent versions of libdrm and mesa. A new enough version of mesa is not yet in the portage tree, so you will have to use one from an overlay or compile yourself from git.

----------

## Mad Merlin

 *grumblebear wrote:*   

> The black screen on startup is caused by fbcon not being loaded automatically. So put it in /etc/modules.autoload.d/kernel-2.6.
> 
> Console should be fine then, but for X to work you need recent versions of libdrm and mesa. A new enough version of mesa is not yet in the portage tree, so you will have to use one from an overlay or compile yourself from git.

 

What's the minimum version of Mesa required for KMS?

----------

## grumblebear

I'm not quite sure, but I think you need at least mesa-7.6. But for the best performance you should go with the latest code from git, otherwise X will be slower with KMS enabled.

----------

## Link31

Do latest Mesa code (from git) and latest libdrm (from git) work with xserver 1.6 ? There seems to be a dependency on xserver >= 1.7 in ebuilds from the x11 overlay, but unfortunately fglrx is not yet compatible with xserver >= 1.7.

So I wonder if there is any way to get all of these installed at the same time. I would like to be able to switch easily between open-source 3D and KMS for testing, and proprietary crap to play games.

I tried KMS with xserver 1.6 and current stable Mesa and libdrm, but although KMS worked fine Xorg refused to start and locked up the display.

----------

## azp

 *Link31 wrote:*   

> Do latest Mesa code (from git) and latest libdrm (from git) work with xserver 1.6 ? There seems to be a dependency on xserver >= 1.7 in ebuilds from the x11 overlay, but unfortunately fglrx is not yet compatible with xserver >= 1.7.
> 
> So I wonder if there is any way to get all of these installed at the same time. I would like to be able to switch easily between open-source 3D and KMS for testing, and proprietary crap to play games.
> 
> I tried KMS with xserver 1.6 and current stable Mesa and libdrm, but although KMS worked fine Xorg refused to start and locked up the display.

 

Yeah I'm running layman with X11 overlay, and my package settings are:

```
root@skare$ cat /etc/portage/package.unmask 

#x11-overlay

>=x11-libs/libdrm-9999

>=media-libs/mesa-9999

>=x11-base/xorg-drivers-9999

>=x11-drivers/xf86-video-ati-9999

>=x11-drivers/xf86-video-radeonhd-9999
```

This enables me building it from git, so I guess it should work. But right now I'm running the everything with modesetting=0 on my grub.config line so I'm at least able to work. I tried rebuilding everything from git again, perhaps I made a mistake before, but I haven't tried it with KMS since.

My glxinfo output is (some stuff removed):

```
root@skare$ glxinfo

name of display: :0.0

IRQ's not enabled, falling back to busy waits: 2 0

display: :0  screen: 0

direct rendering: Yes

server glx vendor string: SGI

server glx version string: 1.2

server glx extensions:

    ...

    ...

client glx version string: 1.4

client glx extensions:

    ...

    ...

GLX version: 1.2

GLX extensions:

    ...

    ...

OpenGL vendor string: Advanced Micro Devices, Inc.

OpenGL renderer string: Mesa DRI R600 (RV770 9442) 20090101  TCL

OpenGL version string: 1.5 Mesa 7.8-devel

OpenGL extensions:

...

...
```

I'm a bit surpriset that I don't need to run xorg-server as -9999 version, but I assume that the drivers actually handle the card, and not the actual server. This seems like a good idea I guess  :Wink: 

----------

## ermo

@Chris_tian: Maybe it doesn't work because you seem to be quite ahead of the curve: gentoo-sources-_3_.6.32 -- I must've missed the entire Linux kernel 3.x release series   :Cool:  (you might want to fix the version in the OP so that people searching for gentoo-sources-2.6.32 will get a hit on this thread).

Other than that, I have nothing to contribute (except that I want to get this to work too and found this thread useful of course).

Edit: Explicitly address the OP.

----------

## tsuraan2

 *Link31 wrote:*   

> 
> 
> Yeah I'm running layman with X11 overlay, and my package settings are:
> 
> ```
> ...

 

how are you running radeonhd-9999?  It doesn't appear to be in the x11 overlay, and no other overlay is obviously the right one.

----------

## Link31

 *azp wrote:*   

> I'm a bit surpriset that I don't need to run xorg-server as -9999 version, but I assume that the drivers actually handle the card, and not the actual server. This seems like a good idea I guess 

 

Thanks for your answer, but what xorg-server version are you actually using ? I'd like to know if I can run KMS with x11-base/xorg-server 1.6.

----------

## drizzt

Hi all,

i have HD4650 running with kms on 2.6.32 with no problems at all (after some struggling)

What I did:

- built new kernel (made sure no old vesa stuff left in there !)

- booted new kernel(made sure no video-parameter at boot command line)

- changed symlink

- emerged mesa-9999 libdrm-9999 xf86-video-ati-9999

- rebuild xorg-server (1.7.3)

- configured X to use ati driver ("radeon")

- viola kms including 3D stuff works fine

Some hints for checking:

- Xorg.0.log should contain a line "kms detected" or similar -> this tells you ati-driver recognized kms

- I compiled drm and kms as modules (for whatever reasons compiled in didn't work, maybe the problem were somewhere else located)

P.S. if you happen to have awful crashes at starting up X the next time you boot, check if you *really* boot the new kernel..... (experience hurts sometime *ggg*)

----------

## azp

 *Link31 wrote:*   

>  *azp wrote:*   I'm a bit surpriset that I don't need to run xorg-server as -9999 version, but I assume that the drivers actually handle the card, and not the actual server. This seems like a good idea I guess  
> 
> Thanks for your answer, but what xorg-server version are you actually using ? I'd like to know if I can run KMS with x11-base/xorg-server 1.6.

 

I'm running the latest server on ~amd64, which as we speak is xorg-server-1.7.3.

This is more out of curiousity than anything else, but why do you want to keep running 1.6, and still be KMS-bleeding-edge?

----------

## azp

 *tsuraan2 wrote:*   

>  *Link31 wrote:*   
> 
> Yeah I'm running layman with X11 overlay, and my package settings are:
> 
> ```
> ...

 

That's possible, I just added that by hand after adding video-ati. I thought that the xorg-drivers-9999 would handle it, but it didn't seem to, so I added them. I then rebuilt it, and I haven't tested since. Perhaps it works now =)

I can test this evening when I get home, and if it works I'll try to write a howto.

----------

## azp

Hehehe I'm glad to say that it actually boots and starts X okay now since I rebuilt it. But I have a very nice side effect of it, I need to find the reason for that as well.

What it is? We'll have a look yourself =)

http://volatileint.blogspot.com/2009/12/trying-out-kernel-mode-setting-kms-on.html

----------

## Link31

 *azp wrote:*   

> I'm running the latest server on ~amd64, which as we speak is xorg-server-1.7.3.
> 
> This is more out of curiousity than anything else, but why do you want to keep running 1.6, and still be KMS-bleeding-edge?

 

Because fglrx does NOT work with xserver >= 1.7, and I *need* 3D, either free or proprietary... Ideally I would like to switch easily between KMS and fglrx, but that means I cannot install xserver >= 1.7 for now.

----------

## azp

 *Link31 wrote:*   

>  *azp wrote:*   I'm running the latest server on ~amd64, which as we speak is xorg-server-1.7.3.
> 
> This is more out of curiousity than anything else, but why do you want to keep running 1.6, and still be KMS-bleeding-edge? 
> 
> Because fglrx does NOT work with xserver >= 1.7, and I *need* 3D, either free or proprietary... Ideally I would like to switch easily between KMS and fglrx, but that means I cannot install xserver >= 1.7 for now.

 

Ah, that was a bit obvious actually. I got a bit frustrated when I saw that fglrx didn't work with new xorg-server. That's why I switched to the xf86-drivers-radeonhd, to be able to upgrade to the new xorg.

----------

## Chris_tian

 *ermo wrote:*   

> @Chris_tian: Maybe it doesn't work because you seem to be quite ahead of the curve: gentoo-sources-_3_.6.32 -- I must've missed the entire Linux kernel 3.x release series   (you might want to fix the version in the OP so that people searching for gentoo-sources-2.6.32 will get a hit on this thread).
> 
> 

 

Haha, I totally missed that. 

Anyway the version number is fixed now.

----------

## Chris_tian

 *grumblebear wrote:*   

> The black screen on startup is caused by fbcon not being loaded automatically. So put it in /etc/modules.autoload.d/kernel-2.6.
> 
> Console should be fine then, but for X to work you need recent versions of libdrm and mesa. A new enough version of mesa is not yet in the portage tree, so you will have to use one from an overlay or compile yourself from git.

 

Thanks, booting with kms enabled works now.

I'll wait until the related packages are in portage until I try X with KMS enabled.

----------

## DaggyStyle

 *Chris_tian wrote:*   

>  *grumblebear wrote:*   The black screen on startup is caused by fbcon not being loaded automatically. So put it in /etc/modules.autoload.d/kernel-2.6.
> 
> Console should be fine then, but for X to work you need recent versions of libdrm and mesa. A new enough version of mesa is not yet in the portage tree, so you will have to use one from an overlay or compile yourself from git. 
> 
> Thanks, booting with kms enabled works now.
> ...

 

or got svn on them  :Wink: 

----------

