# drm-next-kmod and 11.2-RELEASE



## Maccraft123 (Jun 27, 2018)

Hello,

I have a problem with drm-next-kmod and mine GPU, Radeon RX 460
Currently I am running with xf86-video-vesa driver and software rendering
Dmesg output:

```
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017
    root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
VT(vga): resolution 640x480
CPU: AMD Phenom(tm) 9650 Quad-Core Processor (2300.06-MHz K8-class CPU)
  Origin="AuthenticAMD"  Id=0x100f23  Family=0x10  Model=0x2  Stepping=3
  Features=0x178bfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,MMX,FXSR,SSE,SSE2,HTT>
  Features2=0x802009<SSE3,MON,CX16,POPCNT>
  AMD Features=0xee500800<SYSCALL,NX,MMX+,FFXSR,Page1GB,RDTSCP,LM,3DNow!+,3DNow!>
  AMD Features2=0x7ff<LAHF,CMP,SVM,ExtAPIC,CR8,ABM,SSE4A,MAS,Prefetch,OSVW,IBS>
  SVM: NP,NAsids=64
  TSC: P-state invariant
real memory  = 6442450944 (6144 MB)
avail memory = 6174670848 (5888 MB)
Event timer "LAPIC" quality 100
ACPI APIC Table: <041311 APIC1110>
FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs
FreeBSD/SMP: 1 package(s) x 4 core(s)
random: unblocking device.
ioapic0 <Version 1.1> irqs 0-23 on motherboard
SMP: AP CPU #1 Launched!
SMP: AP CPU #2 Launched!
SMP: AP CPU #3 Launched!
Timecounter "TSC-low" frequency 1150029737 Hz quality 800
random: entropy device external interface
kbd1 at kbdmux0
netmap: loaded module
module_register_init: MOD_LOAD (vesa, 0xffffffff80f5b220, 0) error 19
nexus0
vtvga0: <VT VGA driver> on motherboard
cryptosoft0: <software crypto> on motherboard
acpi0: <041311 RSDT1110> on motherboard
acpi0: Power Button (fixed)
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
cpu2: <ACPI CPU> on acpi0
cpu3: <ACPI CPU> on acpi0
hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed00fff irq 2,8 on acpi0
Timecounter "HPET" frequency 25000000 Hz quality 950
attimer0: <AT timer> port 0x40-0x43 on acpi0
Timecounter "i8254" frequency 1193182 Hz quality 0
Event timer "i8254" frequency 1193182 Hz quality 100
atrtc0: <AT realtime clock> port 0x70-0x71 on acpi0
Event timer "RTC" frequency 32768 Hz quality 0
Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x2008-0x200b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pcib0: _OSC returned error 0x10
pci0: <ACPI PCI bus> on pcib0
pci0: <memory, RAM> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> port 0x2f00-0x2fff at device 1.0 on pci0
isa0: <ISA bus> on isab0
pci0: <memory, RAM> at device 1.2 (no driver attached)
pci0: <processor> at device 1.3 (no driver attached)
pci0: <memory, RAM> at device 1.4 (no driver attached)
ohci0: <OHCI (generic) USB controller> mem 0xfbd7e000-0xfbd7efff irq 22 at device 2.0 on pci0
usbus0 on ohci0
usbus0: 12Mbps Full Speed USB v1.0
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xfbd7fc00-0xfbd7fcff irq 23 at device 2.1 on pci0
usbus1: EHCI version 1.0
usbus1 on ehci0
usbus1: 480Mbps High Speed USB v2.0
ohci1: <OHCI (generic) USB controller> mem 0xfbd7d000-0xfbd7dfff irq 20 at device 4.0 on pci0
usbus2 on ohci1
usbus2: 12Mbps Full Speed USB v1.0
ehci1: <EHCI (generic) USB 2.0 controller> mem 0xfbd7f800-0xfbd7f8ff irq 21 at device 4.1 on pci0
usbus3: EHCI version 1.0
usbus3 on ehci1
usbus3: 480Mbps High Speed USB v2.0
atapci0: <nVidia nForce MCP77 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xffa0-0xffaf at device 6.0 on pci0
ata0: <ATA channel> at channel 0 on atapci0
ata1: <ATA channel> at channel 1 on atapci0
hdac0: <NVIDIA MCP78 HDA Controller> mem 0xfbd78000-0xfbd7bfff irq 22 at device 7.0 on pci0
pcib1: <ACPI PCI-PCI bridge> at device 8.0 on pci0
pci1: <ACPI PCI bus> on pcib1
ath0: <Atheros 9220> mem 0xfbef0000-0xfbefffff irq 19 at device 6.0 on pci1
ath0: [HT] enabling HT modes
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 stream STBC transmit enabled
ath0: [HT] 2 RX streams; 2 TX streams
ath0: Enabling register serialisation
ath0: AR9220 mac 128.2 RF5133 phy 13.0
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x00c0
ahci0: <NVIDIA MCP77 AHCI SATA controller> port 0xd480-0xd487,0xd400-0xd403,0xd080-0xd087,0xd000-0xd003,0xcc00-0xcc0f mem 0xfbd76000-0xfbd77fff irq 23 at device 9.0 on pci0
ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier supported
ahci0: quirks=0x200<NOAA>
ahcich0: <AHCI channel> at channel 0 on ahci0
ahcich1: <AHCI channel> at channel 1 on ahci0
ahcich2: <AHCI channel> at channel 2 on ahci0
ahcich3: <AHCI channel> at channel 3 on ahci0
ahcich4: <AHCI channel> at channel 4 on ahci0
ahcich5: <AHCI channel> at channel 5 on ahci0
nfe0: <NVIDIA nForce MCP77 Networking Adapter> port 0xc880-0xc887 mem 0xfbd7c000-0xfbd7cfff,0xfbd7f400-0xfbd7f4ff,0xfbd7f000-0xfbd7f00f irq 20 at device 10.0 on pci0
miibus0: <MII bus> on nfe0
e1000phy0: <Marvell 88E1111 Gigabit PHY> PHY 1 on miibus0
e1000phy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow
nfe0: Using defaults for TSO: 65518/35/2048
nfe0: Ethernet address: 00:24:8c:6b:5d:50
pcib2: <ACPI PCI-PCI bridge> irq 16 at device 16.0 on pci0
pci2: <ACPI PCI bus> on pcib2
vgapci0: <VGA-compatible display> port 0xe000-0xe0ff mem 0xd0000000-0xdfffffff,0xcfe00000-0xcfffffff,0xfbf80000-0xfbfbffff irq 16 at device 0.0 on pci2
vgapci0: Boot video device
hdac1: <ATI (0xaae0) HDA Controller> mem 0xfbffc000-0xfbffffff irq 17 at device 0.1 on pci2
pcib3: <ACPI PCI-PCI bridge> irq 17 at device 19.0 on pci0
pci3: <ACPI PCI bus> on pcib3
pcib4: <ACPI PCI-PCI bridge> irq 18 at device 20.0 on pci0
pci4: <ACPI PCI bus> on pcib4
acpi_button0: <Power Button> on acpi0
fdc0: <floppy drive controller (FDE)> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
ppc0: cannot reserve I/O port range
hwpstate0: <Cool`n'Quiet 2.0> on cpu0
Timecounters tick every 1.000 msec
nvme cam probe device init
hdacc0: <VIA VT1708S_0 HDA CODEC> at cad 0 on hdac0
hdaa0: <VIA VT1708S_0 Audio Function Group> at nid 1 on hdacc0
pcm0: <VIA VT1708S_0 (Analog 7.1+HP/2.0)> at nid 28,34,25,35,29 and 26,31,30,27 on hdaa0
pcm1: <VIA VT1708S_0 (Rear-panel Digital)> at nid 32 on hdaa0
pcm2: <VIA VT1708S_0 (Rear-panel Digital)> at nid 33 on hdaa0
hdacc1: <NVIDIA MCP78 HDA CODEC> at cad 3 on hdac0
hdaa1: <NVIDIA MCP78 Audio Function Group> at nid 1 on hdacc1
pcm3: <NVIDIA MCP78 (Digital)> at nid 5 on hdaa1
hdacc2: <ATI R6xx HDA CODEC> at cad 0 on hdac1
hdaa2: <ATI R6xx Audio Function Group> at nid 1 on hdacc2
pcm4: <ATI R6xx (HDMI)> at nid 3 on hdaa2
pcm5: <ATI R6xx (HDMI)> at nid 5 on hdaa2
pcm6: <ATI R6xx (HDMI)> at nid 7 on hdaa2
pcm7: <ATI R6xx (HDMI)> at nid 9 on hdaa2
pcm8: <ATI R6xx (HDMI)> at nid 11 on hdaa2
ugen0.1: <nVidia OHCI root HUB> at usbus0
ugen1.1: <nVidia EHCI root HUB> at usbus1
ugen2.1: <nVidia OHCI root HUB> at usbus2
ugen3.1: <nVidia EHCI root HUB> at usbus3
uhub0: <nVidia OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
uhub2: <nVidia OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
uhub3: <nVidia EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
uhub1: <nVidia EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus1
ada0 at ahcich2 bus 0 scbus4 target 0 lun 0
ada0: <WDC WD5000BPVT-22HXZT3 01.01A01> ATA8-ACS SATA 2.x device
ada0: Serial Number WD-WX41C32R2460
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: Command Queueing enabled
ada0: 476940MB (976773168 512 byte sectors)
ada0: quirks=0x1<4K>
Trying to mount root from ufs:/dev/ada0s1a [rw]...
uhub0: 6 ports with 6 removable, self powered
uhub2: 6 ports with 6 removable, self powered
uhub1: 6 ports with 6 removable, self powered
uhub3: 6 ports with 6 removable, self powered
KLD drm.ko: depends on kernel - not available or version mismatch
linker_load_file: Unsupported file type
KLD amdgpu.ko: depends on drmn - not available or version mismatch
linker_load_file: Unsupported file type
ugen2.2: <SEM USB Keyboard> at usbus2
ukbd0 on uhub2
ukbd0: <SEM USB Keyboard, class 0/0, rev 1.10/1.10, addr 2> on usbus2
kbd2 at ukbd0
ugen0.2: <A4TECH USB Device> at usbus0
ukbd1 on uhub0
ukbd1: <A4TECH USB Device, class 0/0, rev 1.10/2.74, addr 2> on usbus0
kbd3 at ukbd1
wlan0: Ethernet address: 94:0c:6d:c5:15:87
wlan0: link state changed to UP
nfe0: link state changed to DOWN
uhid0 on uhub2
uhid0: <SEM USB Keyboard, class 0/0, rev 1.10/1.10, addr 2> on usbus2
ums0 on uhub0
ums0: <A4TECH USB Device, class 0/0, rev 1.10/2.74, addr 2> on usbus0
ums0: 16 buttons and [XYZ] coordinates ID=0
```


----------



## Maccraft123 (Jun 27, 2018)

System was installed yesterday, just installed XOrg, SLiM and Xfce.
Specs:
GPU: AMD Radeon RX 460(Polaris)
CPU: AMD Phenom X4 9650(4x2,3GHz)
Motherboard: ASUS M4N78 PRO
RAM: 6GB DDR2
Screen: 1366x768@60Hz


----------



## SirDice (Jun 27, 2018)

Maccraft123 said:


> I have a problem with drm-next-kmod and mine GPU, Radeon RX 460


It would help immensely if you told us what the problem actually is.


----------



## Maccraft123 (Jun 27, 2018)

I can't get it amdgpu module to run,
I have drm-next-kmod compiled(had to edit Makefiles)
When I try to `kldload amdgpu` it outputs:
`kldload: an error occurred while loading the module. Please check dmesg(8) for more details.`
Dmesg shows then:

```
KLD amdgpu.ko: depends on drmn - not available or version mismatch
linker_load_file: Unsupported file type
```


----------



## shkhln (Jun 27, 2018)

Have you tried drm-stable-kmod?


----------



## SirDice (Jun 27, 2018)

Maccraft123 said:


> I have drm-next-kmod compiled(had to edit Makefiles)


Editing a Makefile is never needed, what exactly did you change?


----------



## Maccraft123 (Jun 27, 2018)

SirDice
I commented out version check, both graphics/drm-stable-kmod and graphics/gpu-firmware-kmod failed to compile becouse:
`not supported on 11.1 or older, no kernel support.`
It looked like outdated Makefile
`Uname -aU` shows
`FreeBSD maciek 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017     root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64 1101001`


----------



## SirDice (Jun 27, 2018)

There's a reason why the port has version checks, they only work on 11.2 and higher. FreeBSD 11.1 and lower are missing a few vital kernel changes.


----------



## Maccraft123 (Jun 27, 2018)

`freebsd-update -r 11.2-RC3 upgrade` downloads 11.1-RELEASE


----------



## scottro (Jun 27, 2018)

11.2-RELEASE is already out. I'm not sure about FreeBSD-update but if you checkout source from <yoursvnserver>/base/releng/11.2 it will build 11.2-RELEASE


----------



## SirDice (Jun 27, 2018)

Yeah, there's no official notice yet (they're waiting for the mirrors to catch-up) but it should be available already. 

`freebsd-update -r 11.2-RELEASE upgrade`


----------



## Maccraft123 (Jun 27, 2018)

I'm now upgrading OS to 11.2-RELEASE


----------



## Maccraft123 (Jun 27, 2018)

I'm on FreeBSD 11.2-RELEASE, i will try to `kldload amdgpu` and post results


----------



## SirDice (Jun 27, 2018)

Restore the port first (undo your changes), and rebuild it. Your currently installed version is linked to 11.1 and may cause further problems because of it.


----------



## Maccraft123 (Jun 27, 2018)

I did it, and It Works! And why there is no xf86-video-amgpu?
EDIT: It's in ports


----------



## Maccraft123 (Jun 27, 2018)

Loading amdgpu module doesn't work when OS boots


----------



## Maccraft123 (Jun 27, 2018)

Now it doesn't work at all


----------



## scottro (Jun 27, 2018)

It may need some special setup. If you've left the forums you won't see this, but if you run pkg info -D drm-next-kmod you get some information about adding users to the video group and and lines to /etc/rc.conf.  (I'm not at all familiar with the AMD cards, so don't know if that's your problem.)

It can be frustrating when compared to Linux, as driver support and documentation are often lacking or out of date.  The drm-next-stuff is relatively new and aimed at the just released 11.2-RELEASE so the various how tos by individual users aren't out there yet.


----------



## Maccraft123 (Jun 28, 2018)

I was in video group, root too.
I added amdgpu module loader to /etc/rc.conf


----------



## k.jacker (Jun 28, 2018)

Maccraft123 said:


> Loading amdgpu module doesn't work when OS boots





Maccraft123 said:


> I added amdgpu module loader to /etc/rc.conf



Please, calm down and take your time to tell us what you tried to make it work. It's obvious your stressed out, but that doesn't get you anywhere.
E.g. what exactly did you you add to /etc/rc.conf? If it's wrong, it won't work.


----------



## Maccraft123 (Jun 29, 2018)

I added kld_list="amdgpu", `kldload amdgpu > output` gives empty file, `kldload amdgpu; dmesg | tail > output` also gives empty file


----------



## sidetone (Jun 29, 2018)

Do you have kernel sources installed? You need that, before you build drm kmod ports.
In x11-drivers/xorg-drivers, do you have AMDGPU and ATI set? Those must be built.


----------



## Maccraft123 (Jun 29, 2018)

I had only built x11-drivers/xf86-video-amdgpu, how do i download kernel sources?


----------



## Maccraft123 (Jun 29, 2018)

I installed FreeBSD again, and could someone help me setting it up the right way?


----------



## scottro (Jun 29, 2018)

For me, living in NYC


```
cd /usr
svnlite co https://svn0.us-east.freebsd.org/base/releng/11.2 /usr/src
```
The svnlite program comes with the system, and does things such as svn checkout (the co).

The next part is which svn server you're using, for me on the east coast of the US, that's closest, you can look for FreeBSD svn mirrors.  The next part, /base/releng/11.2 is the source code you want and the /usr/src means that's where you'll be putting what you checked out. 

The wonkity.com site has a good article on using it to update the entire system at http://www.wonkity.com/~wblock/docs/html/buildworld.html but in this case, it isn't necessary, you just want the source code in /usr/src so that the port can use it.


----------



## Maccraft123 (Jun 29, 2018)

I checked "src" option, and I have FreeBSD source in /usr/src/


----------



## Maccraft123 (Jun 29, 2018)

It's time to fetch ports tree and compile drm-next-kmod? I have clean OS, and I know Linux well


----------



## Maccraft123 (Jun 29, 2018)

Now with new OS still doesnt work


----------



## scottro (Jun 29, 2018)

This isn't very clear.  You have downloaded /usr/src, so in src you have various directories and files.
You have downloaded ports so you have a /usr/ports/tree.
You then tried to install drm-next-kmod.  As far as you can see, did it install successfully? You are using 11.2, correct?
You followed the pkg-msg, making yourself a member of the video group.  

```
pw groupmod video -m scottro
```
  Obviously, use your own user name rather than scottro.  

In /etc/rc.conf you added the line

```
kld_list="/boot/modules/radeonkms.ko"
```
Did you then restart and the system failed to boot?  Or startx failed to start?

Were there error messges?  Anything towards the end of /var/log/Xorg.0  

I have no experience with Radeon in FreeBSD since 4.x I think, so can't be that much help.


----------



## Maccraft123 (Jun 29, 2018)

Yes, but I didn't add that line in /etc/rc.conf(I knew if loading amdgpu fail, i couldn't boot OS at all).
I am loading amdgpu module just from root shell
No, i didn't launch Xorg.
It fails right away after `kldload amdgpu`
I managed to get dmesg after I loaded amdgpu module:
Logs(In Pastebin)


----------



## Maccraft123 (Jun 29, 2018)

It seems like bug in kernel module, trying to load unexistent file


----------



## Maccraft123 (Jun 30, 2018)

New Logs!
It now loads firmware, but spams  failed to send message 26a ret is 0
https://pastebin.com/yMHZxYyh


----------



## abishai (Jul 1, 2018)

error 2 is normal situation, firmware is getting loaded eventually.
Is it UEFI system ? I believe, syscons should be disabled with hw.syscons.disable=1 in /boot/loader.conf (You won't get screen output before driver loads)


----------



## Maccraft123 (Jul 1, 2018)

No, it isn't UEFI


----------



## puretone (Sep 4, 2018)

Maccraft123 said:


> No, it isn't UEFI



Don't mix different versions/sources.
I have gotten the exact same GPU you use to work just fine in 12.x (will work fine on 11.2 too I suspect), granted it was on a Westmere/Haswell/SkyLake/KabyLake/SkyLake-X box.
First and foremost the x11-drivers/xf86-video-(blah) are not to be used with the new generation DRM kernel modules/hardware.
The graphics/drm-next-kmod (or the now-ignored graphics/drm-stable-kmod) supersede the graphics card offerings from x11-drivers xf86-video-* drivers
You will probably want something close to bleeding-edge for best results with this card.
So SVN will pretty much be required.

`# svn co https://svn.freebsd.org/base/head /usr/src` && `# svn co https://svn.freebsd.org/ports/head /usr/ports`

