# startx black screen



## martinek (Dec 8, 2020)

I have installed FreeBSD 12.2 onto my T420 today, I've done default install using installer tty, then installed xorg, xf86-intel-video and xfce, and  added dbus.enable="YES" to rc.conf and startxfce4 into .xinitrc.  When I run startx it puts me into black screen with cursor in top left corner(or maybe just random white square) and is completely untesponsive, not even C-Alt-F1 works- I shat it down using power button. I've installed it few months ago and it worked fine, am I missing something?


----------



## a6h (Dec 8, 2020)

Refer to FreeBSD DRM and Graphics Support. You probably need to install drm-kmod from the Ports Collection.

In case of Intel:
`cd /usr/ports/graphics/drm-kmod`
`make install clean`

/etc/rc.conf

```
kld_list="/boot/modules/i915kms.ko"
```
If you don't have /usr/ports installed, then:
`portsnap fetch extract`


----------



## martinek (Dec 8, 2020)

vigole said:


> Refer to FreeBSD DRM and Graphics Support. You probably need to install drm-kmod from the Ports Collection.
> 
> In case of Intel:
> `cd /usr/ports/graphics/drm-kmod`
> ...


Done it, now it gives me that "cannot connect to framebuffer mode" error. Installing xf86-intel-video fixed it last time but I've already installed it here.


----------



## matt_k (Dec 9, 2020)

Do you have any xorg.conf file? If yes, get rid of it.


----------



## martinek (Dec 9, 2020)

matt_k said:


> Do you have any xorg.conf file? If yes, get rid of it.


No, there isn't any


----------



## matt_k (Dec 9, 2020)

Please post your Xorg.0.log to pastebin or somewhere and provide a link for us to read it.


----------



## martinek (Dec 9, 2020)

matt_k said:


> Please post your Xorg.0.log to pastebin or somewhere and pr


I tried using pastebinit but it gave me error, I found this picture in another thread, I cropped of first part which is different for me but errors are the same.


----------



## Abhid (Dec 13, 2020)

I am facing a similar issue. I upgraded to FreeBSD-12.2-Release. But now after typing 
	
	



```
startx
```
 only the top bar and bottom bar appear. The desktop is blank, and none of the icons are visible.

My screen looks like this:




Also, the mouse pad doesn't work to click by tapping. I can only move the mouse around. I have to use the left and right buttons to click.

I have tried to build 
	
	



```
usr/ports/graphics/drm-fbsd12.0-kmod
```
 using ports. But I got an error saying,

```
drm-fbsd12.0-kmod-4.16.g20201016 requires kernel source files in SRC_BASE = /usr/src
```


----------



## tingo (Dec 13, 2020)

Yes, Abhid, you need to install the sources for your version of FreeBSD in order to be able to build kernel modules from ports. Search for it in these forums, there are several threads which explains how to install the sources.


----------



## Abhid (Dec 13, 2020)

tingo said:


> Yes, Abhid, you need to install the sources for your version of FreeBSD in order to be able to build kernel modules from ports. Search for it in these forums, there are several threads which explains how to install the sources.


tingo, actually I faced this problem after I executed 
	
	



```
portupgrade -a
```
The build ran for almost 4 days, and this problem came after that. So, I'm a little skeptical of running it all over again. Are there any specific ports to build ?


----------



## Minbari (Dec 13, 2020)

Abhid said:


> tingo, actually I faced this problem after I executed
> 
> 
> 
> ...


1.) Don't mix ports with packages (unless you know what you are doing), it wil break your system, so stay with packages.
2.) To get FreeBSD 12.2 sources go to /usr/src and type: `svn checkout https://svn.freebsd.org/base/releng/12.2`. After you have sources installed on your system you can build graphics/drm-fbsd12.0-kmod.

```
cd /usr/ports/graphics/drm-fbsd12.0-kmod
make package
cd work/pkg
pkg add drm-fbsd12.0-kmod-4.16.g20200221.txz
cd ../.. && make clean
```


