Bug 245702 - x11-drivers/xf86-video-ati-legacy does not work under 12.1
Summary: x11-drivers/xf86-video-ati-legacy does not work under 12.1
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: i386 Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-17 16:25 UTC by Anders Liljeborg
Modified: 2020-05-07 12:54 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments
Output from dmesg (16.17 KB, text/plain)
2020-04-17 16:25 UTC, Anders Liljeborg
no flags Details
Xorg.o.log (11.66 KB, text/plain)
2020-04-17 16:28 UTC, Anders Liljeborg
no flags Details
Boot messages, reboot after kernel panic (25.31 KB, text/plain)
2020-04-28 13:17 UTC, Anders Liljeborg
no flags Details
Photo of screen after kernel panic (545.16 KB, image/jpeg)
2020-05-07 12:54 UTC, Anders Liljeborg
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Anders Liljeborg 2020-04-17 16:25:29 UTC
Created attachment 213501 [details]
Output from dmesg

I upgraded from 12.0 to 12.1 and xf86-video-ati-legacy is broken now.
Trying to use xf86-video-ati.

Have ATI X1300 on PCIe x 16 card, GPU name is RV515, generation Radeon R500 PCIe.

Have tried drm-kmod and drm-legacy-kmod, does not work.
Have kld_list="/boot/modules/radeonkms.ko" in /etc/rc.conf and rebooted several times.
Have hw.syscons.disable=1 in /boot/loader.conf

Does not help.

> kldstat -v | grep drm
                117 drmn/fbd
                540 drmn/radeon_atom_hw_i2c
                536 drmn/radeon_iicbb
                538 drm/radeon_hw_i2c
 8    1 0x1f542000    4a000 drm2.ko (/boot/kernel/drm2.ko)
                531 drmn/drm_iic_dp_aux
                532 drmn

> kldstat -v | grep radeon
 7    1 0x1f470000    d2000 radeonkms.ko (/boot/modules/radeonkms.ko)
                535 vgapci/radeonkms
                540 drmn/radeon_atom_hw_i2c
                537 radeon_iicbb/iicbb
                539 radeon_hw_i2c/iicbus
                536 drmn/radeon_iicbb
                538 drm/radeon_hw_i2c
12    1 0x1f59f000     4000 radeon_R520_cp_bin.ko (/boot/modules/radeon_R520_cp_bin.ko)
                541 radeon_R520_cp_bin_fw

> uname -a
FreeBSD dataserv.nanophys.kth.se 12.1-RELEASE-p3 FreeBSD 12.1-RELEASE-p3 GENERIC  i386

Excerpt from /var/log/Xorg.0.log:
[   248.529] (EE) Screen(s) found, but none have a usable configuration.
[   248.529] (EE)
Fatal server error:
[   248.529] (EE) no screens found(EE)
[   248.529] (EE)

I always get this in dmesg:
info: [drm] Initialized drm 1.1.0 20060810
drmn0: =======================================================
drmn0: This code is obsolete abandonware. Install the graphics/drm-legacy-kmod \
pkg
drmn0: =======================================================
drmn0: Deprecated code (to be removed in FreeBSD 13): drm2 drivers
drmn0: =======================================================
drmn0: This code is obsolete abandonware. Install the graphics/drm-legacy-kmod \
pkg
drmn0: =======================================================
drmn0: Deprecated code (to be removed in FreeBSD 13): drm2 drivers
drmn0: <ATI Radeon X1300/X1550> on vgapci0
info: [drm] RADEON_IS_PCIE
info: [drm] initializing kernel modesetting (RV515 0x1002:0x7187 0x18BC:0x1972)\
.

and I HAVE installed drm-legacy-kmod.
Comment 1 Anders Liljeborg 2020-04-17 16:28:07 UTC
Created attachment 213502 [details]
Xorg.o.log
Comment 2 Greg V 2020-04-22 01:37:19 UTC
Your radeonkms is loaded from /boot/modules, but there's drm2 from /boot/kernel. This is not correct. (This really should fail harder..)