(in case you are using 11.2, you will want to use `svn co https://svn.freebsd.org/base/release/11.2.0 /usr/src` and so forth)

Next you will be doing a `# make buildworld` etc, followed by some beer, a dinner date with your gf, a movie and perhaps some bedroom acrobatics. Unless you are more wise and simply keep a pet cat for entertainment. Either way it will take a while to build the whole mess. This is your guide: https://www.freebsd.org/doc/handbook/makeworld.html
Rebuild the DRM modules, `/usr/ports/graphics/drm-next-kmod/ # make clean install`

If you square all that away, and successfully build/install/boot, you'll need to KLD load some modules for basic operation.
Adjust /etc/rc.conf to suit your needs. The `kld_list="....."` is the *only* way you want to do this. Leave /boot/loader.conf the hell alone! `kld_list="linux linux64 amdgpu"` for basic functionality. Adjust for /boot/modules/i915kms.ko (for Intel GPU) or radeonkms (for something you mistakenly stole, believing it to be a valuable trinket, from an archeology museum) as needed.

Getting AMD GPUs to work, as the plethora of guides indicate, will *only* work in BIOS mode, *not* in UEFI mode; I've had no success --ever-- with UEFI and varying AMD GPUs. The system console will need to be either SC or VT, depending on what hardware you got.


