# Xserver - black screen



## fernandel (Dec 21, 2018)

Hi,
I did change hard drive on iMac 11,1 late 2009 with Radeon 4850. There are no OS X on, just FreeBSD 12.0-Release GENERIC amd64.
Installation was easy and it boot. I am using ports and install everything what I need, also apple Magic Mouse works 
But when I start xserver it stat in black screen. I did use legacy ati driver and legacy Knox too but it is the same.
`sysctl machdep.bootmethod`: UEFI
and `sysctl kern.vty` vt.
When I installed I use auto got partitioning (please, look at attached pictures).
Thank you.


----------



## fernandel (Dec 21, 2018)

One more


----------



## tingo (Dec 21, 2018)

Unfortunately, none of those pictures shows any messages relevant to Xorg on your machine, and nothing relevant to your situation. Please share the relevant parts of /var/log/Xorg.0.log, and if you have made config files for Xorg, share them too.

(General note: everyone should focus on getting network on their machine working first, it makes it easier to get files off the machine for debugging / finding faults. Photos should be a last resort)


----------



## fernandel (Dec 21, 2018)

I have a network and installed [ports]www/lynx[/ports] but has a problem with forum. I took pictures from the last log.


----------



## fernandel (Dec 21, 2018)

More


----------



## fernandel (Dec 21, 2018)

tingo said:


> Unfortunately, none of those pictures shows any messages relevant to Xorg on your machine, and nothing relevant to your situation. Please share the relevant parts of /var/log/Xorg.0.log, and if you have made config files for Xorg, share them too.
> 
> (General note: everyone should focus on getting network on their machine working first, it makes it easier to get files off the machine for debugging / finding faults. Photos should be a last resort)



Okay. For now I put in /usr/local/etc/X11 "scfb" driver and start xserver. I did try to make xorg.conf but not success. Please, checked attached files.
Thamnk you very much.
And my partitions:

```
gpart show
=>       40  976773088  ada0  GPT  (466G)
         40     409600     1  efi  (200M)
     409640  968474624     2  freebsd-ufs  (462G)
  968884264    7888864     3  freebsd-swap  (3.8G)
```
and

```
gpart list
Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 976773127
first: 40
entries: 152
scheme: GPT
Providers:
1. Name: ada0p1
   Mediasize: 209715200 (200M)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 20480
   Mode: r0w0e0
   efimedia: HD(1,GPT,e86f27af-021d-11e9-bb45-0023dffff19f,0x28,0x64000)
   rawuuid: e86f27af-021d-11e9-bb45-0023dffff19f
   rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
   label: (null)
   length: 209715200
   offset: 20480
   type: efi
   index: 1
   end: 409639
   start: 40
2. Name: ada0p2
   Mediasize: 495859007488 (462G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 209735680
   Mode: r1w1e1
   efimedia: HD(2,GPT,e86fcbc6-021d-11e9-bb45-0023dffff19f,0x64028,0x39b9c000)
   rawuuid: e86fcbc6-021d-11e9-bb45-0023dffff19f
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 495859007488
   offset: 209735680
   type: freebsd-ufs
   index: 2
   end: 968884263
   start: 409640
3. Name: ada0p3
   Mediasize: 4039098368 (3.8G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 2147504128
   Mode: r1w1e1
   efimedia: HD(3,GPT,e870c5df-021d-11e9-bb45-0023dffff19f,0x39c00028,0x785fe0)
   rawuuid: e870c5df-021d-11e9-bb45-0023dffff19f
   rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
   label: (null)
   length: 4039098368
   offset: 496068743168
   type: freebsd-swap
   index: 3
   end: 976773127
   start: 968884264
Consumers:
1. Name: ada0
   Mediasize: 500107862016 (466G)
   Sectorsize: 512
   Mode: r2w2e4
```

Thank you.


----------



## tingo (Dec 22, 2018)

1. your partitions and other stuff is not relevant to this specific issue, so you should keep them out of this thread. If your have other problems with your machine, create a new thread for that.
2. you still use the old style xorg.conf file. This works, as long as it is correctly set up, but it is a large file with many lines in it, it is easy for something to be wrong in it.

If you want to configure Xorg for the current style, you (could) need more files, but they are much fewer lines. These files lives in /usr/local/etc/X11/xorg.conf.d/ and you usually only need two.
A file for the driver for the graphics card you are using - for a radeon driver, this would be