I guess kldxref didn't work out correctly. For good measure, rm /boot/kernel/drm2.ko
Comment 3 Anders Liljeborg 2020-04-23 11:56:28 UTC
(In reply to Greg V from comment #2)

Thank you very much for the info, Greg_V.

I removed /boot/kernel/drm2.ko and rebooted, but kldstat gives still that drm2.ko is in the kernel.

1001:SU:dataserv:anders> kldstat
Id Refs Address        Size Name
 1   60   0x800000  19a6b64 kernel
 2    1 0x1f400000     7000 fdescfs.ko
 3    1 0x1f407000     b000 linprocfs.ko
 4    2 0x1f412000    50000 linux.ko
 5    1 0x1f462000     7000 linsysfs.ko
 6    1 0x1f469000     7000 nullfs.ko
 7    1 0x1f470000    d2000 radeonkms.ko
 8    1 0x1f542000    45000 drm2.ko
 9    4 0x1f587000     7000 iicbus.ko
10    1 0x1f58e000     5000 iic.ko
11    1 0x1f593000     7000 iicbb.ko
12    1 0x1f59a000     4000 radeon_R520_cp_bin.ko
13    1 0x1f59e000     6000 uhid.ko
14    1 0x1f5a4000     7000 wmt.ko
15    1 0x1f5ab000     8000 ums.ko
16    1 0x1f5b3000    2f000 ipfw.ko
17    1 0x1f5e2000     4000 mac_ntpd.ko
1002:SU:dataserv:anders> cd /boot/kernel/
1003:SU:dataserv:kernel> lf drm*
drm.ko*

I cannot unload the drm2.ko:

1005:SU:dataserv:kernel> kldunload drm2.ko
kldunload: can't unload file: Device busy

And I still get the same error when running "startx".

However, the error meesage of "drm2 deprecated code" has dissappeared from dmesg. 

I have tried with and without hw.syscons.disable=1 in /boot/loader.conf
rebooted between each trial.

Same error in /var/log/Xorg.0.log all the time:
[  1768.060] (II) UnloadModule: "radeon"
[  1768.060] (EE) Screen(s) found, but none have a usable configuration.
[  1768.060] (EE)
Fatal server error:
[  1768.060] (EE) no screens found(EE)
[  1768.060] (EE)

Best wishes
Anders
Comment 4 Niclas Zeising freebsd_committer 2020-04-23 13:03:28 UTC
drm-legacy-kmod comes with a drm2.ko as well.
Comment 5 Niclas Zeising freebsd_committer 2020-04-23 13:09:04 UTC
Are you using drm-legacy-kmod or drm-fbsd12.0-kmod?  What happens if you try the modesetting driver instead?
Comment 6 Anders Liljeborg 2020-04-24 14:47:48 UTC
(In reply to Niclas Zeising from comment #5)

I have been using drm-legacy-kmod.

Now I installed drm-fbsd12.0-kmod, this uninstalls drm-kmod and drm-legacy-kmod.
Rebooted.

1005 dataserv:~> kldstat
Id Refs Address        Size Name
 1   61   0x800000  19a6b64 kernel
 2    1 0x1f400000     7000 fdescfs.ko
 3    1 0x1f407000     b000 linprocfs.ko
 4    2 0x1f412000    50000 linux.ko
 5    1 0x1f462000     7000 linsysfs.ko
 6    1 0x1f469000     7000 nullfs.ko
 7    1 0x1f470000   177000 radeonkms.ko
 8    2 0x1f5e7000    7f000 drm.ko
 9    5 0x1f666000    18000 linuxkpi.ko
10    4 0x1f67e000    1a000 linuxkpi_gplv2.ko
11    2 0x1f698000     5000 debugfs.ko
12    1 0x1f69d000    16000 ttm.ko
13    1 0x1f6b3000     4000 radeon_R520_cp_bin.ko
14    1 0x1f6b7000     6000 uhid.ko
15    1 0x1f6bd000     7000 wmt.ko
16    1 0x1f6c4000     8000 ums.ko
17    1 0x1f6cc000    2f000 ipfw.ko
18    1 0x1f6fb000     4000 mac_ntpd.ko


startx gives same error:
[ 12580.071] (EE) Screen(s) found, but none have a usable configuration.

"What happens if you try the modesetting driver instead?"
Do you mean 
kld_list="/boot/modules/radeonkms.ko"
in /etc/rc.conf ?
That I am already using.

THEN I had the good idea to do eaxctly what the Handbook says about old xorg.conf files, I removed
/etc/X11/xorg.conf
and
/usr/local/etc/X11/xorg.conf

Then startx gives kernel panic, and reset button have to be used to get my computer started.
Since I am doing all this remotely via ssh, I cannot try this many times. I have to call a person at my work to press the reset button. I do not have the details what the sysconsole said about the panic. I have to be at work to continue experiments. Unless you have a good tip to avoid kernel panic.
Comment 7 Niclas Zeising freebsd_committer 2020-04-24 20:31:35 UTC
(In reply to Anders Liljeborg from comment #6)

The modesetting driver is in X.  If you don't have xf86-video-ati installed, it should be used automatically.  I don't know if it works with drm-legacy-kmod though.

In order to know what's going on, we need the backtrace from the panic.  Is the dmesg from using drm-legacy-kmod or drm-fbsd12.0-kmod?

Is there any particular reason you're using i386?  Can you try on amd64 and see if it works better?
Comment 8 Alexey Dokuchaev freebsd_committer 2020-04-25 13:19:34 UTC
(In reply to Niclas Zeising from comment #7)
> The modesetting driver is in X.  If you don't have xf86-video-ati installed,
> it should be used automatically.  I don't know if it works with
> drm-legacy-kmod though.
For me on AMD A8-5550M, modesetting driver does not work with any drm-* ports (including legacy), producing garbage on the screen and constantly spamming the console with "radeon: The kernel rejected CS, see dmesg for more information (-16)" messages.  When I'd have a chance, I'll try that on i386+RV710 if it makes any difference, against both new and previous X.Org server versions.

> Is there any particular reason you're using i386?
Judging by old trusty RV710 of mine which gives me perfect X.Org experience on i386 (probably even better than on amd64), Anders may be happier with i386+RV515 combo as well. :-)
Comment 9 Anders Liljeborg 2020-04-28 13:17:19 UTC
Created attachment 213885 [details]
Boot messages, reboot after kernel panic
Comment 10 Anders Liljeborg 2020-04-28 13:25:54 UTC
(In reply to Niclas Zeising from comment #7)

I have xf86-ati-video installed.
I have drm-fsbd12.0-kmod installed.
It was like this when the kernel panic happened.

1002:SU:dataserv:anders> pkg info | grep xf86-video
xf86-video-ati-19.1.0_2,1      X.Org ati display driver
xf86-video-scfb-0.0.4_7        X.Org syscons display driver
xf86-video-vesa-2.4.0_2        X.Org vesa display driver
1003:SU:dataserv:anders> pkg info | grep drm
drm-fbsd12.0-kmod-4.16.g20200221 DRM modules for the linuxkpi-based KMS components
libdrm-2.4.99,1                Userspace interface to kernel Direct Rendering Module services

I have extracted the boot messages from the reboot right after the kernel panic, they are in the attachment. since the computer have been running for a while (I need it for some mailserver function) I used /var/log/messages.0.bz2 to extract.

i386 or adm64, forgive my ignorance, do you mean to switch the installation altogether?

I do not know how to do this and keep the user filesystem intact.
Comment 11 Anders Liljeborg 2020-05-07 12:54:49 UTC
Created attachment 214232 [details]
Photo of screen after kernel panic

I tried "startx" while at the computer, took photo of screen after kernel panic, see jpg-image.

Before this trial I removed all xorg.conf files and contents of xorg.confd,
according to FreeBSD handbook.

/etc/X11/
/etc/X11/xorg.confd
/usr/local/etc/X11/
/usr/local/etc/X11/xorg.confd
/usr/local/share/X11/
/usr/local/share/X11/xorg.confd
No valid files in these folders.

As normal user:
> startx
Screen goes black, short flash of random patterns at lower quarter of screen, then kernel panic,
takes about two seconds.

Background on how I upgrade FreeBSD, I use freebsd-update, first I check that current version is fully updated.
Then:
> freebsd-update -r 12.1 upgrade
> /usr/sbin/freebsd-update install
Reboot
Again:
> /usr/sbin/freebsd-update install

After that I remove all packages and clear /var/cache/pkg
Then I install all packages I need using pkg install XXXX.
I never try to compile any port, I have had really bad experiences of this in the past.

Any help is really appreciated.
Best wishes
Anders