evadot / drm-subtree

WIP drm drivers for FreeBSD
15 stars 9 forks source link

Failed to open device: '/dev/dri/card0': No such file or directory #25

Closed staropram closed 2 years ago

staropram commented 2 years ago

I'm using an RK3399 base board called the RockPi 4C. Freebsd 14.0-CURRENT is installed and your drm-subtree patches applied as instructed in the README.

I've managed to build everything, install the kernel and world and boot:

$ dmesg | grep pan
panfrost0: <Mali Midgard/Bifrost GPU> mem 0xff9a0000-0xff9affff irq 69,70,71 on ofwbus0
panfrost0: Mali GPU clock rate 500000000 Hz
panfrost0: GPU revision 2000, id 860
panfrost0: Mali 860, major 2, minor 0, status 0
panfrost0: Features: L2 7120206, Shader 0, Tiler 809, Mem 1, MMU 2830, AS ff, JS 7
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: GPU is powered on
panfrost0: panfrost_gpu_intr: pending 20000
[drm] Initialized panfrost 1.2.0 20201124 for panfrost on minor 1

The device nodes are created:

$ ls -l /dev/dri/*
crw-rw----  1 root  video  0x56 Apr 19 19:20 /dev/dri/card0
crw-rw----  1 root  video  0x58 Apr 19 19:20 /dev/dri/card1
crw-rw----  1 root  video  0x57 Apr 19 19:20 /dev/dri/renderD128

I'm in the necessary groups:

$ groups me
me wheel operator video

However, sway (or any other wayland compositor implementation) won't start:

$ sway
00:00:00.034 [ERROR] [wlr] [backend/session/session.c:322] Failed to open device: '/dev/dri/card0': No such file or directory
00:00:00.035 [ERROR] [wlr] [backend/session/session.c:322] Failed to open device: '/dev/dri/card1': No such file or directory
00:00:00.035 [ERROR] [wlr] [backend/backend.c:217] Found 0 GPUs, cannot create backend
00:00:00.035 [ERROR] [wlr] [backend/backend.c:386] Failed to open any DRM device
00:00:00.037 [ERROR] [sway/server.c:56] Unable to create backend

Am I missing something obvious here?

bukinr commented 2 years ago

I'm using latest wlroots from master branch. Did you try? Mesa must be the same version as in ports. Also you may need these patches

https://people.freebsd.org/~br/mesa3d_panfrost.patch (only for G76 GPU) https://people.freebsd.org/~br/drm_hack_panfrost.patch https://people.freebsd.org/~br/seatd_dri.patch https://people.freebsd.org/~br/wlroots.patch https://people.freebsd.org/~br/patch.firefox.txt

staropram commented 2 years ago

Thank you I will try that.

bukinr commented 2 years ago

these may also be needed

#!/bin/sh
export XDG_RUNTIME_DIR=/tmp/wl
mkdir -p /tmp/wl
sudo chmod 0700 /tmp/wl
sudo chmod 0777 /var/run/seatd.sock
sudo chmod 0777 /dev/dri/*
sudo chmod 0777 /dev/input/*
staropram commented 2 years ago

Thanks. I gave it a try with sway, wlroots, and seatd compiled from git. The seatd patch gets rid of the "failed to open device" issue because of the /dev/drm vs /dev/dri difference. Sway will actually start, but I had some other wlroots related errors that prevented any application starting. I will close off this issue since that particular issue is solved. I'll dig more into the other issues to see if I can figure out what is going on. Thanks.