```
root@kg-core1# cat /usr/local/etc/X11/xorg.conf.d/driver-radeon.conf
Section "Device"
    Identifier "Card0"
    Driver     "radeon"
EndSection
```
the name is not important, but it must end in '.conf'
and a file for your keyboard settings (layout). I use a Norwegian keyboard Layout

```
root@kg-core1# cat /usr/local/etc/X11/xorg.conf.d/keyboard-no.conf
Section "InputClass"
        Identifier "keyboard defaults"
        MatchIsKeyboard "on"
        Option      "XkbLayout" "no"
EndSection
```
and the rest (mouse, etc) is usually autodetected.

*Note*: your old xorg.conf need to be moved or renamed so it doesn't interfere.
HTH


----------



## fernandel (Dec 22, 2018)

I did as you wrote but it doesn't work: BLACK screen. It worls when I have /usr/local/etc/X11/xorg.conf.d/drivers-scfb:

```
Section "Device"
    Identifier "Card0"
    Driver     "scfb"
EndSection
```
The problem is also if I load a radeonkms.ko I got the black screen. But as I wrote before I bot UEFI and kern.vty is VT.


----------



## tingo (Dec 24, 2018)

Hmm, which drm-kmod are you using? With that graphics card, perhaps you need drm-legacy-kmod.


----------



## fernandel (Dec 24, 2018)

tingo said:


> Hmm, which drm-kmod are you using? With that graphics card, perhaps you need drm-legacy-kmod.


I have installaed drm-legacy-kmod and x11-drivers/xf86-video-ati-legacy and doesn't work - black screen.


----------



## tingo (Dec 24, 2018)

And what error messages (EE) do you get in /var/log/xorg.0.log?


----------



## fernandel (Dec 24, 2018)

tingo said:


> And what error messages (EE) do you get in /var/log/xorg.0.log?



The dmesg.txt is when I `kldload /boot/modules/radeonkms.ko`


----------



## tingo (Dec 25, 2018)

Ok, what happens when you add this to /etc/rc.conf instead?

```
kld_list="/boot/modules/radeonkms.ko"
```
It is strange that it says "Install the graphics/drm-legacy-kmod" if you have already installed it...


----------



## fernandel (Dec 25, 2018)

tingo said:


> Ok, what happens when you add this to /etc/rc.conf instead?
> 
> ```
> kld_list="/boot/modules/radeonkms.ko"
> ...



I didn't put in the rc.conf and boot because I get a black screen. I just use `kldload /boot/modules/radeonkms.ko`


----------



## fernandel (Dec 25, 2018)

I did also make /usr/local/etc/x11/xorg.conf.d/driver-radeon.conf and put in:

```
Section "Device"                                                                                  
        Identifier "Card0"                                                                        
        Driver     "radeon"                                                                        
        Option "AccelMethod" "gallium"                                                            
        Option "DRI" "2"                                                                          
EndSection
```

I use "gallium" because I remember that I had before on FreeBSD 11.2. And you can see Xorg.log attached. Should I installed again legacy-ati driver?


----------



## fernandel (Dec 25, 2018)

What if I make something like:

```
Section "Screen"
    Identifier             "Screen 0"
    DisplaySize             2560 x 1440