----------



## Argentum (Dec 14, 2020)

Abhid said:


> tingo, actually I faced this problem after I executed
> 
> 
> 
> ...


Try to *isolate* your problem.

1. See if your *DRM* is loaded properly. You can do it without any X. Just load your DRM and send us the output of your `kldstat` and `dmesg -a|grep drm`;
2. Try to run `Xorg -configure`. This will check the configuration and write it in file. See the output file xorg.conf.new;
3. If these steps are good, after that try to run your X based applications.


----------



## monwarez (Dec 14, 2020)

i915kms package breaks on 12.2-RELEASE (workaround - build from ports)
					

This looked important enough to pass on here.  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250700  "Xorg complains that it cannot find mesa when i915kms is installed using the binary package, but runs just fine when built locally out of ports.  Known bad on at least two systems."  Looks...




					forums.freebsd.org


----------



## Abhid (Dec 18, 2020)

Hi Minbari. I tried your suggestion. Actually first I had to update FreeBSD from source using this documentation. Today I followed the steps you suggested, but unfortunately my desktop is still blank.

Argentum, I'll try your suggestion now. Let's hope it works. Thanks.


----------



## Abhid (Dec 20, 2020)

Argentum, *dmesg -a | grep drm* gave no output.

Running *kldstat* gave this output:



So I think that drm module is not loaded.

As per discussions with senior member SirDice on another thread, my graphics card isn't detected and it falls back to vesa(4).

Then I ran Xorg -configure, which gave the following output:


----------



## Raffeale (Dec 20, 2020)

try to add   kld_list="/boot/modules/i915kms.ko" in you /etc/rc.conf file!


----------



## Argentum (Dec 20, 2020)

Abhid said:


> Argentum, *dmesg -a | grep drm* gave no output.
> 
> Running *kldstat* gave this output:
> View attachment 8897
> So I think that drm module is not loaded.


Yes, that shows that you drm is not loaded. Have you installed it?


----------



## Abhid (Dec 20, 2020)

Argentum, I modified my */etc/rc.conf file *and added the line, *kld_list="/boot/modules/radeonkms.ko"*

Then I restarted my system to see no improvement.

Earlier this evening, I had also re-installed the graphics/drm-fbsd12.0-kmod package via ports, as suggested by this thread. But still there's no improvement.


----------



## Alexander88207 (Dec 20, 2020)

Can we see more information about your laptop? Also i think starting X as root is not the best idea.


----------



## Argentum (Dec 20, 2020)

Abhid said:


> Argentum, I modified my */etc/rc.conf file *and added the line, *kld_list="/boot/modules/radeonkms.ko"*
> 
> Then I restarted my system to see no improvement.
> 
> Earlier this evening, I had also re-installed the graphics/drm-fbsd12.0-kmod package via ports, as suggested by this thread. But still there's no improvement.


I can see from your `kldstat` that you have no DRM loaded. Have you installed graphics/drm-fbsd12.0-kmod?

You should also include the `[B]kld_list[/B]` according to your actual hardware. But from your kldstat I can see that you have not activated the DRM.


----------



## Abhid (Dec 21, 2020)

Argentum said:


> I can see from your `kldstat` that you have no DRM loaded. Have you installed graphics/drm-fbsd12.0-kmod?
> 
> You should also include the `[B]kld_list[/B]` according to your actual hardware. But from your kldstat I can see that you have not activated the DRM.


Argentum, I have installed graphics/drm-fbsd12.0-kmod from ports, as per suggestions from this thread.  To determine my hardware type, I had run 
*pciconf -lv | grep -3 *to get this output:


```
vgapci0@pci0:0:1:0: class=0x030000 card=0x078e1028 chip=0x98e41002 rev=0xd2 hdr=0x00
vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]'
device = 'Stoney [Radeon R2/R3/R4/R5 Graphics]'
class = display
subclass = VGA
```

