Bug 234634 - x11-drivers/xf86-video-ati not working under 12.0
Summary: x11-drivers/xf86-video-ati not working under 12.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 mailing list
Depends on:
Reported: 2019-01-05 11:30 UTC by bourne.identity@hotmail.com
Modified: 2019-01-05 19:46 UTC (History)
2 users (show)

See Also:

Xorg log with radeon driver (25.06 KB, text/plain)
2019-01-05 14:27 UTC, bourne.identity@hotmail.com
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description bourne.identity@hotmail.com 2019-01-05 11:30:22 UTC
I was using Lumina as my DE till this morning on my FreeBSD 12.0 box, and things worked fine. My box has a Radeon R5 230 (Caicos) graphics card.

In the afternoon, I installed kde5 + xorg + xf86-video-ati + drm-kmod (after 'pkg delete -a -f'), and suddenly upon reboot I have lost the ability to start X. The error message on the console is "drmn0: error: No GEM object associated to handle 0x00000384, can't create framebuffer".

kldstat shows radeonkms.ko and drm2.ko loaded. (radeonkms get loaded in my box from /etc/rc.local).

I tried uninstalling xf86-video-ati/drm-kmod and swapping in the legacy ports drm-legacy-kmod and xf86-video-ati-legacy. With the legacy ports, X starts up but the desktop behaves weird, streaking and flashing all over. So I reverted to xf86-video-ati/drm-kmod, and now am unable to start X again.

A couple of interesting lines from Xorg log are as under:

[   105.562] failed to add FB for modeset
[   105.562] (WW) RADEON(0): Failed to set mode on CRTC 0
[   105.593] (EE) RADEON(0): Failed to enable any CRTC
Comment 1 Niclas Zeising freebsd_committer 2019-01-05 14:11:40 UTC
Can you verify which kernel driver you are loading, and if it attaches to your hardware?  Please provide kldstat -v | grep drm, and provide your kld_list from /etc/rc.conf.
Do you have any xorg configuration settings?
Can you provide your entire Xorg.log.0?
Have you tried using modesetting?  The easiest way to do this is to simply remove xf86-video-ati.
Comment 2 bourne.identity@hotmail.com 2019-01-05 14:26:15 UTC
Hi Niclas/others,

Thanks for taking this up.

My /etc/X11/xorg.conf mandates the Driver for X. Usually, I use "radeon". But since I am having problems starting X with radeon, I am for the moment starting X using vesa as the driver.

As a nice idea, I saved my Xorg session log with radeon, and it is attached in its entirety. This is the log for the session when I ran into the framebuffer error.

Is there any other information you would like me to provide ?

Manish Jain
Comment 3 bourne.identity@hotmail.com 2019-01-05 14:27:43 UTC
Created attachment 200798 [details]
Xorg log with radeon driver
Comment 4 Niclas Zeising freebsd_committer 2019-01-05 14:33:07 UTC
You never provided the information about which kernel driver you are using.
Can you try running Xorg without any configuration, so that it uses the default.
Have you tried using amdgpu?
Comment 5 bourne.identity@hotmail.com 2019-01-05 15:47:35 UTC

I do not quite understand what is meant by kernel driver - the only driver I know of is the graphics driver (which I flip between radeon and vesa). If you need something else by 'kernel driver', kindly tell me how to get it.

As for the command output, I have the following when I use radeon as the driver in xorg.conf.

a) kldstat -v | grep drm:

 		119 drmn/fbd
		542 drmn/radeon_atom_hw_i2c
		540 drm/radeon_hw_i2c
		538 drmn/radeon_iicbb
30    1 0xffffffff83014000    45070 drm2.ko (/boot/kernel/drm2.ko)
		533 drmn/drm_iic_dp_aux
		534 drmn

b) kldstat -v | grep radeon:

29    1 0xffffffff82f3f000    d4e68 radeonkms.ko (/boot/kernel/radeonkms.ko)
		542 drmn/radeon_atom_hw_i2c
		537 vgapci/radeonkms
		541 radeon_hw_i2c/iicbus
		539 radeon_iicbb/iicbb
		540 drm/radeon_hw_i2c
		538 drmn/radeon_iicbb