EndSection
```


----------



## Vull (Dec 25, 2018)

Maybe you should _not_ have that xorg configuration stuff in your configuration, when you try to load the drm-kmod modules? I'm no expert on this, and I should mention that I haven't successfully installed drm-kmod on any of my own configurations, but I do remember reading this little snippet during my first and only attempt:



			
				https://freebsddesktop.github.io/2018/12/08/drm-kmod-primer.html said:
			
		

> Seriously that’s it - oh, and one final note:
> 
> *You do not need to install any of the xf86-video drivers or provide an Xorg configuration. Autodetection should “just work”.*


Link: https://freebsddesktop.github.io/2018/12/08/drm-kmod-primer.html

For my own purposes, I don't really care that much about fancy graphics, and I can get by okay just using the x11 vesa drivers, or the scfb drivers for UEFI systems, but in your situation, I might try moving all my xorg configuration files to another, safe location, away from the /usr/local/etc/X11 path, and then reboot using _only_ the drm-kmod configuration stuff? Hope this is helpful... this is really the only suggestion I can presently offer...


----------



## fernandel (Dec 25, 2018)

Vull said:


> Maybe you should _not_ have that xorg configuration stuff in your configuration, when you try to load the drm-kmod modules? I'm no expert on this, and I should mention that I haven't successfully installed drm-kmod on any of my own configurations, but I do remember reading this little snippet during my first and only attempt:
> 
> 
> Link: https://freebsddesktop.github.io/2018/12/08/drm-kmod-primer.html
> ...



I didn't have when I start. I put later "scfb" driver because Radeon dosn't work. And also don't care but graphics/blender does .
I hope that I will find something. And I attached dmesg file and the last lines are:

```
kernel: [drm]     CRT1: INTERNAL_KLDSCP_DAC1
kernel: __pm_runtime_resume not implemented -- see your local kernel hacker
kernel: pm_runtime_mark_last_busy not implemented -- see your local kernel hacker
kernel: __pm_runtime_suspend not implemented -- see your local kernel hacker
kernel: [drm] Cannot find any crtc or sizes
kernel: __pm_runtime_resume not implemented -- see your local kernel hacker
kernel: pm_runtime_mark_last_busy not implemented -- see your local kernel hacker
kernel: __pm_runtime_suspend not implemented -- see your local kernel hacker
kernel: [drm] Initialized radeon 2.50.0 20080528 for drmn0 on minor 0
kernel: [drm] Cannot find any crtc or sizes
shutdown[82651]: power-down by root:
```


----------



## nik0tine (Dec 25, 2018)

Hello friend!
why dont you try the drm of the previous thread? the "NEXT DRM KMOD"
and try to do the following commands: xsession, startx, or X
and remove the legacy ati stuff lol thats for AGP


----------



## fernandel (Dec 25, 2018)

nik0tine said:


> Hello friend!
> why dont you try the drm of the previous thread? the "NEXT DRM KMOD"
> and try to do the following commands: xsession, startx, or X
> and remove the legacy ati stuff lol thats for AGP


I did and than install graphics/drm-kmod which install graphics/drm-fbsd1.2-kmod and graphicd/gpu-firmware-kmod and on mine previos post I did attache part of `dmesg`. And is not just xserver a problem but also black screen in console when I kldload radeon driver.
And computer has uefi boot and came in vt.


----------



## nik0tine (Dec 26, 2018)

`hw.syscons.disable=1` > /boot/loader.conf
`kld_list="amdgpu"`>/etc/rc.conf
`Section "Device"

    Identifier "AMD"
    Driver "amdgpu"
    Option "DRI" "3"
    Option "TearFree" "true"


        BusID       "PCI:0:1:0"`>/etc/X11/xorg.conf
modify /boot/loader.conf LAST because you will get a frozen screen until the driver is loaded. experiment with this order 2,3,1 from the above steps


----------



## nik0tine (Dec 26, 2018)

make a backup because maybe you need radeon in /etc/rc.conf but like this: kld_list="radeonkms"

https://forums.freebsd.org/threads/radeonkms-problem.51500/

and look at these options in the replies:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=194664


----------



## fernandel (Dec 26, 2018)

nik0tine said:


> make a backup because maybe you need radeon in /etc/rc.conf but like this: kld_list="radeonkms"
> 
> https://forums.freebsd.org/threads/radeonkms-problem.51500/
> 
> ...


What kind of graphics card do you have, please? Mine is RV770/M98L [Mobility Radeon HD 4850] amd `pciconf -lv` shows:

```
vgapci0@pci0:1:0:0:    class=0x030000 card=0x00b5106b chip=0x944a1002 rev=0x00 hdr=0x00
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'RV770/M98L [Mobility Radeon HD 4850]'
    class      = display
    subclass   = VGA
hdac0@pci0:1:0:1:    class=0x040300 card=0xaa30106b chip=0xaa301002 rev=0x00 hdr=0x00
    vendor     = 'Advanced Micro Devices, Inc. [AMD/ATI]'
    device     = 'RV770 HDMI Audio [Radeon HD 4850/4870]'
    class      = multimedia
    subclass   = HDA
```
And I think my card is from 2008 or 2009. And I am using  FreeBSD 12.0-RELEASE r341666 GENERIC  amd64 installed on iMac 11,1 (late 2009), boot is UEFI and as I understand correct and it shows too I boot in "vt" console.
On the previpus version of FreeBSD I didn't have problem with load kernel radeonkms.
And link about graphics:
https://en.wikipedia.org/wiki/List_of_AMD_graphics_processing_units


----------



## Deleted member 30996 (Dec 26, 2018)

fernandel said:


> What kind of graphics card do you have, please? Mine is RV770/M98L [Mobility Radeon HD 4850] amd `pciconf -lv` shows:
> 
> ```
> vgapci0@pci0:1:0:0:    class=0x030000 card=0x00b5106b chip=0x944a1002 rev=0x00 hdr=0x00
> ...