So I modified */etc/rc.conf file *and added the line, *kld_list="/boot/modules/radeonkms.ko"*

Then I restarted my system only to see the same problem again.


----------



## Argentum (Dec 21, 2020)

Abhid said:


> Argentum, I have installed graphics/drm-fbsd12.0-kmod from ports, as per suggestions from this thread.  To determine my hardware type, I had run
> *pciconf -lv | grep -3 *to get this output:
> 
> 
> ...


Have you tried graphics/drm-legacy-kmod also?


----------



## Argentum (Dec 21, 2020)

Abhid said:


> Argentum, *dmesg -a | grep drm* gave no output.
> 
> Running *kldstat* gave this output:
> View attachment 8897


Your kldstat shows thar you have no DRM loaded. Even if you have unsupported hardware, you should have the `drm.ko` module in `kldstat` visible. That means you have no good DRM to load. Reinstall the DRM.

Please note, that after upgrading the system you have to recompile the DRM. At least when you use ports.

Again, find out why your DRM is not loaded. You can try to load it manually with `kldload`.


----------



## Raffeale (Dec 21, 2020)

look this thread , i think  it will help you








						amd vega and radeon series vga card driver for FreeBSD 12.1 and 12.2 tutorial for beginner[update 2020-12-16]
					

amd apu vga card driver for FreeBSD 12.1  tutorial for beginner  I’m a newbie for freebsd and have some experience for linux. I have just installed FreeBSD for one week, I met a lot of trouble when I use it. I just want to tell everyone that how to solve this problem  then you could  save you...




					forums.freebsd.org


----------



## Abhid (Dec 24, 2020)

> Argentum, I tried to install *graphics/drm-legacy-kmod *but I got the following output:





I did not proceed with the installation because its going to be deprecated in a few days from today. I have already installed *graphics/drm-kmod *and graphics/drm-fbsd12.0-kmod earlier.

I've also added the line, *kld_list="/boot/modules/radeonkms.ko" *in to  */etc/rc.conf file. *Now my kldstat shows that drm.ko and radeonkms.ko are loaded.





Alexander88207, my laptop is a Dell Inspiron with 4 GB RAM, and AMD E2 processor and a Radeon graphics card.


----------



## T-Daemon (Dec 24, 2020)

Abhid said:


> I've also added the line, *kld_list="/boot/modules/radeonkms.ko" *in to */etc/rc.conf file.*





Abhid said:


> vgapci0@pci0:0:1:0: class=0x030000 card=0x078e1028 chip=0x98e41002 rev=0xd2 hdr=0x00
> vendor = 'Advanced Micro Devices, Inc. [AMD/ATI]'
> device = '*Stoney *[Radeon R2/R3/R4/R5 Graphics]'
> class = display


According to this X.org wiki


			RadeonFeature
		

the GPU with the engineering name _STONEY_ is from the _Volcanic Islands_ video card family. The AMD-GPU-Matrix comments the use of the "_amdgpu_" kernel module (third row, counting from last row up).

Try `kld_list="amdgpu"` in /etc/rc.conf.


----------



## Abhid (Dec 25, 2020)

T-Daemon, I tried your suggestion to no avail. I've also tried the following:

*kld_list="/boot/modules/radeonkms.ko"
kld_list="amdgpu"
kld_list="/boot/modules/i915kms.ko"
*
Now although, I can see *drm.ko *when I run *kldstat. *So that doesn't seem to be an issue.

I've also installed graphics/drm-fbsd12.0-kmod via pkg first and ports later. I've also installed graphics/drm-kmod via ports.

I also attempted to install graphics/drm-legacy-kmod via ports, but I was warned that it's going to be deprecated in a few days. So I did not proceed ahead.


----------



## Abhid (Dec 25, 2020)

Update: Now I also installed *graphics/drm-legacy-kmod* via ports. But it did not help.