34    1 0xffffffff83060000     12f9 radeonkmsfw_CAICOS_pfp.ko (/boot/kernel/radeonkmsfw_CAICOS_pfp.ko)
		543 radeonkmsfw_CAICOS_pfp_fw
35    1 0xffffffff83062000     16f7 radeonkmsfw_CAICOS_me.ko (/boot/kernel/radeonkmsfw_CAICOS_me.ko)
		544 radeonkmsfw_CAICOS_me_fw
36    1 0xffffffff83064000      d73 radeonkmsfw_BTC_rlc.ko (/boot/kernel/radeonkmsfw_BTC_rlc.ko)
		545 radeonkmsfw_BTC_rlc_fw
37    1 0xffffffff83065000     5f97 radeonkmsfw_CAICOS_mc.ko (/boot/kernel/radeonkmsfw_CAICOS_mc.ko)
		546 radeonkmsfw_CAICOS_mc_fw


I do not use rc.conf::kld_list - I load kld via rc.local. My rc.local loads radeonkms



I tried running X without xorg.conf. It appears to take radeon on its own, and the results are the same - X refuses to start with the Xorg log mentioning the 3 "Failed" lines referred in the original post.

I also tried running X with amdgpu as the driver (after kldloading amdgpu). X refuses to start, complaining of No Screens Found
Comment 6 Niclas Zeising freebsd_committer 2019-01-05 16:10:23 UTC
You are not using the driver from the drm-kmod port, you are still using the legacy base driver.  Please add kld_list="/boot/modules/radeonkms.ko" or kld_list="/boot/modules/amdgpu.ko" to /etc/rc.conf, and reboot.

Make sure you have drm-kmod installed.
Comment 7 Niclas Zeising freebsd_committer 2019-01-05 16:11:58 UTC
(In reply to Niclas Zeising from comment #6)

If you are using UEFI boot, you might also want to add hw.syscons.disable=1  to /boot/loader.conf, howerver, that will give you a broken console until the gpu driver is loaded.
Comment 8 bourne.identity@hotmail.com 2019-01-05 18:45:16 UTC
I am as glad as surprised. Yes, adding kld_list to /etc/rc.conf does solve the problem ! Now everything works fine !!

So radeonkms is important not just for loading, but also for the manner of loading. rc.local hook does not work any longer.

Thanks so much for persisting with this one. I am much the wiser for your efforts.
Am leaving this PR for you to close out as FIXED.

A quick question:

Does kld_list use colon (:) or space between multiple kld's ?

Manish Jain
Comment 9 Niclas Zeising freebsd_committer 2019-01-05 19:23:01 UTC
(In reply to bourne.identity@hotmail.com from comment #8)

Good to see that the issue is solved.
You can use spaces (' ') to separate between kmods in kld_list.
Comment 10 Niclas Zeising freebsd_committer 2019-01-05 19:23:42 UTC
Closing this as it's reported solved by the original submitter.
Comment 11 bourne.identity@hotmail.com 2019-01-05 19:46:54 UTC

This message is also being emailed to you.

I think you can offer great help to me on one additional count. A minute from you can save me immense troubleshooting later.

I have a port mkdesktop, which is a one-stop solution for desktop installation under FreeBSD.

For my port to work cleanly, I need to load the right kld's for 11.2 as well as 12.0 for amdgpu / radeon / nvidia / intel.

Following my experience with the ATI issue today, I have revised my kld lists as below (my main list is called drmkld; any extras go into drmkld_opt):

1) AMD GPU (both 11.2 and 12.0):

2) ATI Radeon:
drmkld_opt="/boot/kernel/radeon.ko"    # For 11.2
drmkld_opt=""                          # For 12.0

3) NVidia:
drmkld="/boot/modules/nvidia.ko /boot/modules/nvidia-modeset.ko"

4) Intel:

Are you satisfied with the set of lists above ? Your confirmation would be much appreciated.

Manish Jain