fernandel, I'm on my Gateway rebranded Acer running FreeBSD 11.2-RELEASE-p7 and it advertises an ATI Mobility Radeon HD 4250. `dmesg` identifies it as a ATI Mobility Radeon HD 4200 and it's from 2007-2008.

I use the ATI driver available during the build, my /boot/loader.conf is empty as is /etc/x11 and I don't have anything ATI/Radeon related in /etc/rc.conf. Here are the relevant  portions of my `dmesg`:


```
info: [drm] Initialized drm 1.1.0 20060810
drmn0: <ATI Mobility Radeon HD 4200> on vgapci0
info: [drm] RADEON_IS_PCI
info: [drm] initializing kernel modesetting (RS880 0x1002:0x9712 0x1025:0x036E).
info: [drm] register mmio base: 0xF2200000
info: [drm] register mmio size: 65536
info: [drm] radeon_atrm_get_bios: ===> Try ATRM...
info: [drm] radeon_atrm_get_bios: IGP card detected, skipping this method...
info: [drm] radeon_acpi_vfct_bios: ===> Try VFCT...
info: [drm] radeon_acpi_vfct_bios: Get "VFCT" ACPI table
info: [drm] radeon_acpi_vfct_bios: Failed to get "VFCT" table: AE_NOT_FOUND
info: [drm] igp_read_bios_from_vram: ===> Try IGP's VRAM...
info: [drm] igp_read_bios_from_vram: VRAM base address: 0xe0000000
info: [drm] igp_read_bios_from_vram: Map address: 0xfffff800e0000000 (262144 bytes)
info: [drm] igp_read_bios_from_vram: Incorrect BIOS signature: 0xFFFF
info: [drm] radeon_read_bios: ===> Try PCI Expansion ROM...
info: [drm] radeon_read_bios: Map address: 0xfffff800000c0000 (131072 bytes)
info: [drm] ATOM BIOS: Acer_JE50DN


info: [drm] Radeon Display Connectors
info: [drm] Connector 0:
info: [drm]   VGA-1
info: [drm]   DDC: 0x7e40 0x7e40 0x7e44 0x7e44 0x7e48 0x7e48 0x7e4c 0x7e4c
info: [drm]   Encoders:
info: [drm]     CRT1: INTERNAL_KLDSCP_DAC1
info: [drm] Connector 1:
info: [drm]   LVDS-1
info: [drm]   DDC: 0x7e50 0x7e50 0x7e54 0x7e54 0x7e58 0x7e58 0x7e5c 0x7e5c
info: [drm]   Encoders:
info: [drm]     LCD1: INTERNAL_KLDSCP_LVTMA
info: [drm] Connector 2:
info: [drm]   HDMI-A-1
info: [drm]   HPD1
info: [drm]   DDC: 0x7e60 0x7e60 0x7e64 0x7e64 0x7e68 0x7e68 0x7e6c 0x7e6c
info: [drm]   Encoders:
info: [drm]     DFP1: INTERNAL_UNIPHY
info: [drm] radeon: power management initialized
info: [drm] Connector VGA-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.VGA-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector LVDS-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.LVDS-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] Connector HDMI-A-1: get mode from tunables:
info: [drm]   - kern.vt.fb.modes.HDMI-A-1
info: [drm]   - kern.vt.fb.default_mode
info: [drm] fb mappable at 0xE0142000
info: [drm] vram apper at 0xE0000000
info: [drm] size 4325376
info: [drm] fb depth is 24
info: [drm]    pitch is 5632
fbd0 on drmn0
VT: Replacing driver "vga" with new "fb".
info: [drm] Initialized radeon 2.29.0 20080528 for drmn0 on minor 0

hdacc1: <Realtek ALC272 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC272 Audio Function Group> at nid 1 on hdacc1
pcm1: <Realtek ALC272 (Analog 2.0+HP/2.0)> at nid 20,33 and 25 on hdaa1
pcm2: <Realtek ALC272 (Left Analog Mic)> at nid 24 on hdaa1
```