----------



## shkhln (Sep 4, 2018)

puretone said:


> The graphics/drm-next-kmod (or the now-ignored graphics/drm-stable-kmod) supersede the graphics card offerings from x11-drivers xf86-video-* drivers



Kernel drivers can't supersede Xorg drivers, you need both types of drivers to function. Unless you are using Wayland, of course, then you don't need Xorg-anything.


----------



## puretone (Sep 4, 2018)

shkhln said:


> Kernel drivers can't supersede Xorg drivers, you need both types of drivers to function. Unless you using Wayland, of course, then you don't need Xorg-anything.



Nope. I'm typing from a laptop right now that only contains xorg-minimal, drm-next-kmod a few xf86-input odds & ends and *NO* xf86-video-* of any sort.


----------



## shkhln (Sep 4, 2018)

Interesting... Can you post your Xorg log? That might actually be the generic modesetting driver, in which case at least 3d acceleration wouldn't work.


----------



## shkhln (Sep 4, 2018)

shkhln said:


> 3d acceleration wouldn't work.



Ok, I take that back. This is _supposed_ to work as well.


----------



## Maccraft123 (Sep 21, 2018)

I don't have a gf. Too lazy for for compiling everything. Worked once with graphics/drm-devel-kmod, then 5 days worked with it, update and BOOM don't work. I will have my computer back at 29th