I hope things get sorted in the next release. I also hope my hardware of AMD E2 and Radeon graphics card, does not remain unsupported.

Wish you all a Merry Christmas and a good year ahead.


----------



## tingo (Dec 26, 2020)

Abhid said:


> *kld_list="/boot/modules/radeonkms.ko"
> kld_list="amdgpu"
> kld_list="/boot/modules/i915kms.ko"*


Just in case it is not clear; there should only be one of these lines active in /etc/rc.conf at a time. Comment out the others when you are testing.


----------



## Abhid (Dec 27, 2020)

tingo, I just did that while keeping just one of the three in turns, and commenting the others. None of them work.

However, for the second entry (kld_list="amdgpu") the boot up screen's layout seems more compact and brightly lit than the other two.


----------



## Abhid (Dec 29, 2020)

Should I also re-install Xorg package and build everything from ports ? To just remind, I'm running FREEBSD-12.2 RELEASE.


----------



## Alexander88207 (Dec 29, 2020)

The meta package x11/xorg and its components are not kernel specific, rebuilding it is not needed.


----------



## Argentum (Dec 29, 2020)

Abhid said:


> tingo, I just did that while keeping just one of the three in turns, and commenting the others. None of them work.
> 
> However, for the second entry (kld_list="amdgpu") the boot up screen's layout seems more compact and brightly lit than the other two.


Now, when it boots up, see the `kldstat` and post the result here. Also see the `dmesg -a|grep drm`


----------



## Abhid (Dec 29, 2020)

Alexander88207, OK I won't build it then.

Argentum, the following is the output of kldstat from a few seconds ago:


----------



## Argentum (Dec 29, 2020)

Abhid said:


> Alexander88207, OK I won't build it then.
> 
> Argentum, the following is the output of kldstat from a few seconds ago:
> 
> View attachment 8949


You just said that you have amdgpu, but here I can see radeonkms. What is your exact GPU model? Radeon and amdgpu are different animals. You should load the correct one.

If you load radeonkms, but you do not have one, nothing happens. It just sits there. You can unload it by `kldunload radeonkms.ko`


----------



## Abhid (Dec 29, 2020)

Argentum, initially I had all 3 entries in */etc/rc.conf* when tingo advised me to keep only one. So I tried each one of them while commenting the other two, but none work.

I noted that the entry with "amdgpu" results in a somewhat more compact screen. Right now I have the entry *kld_list="/boot/modules/radeonkms.ko"* in */etc/rc.conf*

This is the output after running* pciconf -lv | grep vga -3 *. It is Stoney [Radeon R2/R3/R4/R5 Graphics]


----------



## Argentum (Dec 29, 2020)

Abhid said:


> Argentum, initially I had all 3 entries in */etc/rc.conf* when tingo advised me to keep only one. So I tried each one of them while commenting the other two, but none work.
> 
> I noted that the entry with "amdgpu" results in a somewhat more compact screen. Right now I have the entry *kld_list="/boot/modules/radeonkms.ko"* in */etc/rc.conf*
> 
> ...


OK. Seems this is Radeon. Now, what happens if you run `Xorg -configure` and see the file /root/xorg.conf.new

P.S. Do not post images. Post plain text.


----------



## Alexander88207 (Dec 29, 2020)

Abhid said:


> Alexander88207, OK I won't build it then.
> 
> Argentum, the following is the output of kldstat from a few seconds ago:
> 
> View attachment 8949



Radeonkms is still active, you are using a STONEY chipset which is supported by AMDGPU (kld_list="amdgpu").

After trying can you post the `/var/log/Xorg.0.log` ?

BTW, do you only have xorg installed or also an desktop enviroment?

a missing `dbus_enable="YES"` in `/etc/rc.conf` is creating a blackscreen if there is a DM behind.


----------



## Abhid (Dec 30, 2020)

Argentum, actually yesterday I logged off after it was past midnight. So I'm replying now.