I don't tweak anything to get a picture or sound.


----------



## fernandel (Dec 26, 2018)

Trihexagonal said:


> fernandel, I'm on my Gateway rebranded Acer running FreeBSD 11.2-RELEASE-p7 and it advertises an ATI Mobility Radeon HD 4250. `dmesg` identifies it as a ATI Mobility Radeon HD 4200 and it's from 2007-2008.
> 
> I use the ATI driver available during the build, my /boot/loader.conf is empty as is]/etc/x11[file[/file] and I don't have anything ATI/Radeon related in /etc/rc.conf. Here are the relevant  portions of my `dmesg`:
> 
> I don't tweak anything to get a picture or sound.



In /boot/loader.conf I do not have anything related to the graphics card but I did install graphics/drm-kmod.
I did try to start xserver without anything in /usr/local/etc/x11/xorg.conf.d but just black screen. In /etc/rc.nf I also don't have anything ATI/Radeon related.
But I have FreeBSD 12.0-Release on iMac and boot is UEFI. I am using scfb driver now and it works. An some from `glxinfo`

```
glxinfo
name of display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
*****
****
Extended renderer info
***
Accelarated: no
****
```
and `glxgears` are not good:

```
6574 frames in 5.0 seconds = 1314.782 FPS
6858 frames in 5.0 seconds = 1371.434 FPS
6864 frames in 5.0 seconds = 1372.757 FPS
6865 frames in 5.0 seconds = 1372.895 FPS
8302 frames in 5.0 seconds = 1660.326 FPS
8394 frames in 5.0 seconds = 1678.781 FPS
8360 frames in 5.0 seconds = 1671.962 FPS
8372 frames in 5.0 seconds = 1674.219 FPS
8374 frames in 5.0 seconds = 1674.688 FPS
8316 frames in 5.0 seconds = 1663.101 FPS
8255 frames in 5.0 seconds = 1650.794 FPS
8383 frames in 5.0 seconds = 1676.561 FPS
```

Do you think that I should deinstalled drm-kmod and try again? Thank you.


----------



## Deleted member 30996 (Dec 26, 2018)

fernandel said:


> Do you think that I should deinstalled drm-kmod and try again? Thank you.



I honestly can't say, fernandel, I don't have to use it on any of my machines. The only thing I have to tweak at all to get to work is Nvidia. 

I thought it strange our cards were so close in the line and mine worked out-of-the-box with the ATI driver. If it works now I'd probably just be happy it did but I'm not into gaming or watching movies on my laptops


----------



## fernandel (Dec 26, 2018)

Trihexagonal said:


> I honestly can't say, fernandel, I don't have to use it on any of my machines. The only thing I have to tweak at all to get to work is Nvidia.
> 
> I thought it strange our cards were so close in the line and mine worked out-of-the-box with the ATI driver. If it works now I'd probably just be happy it did but I'm not into gaming or watching movies on my laptops


I did try without drm-kmod installed and I installed the old ATI drivers but it didn't work. Looks like is something with UEFI boot?
I don't watch movies too and don't play games except games/rocksndiamonds and I am pleased with scfb driver.


----------



## fernandel (Dec 30, 2018)

I found the link https://bugs.freedesktop.org/show_bug.cgi?id=98046
Is it possible that is related to mine "lblack screen" problem?
Thank you.


----------



## tingo (Dec 30, 2018)

That could be related yes. One of the comments lists a firmware upgrade, if that is relevant for your machine you could try it (but I guess you would need to install OS X / macOS or what it is called these days on an exteranl drive or something in order to get the firmware update installed).
Disclaimer: I don't have an iMac, so I am not able to verify anything - all this is theory and speculation from my side.


----------



## fernandel (Dec 30, 2018)

tingo said:


> That could be related yes. One of the comments lists a firmware upgrade, if that is relevant for your machine you could try it (but I guess you would need to install OS X / macOS or what it is called these days on an exteranl drive or something in order to get the firmware update installed).
> Disclaimer: I don't have an iMac, so I am not able to verify anything - all this is theory and speculation from my side.



Thank you. I try to do everythig but doesn't works. Lokks like that firmware is no the problem, IMO. In the logs is successful. Computer is from 2009 and firmware was upgraded long time ago. Before I change the hard drive and I have OS X on I did check from firmware upgrade but there wer anything. And radeon from kernel works without problem and now I am using ati and kmod legacy.


----------