----------



## puretone (Sep 25, 2018)

shkhln said:


> Interesting... Can you post your Xorg log? That might actually be the generic modesetting driver, in which case at least 3d acceleration wouldn't work.





shkhln said:


> Ok, I take that back. This is _supposed_ to work as well.



Behold! This is on a SkyLake Xeon E3-1275v5 workstation:

https://pastebin.com/v2wwGkwN

Note how I do not even keep vesa or scfb around. There is *no* custom xorg.conf on this machine...anywhere. Everything auto-probed & added. Unix desktop window manager-porn provided by compton (or the mummified xcompmgr).


----------



## puretone (Sep 25, 2018)

Maccraft123 said:


> I don't have a gf. Too lazy for for compiling everything. Worked once with graphics/drm-NEXT-kmod, then 5 days worked with it, update and BOOM don't work. I will have my computer back at 29th



Of course you killed it....this is expected when you mix up versions/releases/binary pkgs/source; also why I provided the procedure in my previous message(s).
If you do *not* do a buildworld & installworld you will end up with mismatched versions of everything. If you svn only /usr/src and not /usr/ports or vice versa, you end up with mismatched fixes, patches, bugs & crashes.
I'm relatively lazy on select things as well, but doing an `# svn up /usr/src` & `# svn up /usr/ports` amounts to barely lifting fingers. Doing a buildworld & kernel takes about ~45-60 minutes on a Core i5 or i7 platform and doesn't require supervision; easily done while you have a beauty-rest. The installworld & mergemaster procedures take ~5 mins total. Followed by portmaster'ing graphics/drm-next-kmod takes another ~5mins. Boom-de-yada boom-de-yada the world is all good again!