This is the output of *Xorg -configure*

# Xorg -configure
(EE)
Fatal server error:
(EE) Server is already active for display 0
                      If this server is no longer running, remove /tmp/.X0-lock
                      and start again
(EE)
(EE)
Please consult the X.Org foundation support
                      at http://wiki.x.org
for help
(EE)

The file* /root/xorg.conf.new  *does not exist.


----------



## Alexander88207 (Dec 30, 2020)

`Xorg -configure` is normally not needed anymore, Xorg setup all devices automatic.

Please post your log of `/var/log/Xorg.0.log`.


----------



## Abhid (Dec 30, 2020)

Alexander88207, the following is the output of */var/log/Xorg.log* : https://termbin.com/v0z9

In the file */etc/rc.conf*, the entry *dbus_enable="YES" *is present.


----------



## free-and-bsd (Dec 30, 2020)

Abhid said:


> tingo, I just did that while keeping just one of the three in turns, and commenting the others. None of them work.
> 
> However, for the second entry (kld_list="amdgpu") the boot up screen's layout seems more compact and brightly lit than the other two.


You mean, font becomes smaller and looking more neat? That would mean, framebuffer mode is working and, generally, your video driver working as well.
If so, you _might_ need some config in /usr/local/etc/X11/xorg.conf.d directory, after all. Although what the guys say is right and in most cases you don't need it, in some cases you do.
Judging from your Xorg.0.log it works.
Next question: do you have x11-drivers/xf86-input-synaptics installed? Is it a laptop you're using?


----------



## free-and-bsd (Dec 30, 2020)

Abhid said:


> View attachment 8923
> I did not proceed with the installation because its going to be deprecated in a few days from today. I have already installed *graphics/drm-kmod *and graphics/drm-fbsd12.0-kmod earlier.
> 
> I've also added the line, *kld_list="/boot/modules/radeonkms.ko" *in to  */etc/rc.conf file. *Now my kldstat shows that drm.ko and radeonkms.ko are loaded.
> ...


BTW, on the picture above I can see as good GRAPHIC MODE as one could dream of. It's xterm running in X window system. Which evidently means, your problem is NOT the driver, but your DE config.


----------



## Abhid (Dec 30, 2020)

free-and-bsd, yes the font has become smaller and looks neater.

I checked *x11-drivers/xf86-input-synaptics*. It wasn't installed. So I installed it and restarted my system, only to see the mouse is also no longer working. The desktop did not appear as well.

So, I had to deinstall it.

What changes should I do in the DE config ?


----------



## Argentum (Dec 30, 2020)

Alexander88207 said:


> `Xorg -configure` is normally not needed anymore, Xorg setup all devices automatic.


Just for diagnostics in this case.


----------



## Abhid (Dec 30, 2020)

free-and-bsd, I have the xfce environment. I'm using a DELL Inspiron laptop with 4 GB RAM, E2 7th Gen processor and Radeon graphics card.


----------



## free-and-bsd (Dec 30, 2020)

Abhid said:


> I am facing a similar issue. I upgraded to FreeBSD-12.2-Release. But now after typing
> 
> 
> 
> ...


The issue you're having is NOT similar to the OP. You have a worknig X with mouse basically working except synaptics specific functionality. You don't need to use another driver. If the driver was wrong you would NOT have succeeded this far with your desktop. Black screen means black background. Has nothing to do with the driver.


----------



## Abhid (Dec 31, 2020)

free-and-bsd, but before I upgraded to 12.2, my desktop had icons and some background. Now I can only see a black background. I can't even access some folders like Downloads. 

Also, the mouse no longer responds to the touch-pad's clicks. It only  responds to left and right buttons. This was working properly before the upgrade.

Should I modify the settings of Xfce (which was working properly before the upgrade) ?


----------



## free-and-bsd (Dec 31, 2020)

Abhid said:


> free-and-bsd, but before I upgraded to 12.2, my desktop had icons and some background. Now I can only see a black background. I can't even access some folders like Downloads.
> 
> Also, the mouse no longer responds to the touch-pad's clicks. It only  responds to left and right buttons. This was working properly before the upgrade.
> 
> Should I modify the settings of Xfce (which was working properly before the upgrade) ?


It must be synaptics configuration this time, NOT your video driver. 
Just remember this as a starting point: once you have black (or any other color) screen with a mouse MOVING on it -- it basically means Xorg + driver_ is_ working. _Some_ buttons not working on your mouse -- is not the same as a completely frozen non-responsive mouse (as in the OP). It makes all the difference. Your Xorg.0.log was showing some trouble going on about your touchpad. But you can't get very much from that log -- just see if there IS any trouble. 
In fact xf86-input-synaptics IS the right driver for touchpads. I tried this on my Lenovo Thinkpad T61. It's a separate topic, you see. Better maybe not mix it in here.

Black screen (no background) would mean, in your case, _background settings_ are missing somehow. Say, your XFCE got upgraded, but now your user config for Desktop background points to a non-existent file. 

And regarding ports/packages.
For a newby I would rather recommend to install packages (pkg install), which then can be upgraded. Upgrades may not come as often, but... as a starter you can still make use of it. What specific sophisticated hardware/software do you have that you would need to build ports manually?


----------



## free-and-bsd (Dec 31, 2020)

To access folders you need to lanuch pcmanfm file manager. BTW, your menu must be available?


----------



## Abhid (Dec 31, 2020)

free-and-bsd, thanks for clarifying that. Yes my Application menu is available. I will try to research pitfalls during Xfce upgradation. I will also try to launch *pcmanfm* file manager.


----------



## Argentum (Dec 31, 2020)

Abhid said:


> free-and-bsd, thanks for clarifying that. Yes my Application menu is available. I will try to research pitfalls during Xfce upgradation. I will also try to launch *pcmanfm* file manager.


And besides that, try installing x11/mate Good and functional window manager.


----------



## Alexander88207 (Dec 31, 2020)

Abhid said:


> Alexander88207, the following is the output of */var/log/Xorg.log* : https://termbin.com/v0z9
> 
> In the file */etc/rc.conf*, the entry *dbus_enable="YES" *is present.



This log looks perfect.


----------



## Abhid (Jan 1, 2021)

Alexander88207, I referred your post here to uninstall and then re-install xfce desktop and other associated packages. Now my desktop background appears with all icons in the background. Thanks. My problem got solved.

Thanks to everyone on this thread for your time. I learnt much more in the process, and am better informed.


----------



## Alexander88207 (Jan 1, 2021)

Abhid said:


> Alexander88207, I referred your post here to uninstall and then re-install xfce desktop and other associated packages. Now my desktop background appears with all icons in the background. Thanks. My problem got solved.
> 
> Thanks to everyone on this thread for your time. I learnt much more in the process, and am better informed.



Great! Nice that it works for you now.


----------



## scottro (Jan 1, 2021)

Note that as thread originator you can mark the thread as solved. I don't think it's intuitive, but you click edit on the first post, I believe, you can choose a prefix, including solved.  Anyway, thank you for coming back and letting us know how you fixed it.


----------



## Abhid (Jan 1, 2021)

Scottro, actually I didn't start the thread originally, but as I thought the issue was similar to mine, so I also started posting.


----------



## grahamperrin@ (May 1, 2021)

martinek said:


> … FreeBSD 12.2 … T420



<https://bsd-hardware.info/?view=search_computer&computer_vendor=Lenovo&computer_model=T420#list>



> … xf86-intel-video and xfce …





martinek said:


> … not even C-Alt-F1 works …



Try:

safe mode
configure the system to not automatically start XFCE
remove xf86-intel-video
upgrade to FreeBSD 13.0-RELEASE
upgrade packages
start XFCE
The fifth step will provide significantly superior DRM.


----------