----------



## sidetone (Sep 26, 2018)

I mix ports and packages all the time, and it works. Use portmaster, then get the list of ports it installs, and cancel the installation. Then install a few of those as packages, depending on if you know those packages don't interfere with the options you need.

For this, I install the package x11-servers/xorg-server, and ports under the lang category provided the latest version is available as packages, then go with portmaster the rest of the way. You can do it, if you keep track, know the pkg options don't interfere with the port options you need, and you may have to be ready to install everything if it changes, which is no different than using ports all the way.

Also, from what I realized, drm-*-kmod is for everything, and is enough for the console (when the driver is loaded through rc.conf). The driver under the xorg driver category is not used for the console, as it works on top of the kernel module and is basically for xorg.


----------



## puretone (Sep 26, 2018)

sidetone said:


> I mix ports and packages all the time, and it works. Use portmaster, then get the list of ports it installs, and cancel the installation. Then install a few of those as packages, depending on if you know those packages don't interfere with the options you need.
> 
> For this, I install the package x11-servers/xorg-server, and ports under the lang category provided the latest version is available as packages, then go with portmaster the rest of the way. You can do it, if you keep track, know the pkg options don't interfere with the port options you need, and you may have to be ready to install everything if it changes, which is no different than using ports all the way.
> 
> Also, from what I realized, drm-*-kmod is for everything, and is enough for the console (when the driver is loaded through rc.conf). The driver under the xorg driver category is not used for the console, as it works on top of the kernel module and is basically for xorg.



Oh indeed you can mix ports/pkgs all you like...but don't expect the miracle of a binary pkg to suddenly work when kernel source is explicitly required, especially when the versions are out of sync. More of a rule-a-thumb thing to follow.
I don't even bother with any xf86-video-<name> drivers anymore these days, drm-next-kmod (in both 11.2 & 12) is sufficiently hardened for my purposes.


----------



## Maccraft123 (Sep 30, 2018)

xf86-video-amdgpu is very good, installed kernel sourced with installation, checked src option in installer


----------



## kpa (Sep 30, 2018)

puretone said:


> Oh indeed you can mix ports/pkgs all you like...but don't expect the miracle of a binary pkg to suddenly work when kernel source is explicitly required, especially when the versions are out of sync.



Mixing ports and packages works to a point but you're limited to doing that with "leaf" ports that are not required by anything else. The recent change in the xproto ports is a good example where you just can't do it because those ports are required by just about any port that uses X11 graphics and if you try to mix up to date ports built by yourself with packages from the point in time before the change all hell is guaranteed to break loose.

Mixing ports and packages when there are different or conflicting options involved is a whole another level of problems.


----------



## nik0tine (Oct 6, 2018)

puretone said:


> (in case you are using 11.2, you will want to use `svn co https://svn.freebsd.org/base/release/11.2.0 /usr/src` and so forth)
> 
> Next you will be doing a `# make buildworld` etc, followed by some beer, a dinner date with your gf, a movie and perhaps some bedroom acrobatics. Unless you are more wise and simply keep a pet cat for entertainment. Either way it will take a while to build the whole mess. This is your guide: https://www.freebsd.org/doc/handbook/makeworld.html
> Rebuild the DRM modules, `/usr/ports/graphics/drm-next-kmod/ # make clean install`
> ...




SIR! I am DOING this! I have a GF & Cat. I soo want my KABINI AMD APU to start working finally!
I will serve you beer if this works! Because I make these... (See attached) only BSD. And I cant exactly fit hardware you see... The cherry wood


----------



## puretone (Oct 7, 2018)

nik0tine said:


> View attachment 5401
> SIR! I am DOING this! I have a GF & Cat. I soo want my KABINI AMD APU to start working finally!
> I will serve you beer if this works! Because I make these... (See attached) only BSD. And I cant exactly fit hardware you see... The cherry wood



Some people are better multi-taskers then others when it comes to juggling gf/cat/life  

Good work. Kabini *should* be supported by graphics/drm-next-kmod I believe.

Side-note: your speakers reminded me of a video I saw on YouTube a while back, check it out:


----------



## kpa (Oct 7, 2018)

puretone said:


> (in case you are using 11.2, you will want to use `svn co https://svn.freebsd.org/base/release/11.2.0 /usr/src` and so forth)



This is wrong, to get the release engineering branch of 11.2 with all the errata and security fixes you have to use:

`svn co https://svn.freebsd.org/base/releng/11.2 /usr/src`

The release/11.2.0 branch is just a snapshot (also called a tag but SVN doesn't have tags, only branches) from the time of the release is never again updated.


----------



## gnath (Oct 7, 2018)

puretone said:


> I don't even bother with any xf86-video-<name> drivers anymore these days, drm-next-kmod (in both 11.2 & 12) is sufficiently hardened for my purposes.


I have only one box with 11-STABLE, now rebuilding. I shall try my luck without xf86-video-* and then build WM & minimal ports except firefox & palemoon. I don't understand the diference of `portsnap` and svn'ing.


----------



## kpa (Oct 7, 2018)

gnath said:


> I have only one box with 11-STABLE, now rebuilding. I shall try my luck without xf86-video-* and then build WM & minimal ports except firefox & palemoon. I don't understand the diference of `portsnap` and svn'ing.



Portsnap gives you only the head branch 1) of the ports tree with its own update tracking system. With SVN you can checkout and update any of the quarterly branches  2) as well. You have to choose to use only one of the methods because you can't update a ports tree checked out with portsnap(8) with SVN and vice versa.

1) https://svnweb.freebsd.org/ports/head/
2) https://svnweb.freebsd.org/ports/branches/


----------



## nik0tine (Oct 8, 2018)

I have made it to the other side! Thank you both.
Now I am trying to figure out how to boot in bios mode, I tried many experiments in uefi, but got as far as the fourth or fifth .bin module loading. But I guess it's time for grub?


----------



## nik0tine (Oct 8, 2018)

Op, you gotta try this svn business! It's really the cat's meow!


----------



## puretone (Oct 8, 2018)

nik0tine said:


> I have made it to the other side! Thank you both.
> Now I am trying to figure out how to boot in bios mode, I tried many experiments in uefi, but got as far as the fourth or fifth .bin module loading. But I guess it's time for grub?



Your GPU is AMD...

The drm-next-kmod port can be enabled for amdgpu (for AMD GPUs starting with
the HD7000 series / Tahiti) through kld_list in /etc/rc.conf. radeonkms for older AMD GPUs
can be loaded and there are some *positive reports if EFI boot is NOT enabled* (similar to amdgpu).

For amdgpu: kld_list="amdgpu"

Please ensure that all users requiring graphics are members of the "video" group.

So set your configuration to boot in BIOS mode, *not* UEFI.


----------



## puretone (Oct 8, 2018)

kpa said:


> This is wrong, to get the release engineering branch of 11.2 with all the errata and security fixes you have to use:
> 
> `svn co https://svn.freebsd.org/base/releng/11.2 /usr/src`
> 
> The release/11.2.0 branch is just a snapshot (also called a tag but SVN doesn't have tags, only branches) from the time of the release is never again updated.



Indeed, my mistake. I need to make the habit of proof-reading a bit more of a priority.


----------



## nik0tine (Oct 8, 2018)

puretone said:


> Your GPU is AMD...
> 
> So set your configuration to boot in BIOS mode, *not* UEFI.


That's just it! How? Do I trash the boot partition and start over? I have UEFI currently...


----------



## nik0tine (Oct 8, 2018)

*puretone* you rascal! 
I am ON UEFI & AMD KABINI Running accelerated!!
I sent hw.syscons on vacation in /boot/loader.conf

```
hw.syscons.disable=1
```

FYI your "mistake" about the svn co https://svn.freebsd.org/base/releng/11.2 /usr/src
url was USED and is working, therefore no mistake! Ill bet if i got the releng I would have had success, but I am GLAD I didn't. I didn't want to screw my ports up... (lotsa /work builds would have gone up in smoke)

So I like La Trappe, what's your beer?


puretone said:


> Indeed,


I owe you man!


----------



## gnath (Oct 11, 2018)

gnath said:


> I shall try my luck without xf86-video-* and then build WM & minimal ports


It is good now that xf86-video-* are not required if drm-*-kmod is used. Option for drm-kmod may be included in x11-drivers/xorg-drivers.


----------



## puretone (Oct 12, 2018)

nik0tine said:


> FYI your "mistake" about the svn co https://svn.freebsd.org/base/releng/11.2 /usr/src
> url was USED and is working, therefore no mistake! Ill bet if i got the releng I would have had success, but I am GLAD I didn't. I didn't want to screw my ports up... (lotsa /work builds would have gone up in smoke)
> 
> So I like La Trappe, what's your beer?
> ...



If the BIOS doesn't make it specifically obvious how to "disable" UEFI, it is usually achieved by setting CSM (Compatibility Support Module) enabled...which you'll have to look at your specific device's documentation.

-RELEASE and -RELENG should both work when it comes to using the drm-next-kmod drivers at this point in time, hence why it would work...you'd just be missing/behind on some security updates and fixes.

Unibroue - Maudite is my favorite beer of choice lately (more like 10+ years now). Trois Pistoles & La Fin Du Monde are great as well.


----------



## puretone (Oct 12, 2018)

gnath said:


> It is good now that xf86-video-* are not required if drm-*-kmod is used. Option for drm-kmod may be included in x11-drivers/xorg-drivers.



It might not be an entirely bad idea to keep xf86-video-scfb around in case things go pear-shaped.


----------



## nik0tine (Oct 13, 2018)

> in case things go pear-shaped


like my ex?


----------



## puretone (Oct 13, 2018)

nik0tine said:


> like my ex?



If that's the sort of thing you are in to....


----------



## fernandel (Oct 13, 2018)

> So set your configuration to boot in BIOS mode, *not* UEFI.


What if you do not have a BIOS? I have FreeBSD on iMac.


----------



## nik0tine (Oct 16, 2018)

fernandel said:


> What if you do not have a BIOS? I have FreeBSD on iMac.



forget the uefi, just go to /boot/loader.conf and write `hw.syscons.disable=1` in cursive
also, if you have intel graphics, `kld_list="i915kms"` inside /etc/rc.conf line one, very beginning.
The first action disables efifb (UEFI FRAME BUFFER) and the other loads the intel integrated graphics kernel module.
Be sure to get the   graphics/drm-next-kmod port installed first.


----------



## SirDice (Oct 17, 2018)

nik0tine said:


> inside /etc/rc.conf line one, very beginning.


Ordering in rc.conf is irrelevant.


----------



## fernandel (Oct 17, 2018)

nik0tine said:


> forget the uefi, just go to /boot/loader.conf and write `hw.syscons.disable=1` in cursive
> also, if you have intel graphics, `kld_list="i915kms"` inside /etc/rc.conf line one, very beginning.
> The first action disables efifb (UEFI FRAME BUFFER) and the other loads the intel integrated graphics kernel module.
> Be sure to get the   graphics/drm-next-kmod port installed first.


I have a Radeon card (Mobility Radeon HD 4850) and it is old. I will try Linux and if works there.


----------



## nik0tine (Oct 17, 2018)

fernandel said:


> I have a Radeon card (Mobility Radeon HD 4850) and it is old. I will try Linux and if works there.


no linux!! i have been down that road, leads to nothing.
just kld_list="amdgpu" or "radeon" in /etc/rc.conf.
here is mine: kld_list="amdgpu" i use this for KABINI.
fiddle with your xorg.conf a little bit because mine did NOT 
	
	



```
X -configure
```
 automatically.


```
Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"                  # [<bool>]
        #Option     "DefaultRefresh"            # [<bool>]
        #Option     "ModeSetClearScreen"        # [<bool>]

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


        BusID       "PCI:0:1:0"
EndSection
```

This section I had to write by hand.


----------



## fernandel (Oct 18, 2018)

I didn't say I will swith to Linux but I will try one live version and see how my gr. card works there.  And today I saw graphics/xf86-video-ati-legacy.

I search  but I didn't find which old Radeon cards are supported with the new ati drivers and dri-next-kmod Thank you.


----------



## nik0tine (Oct 18, 2018)

what imac do you have? like the actual model? (in mac os x Apple menu > system profiler (holding the option button if you have the newer disaster that likes to hide stuff) it should be #1 in the apple menu


----------



## fernandel (Oct 18, 2018)

nik0tine said:


> what imac do you have? like the actual model? (in mac os x Apple menu > system profiler (holding the option button if you have the newer disaster that likes to hide stuff) it should be #1 in the apple menu


iMac 11.1 with ATI Radeon HD 4850 graphics with 512 MB of dedicated GDDR3 memory.
Link: https://everymac.com/systems/apple/imac/specs/imac-core-i7-2.8-27-inch-aluminum-late-2009-specs.html


----------



## nik0tine (Oct 22, 2018)

> iMac 11.1 with ATI Radeon HD 4850 graphics with 512 MB of dedicated GDDR3 memory.


your gpu is considered new, the "radeon" is for older gpu's. No legacy for you.
trial and error: build drm-next-kmod from ports (very important) - deinstall all the xf86-video-* you installed, and follow my steps about no efifb, and try to load amdgpu, radeon. If you make it to root login (no xorg) and you see messages about successful [VT: Replacing driver "vga" with new "fb"] this means you are on the right track. 
These steps get your graphics card recognized, but you have to tweak xorg.conf manually. I will try to do this on my 2008 mac pro, I wanted freeBSD on it a long time,
Also I upgraded to this radeon on a stick a while back so ill try to play this instrument with you soon.
Most probably my kernel drivers will coincide with what you need.
What did the linux liveCD do for you? did you try / any news?


----------



## fernandel (Oct 22, 2018)

nik0tine said:


> your gpu is considered new, the "radeon" is for older gpu's. No legacy for you.
> trial and error: build drm-next-kmod from ports (very important) - deinstall all the xf86-video-* you installed, and follow my steps about no efifb, and try to load amdgpu, radeon. If you make it to root login (no xorg) and you see messages about successful [VT: Replacing driver "vga" with new "fb"] this means you are on the right track.
> These steps get your graphics card recognized, but you have to tweak xorg.conf manually. I will try to do this on my 2008 mac pro, I wanted freeBSD on it a long time,
> Also I upgraded to this radeon on a stick a while back so ill try to play this instrument with you soon.
> ...


Thank you for try to help me but it doesn't works. As you wrote "radeon' is for older gpu and I have Radeon. And I am byuilding all ports, I do not use packages.
For me is the old ATI driver okay and I will stay with them...


Thank you.


----------



## Maccraft123 (Oct 23, 2018)

Worked on -BETA1 with drm-devel-kmod package. Close


----------



## gnath (Oct 25, 2018)

fernandel said:


> ATI Radeon HD 4850 graphics


Radeon GPU are auto detected from base for radeonkms. If not may try by /etc/rc.conf. If still does not work then install graphics/drm-kmod which will eventually install correct module. For UEFI ref. to post #57.


----------



## fernandel (Oct 25, 2018)

gnath said:


> Radeon GPU are auto detected from base for radeonkms. If not may try by /etc/rc.conf. If still does not work then install graphics/drm-kmod which will eventually install correct module. For UEFI ref. to post #57.


I did install graphics/drm-kmod which installed graphics/drm-stable-kmod and graphics/gpu-firmware-kmod.
Than /etc/rc.conf:

```
kld_list="/boot/modules/radeonkms.ko"
```
and in /boot/loader.conf:

```
hw.syscons.disable=1
kern.vty="vt"
```
And after restart never show anythink: black screen. Downgrade ati driver and use kernel driver.
I have FreeBSD 11.2-RELEASE (amd64) and I am using portsnap for updating ports and as I wrote I am using iMac 11,1 - efi boot.


----------



## puretone (Oct 26, 2018)

fernandel said:


> What if you do not have a BIOS? I have FreeBSD on iMac.



Wash it with white spirit & dry it with a match....


----------



## nik0tine (Oct 26, 2018)

don't burn down the house for a few termites bro.


----------



## fernandel (Oct 26, 2018)

nik0tine said:


> What did the linux liveCD do for you? did you try / any news?


I did try live version and I have installed one now too and works without problems.


----------



## gnath (Oct 26, 2018)

fernandel said:


> restart never show anythink


I am not sure about UEFI. You must first ensure of system console with boot screen & find error there. Then start(x) X server with vesa/scfb drivers. The ati legacy driver is new & not properly tested. You probably have used "radeon" driver earlier with dri2. Some time "drm" drivers have it's own issues also.Link/


----------



## Maccraft123 (Oct 26, 2018)

What GPU and does graphics/drm-next-kmod work?


----------



## gnath (Oct 27, 2018)

What I gather, it is intended for post intel HD3000 & ati HD 6800 series.
Some users say it works for some older one without UFEI. Again there were some problems for xf86-video-ati. Still there are some issues for drm. I have browser & video player crashed some time in stable with drm-next-kmod.


----------



## nik0tine (Oct 27, 2018)

> What GPU and does graphics/drm-next-kmod work?


The big 3: ATI RADEON / INTEL INTEGRATED / AMD APU (Integrated into the CPU & Standalone PCI)
stick in rc.conf:
For amdgpu: kld_list="amdgpu"
For Intel: kld_list="/boot/modules/i915kms.ko"
For radeonkms: kld_list="/boot/modules/radeonkms.ko"


----------

