Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
64-bit Raspberry Pi 4 - Xorg [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
Progman3K
l33t
l33t


Joined: 03 Jan 2004
Posts: 773

PostPosted: Thu Sep 29, 2022 2:22 pm    Post subject: 64-bit Raspberry Pi 4 - Xorg [SOLVED] Reply with quote

Hi,

I'm trying to get X working, and in contrast to 32-bit Raspberry Pi 4, in which getting X to work was easy, for some reason for the same hardware running 64 bit software, X doesn't seem to be as easy to set up.

Linux localhost 5.15.32-v8 #1 SMP PREEMPT Tue Sep 27 13:26:30 EDT 2022 aarch64 GNU/Linux

eselect profile list
Available profile symlink targets:
[4] default/linux/arm64/17.0/desktop (stable) *

After some research, it seems that the proper X driver for this platform would be the framebuffer driver, however, even after setting the proper variable in

/etc/portage/make.conf
COMMON_FLAGS="-O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
CHOST="aarch64-unknown-linux-gnu"
LC_MESSAGES=C
ACCEPT_LICENSE="*"
VIDEO_CARDS="fbdev"

Attempting to install the X drivers module doesn't permit building the fbdev driver.

emerge -vDa xorg-drivers
[ebuild R ] x11-base/xorg-drivers-21.1-r1::gentoo INPUT_DEVICES="libinput (-elographics) -evdev (-joystick) (-synaptics) (-vmmouse) (-void) (-wacom)" VIDEO_CARDS="(-amdgpu) (-ast) (-dummy) (-fbdev) -freedreno (-geode) (-i915) (-intel) (-mga) (-nouveau) (-nv) (-nvidia) (-omap) (-qxl) (-r128) (-radeon) (-radeonsi) (-siliconmotion) -tegra -vc4 (-vesa) (-via) (-virtualbox) (-vmware)" 0 KiB

I've checked and for the selected profile, the X, elogind, and dbus USE variables are already set.

What is the proper configuration?
Thanks in advance


Last edited by Progman3K on Sun Oct 02, 2022 7:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 926
Location: Richmond Hill, Canada

PostPosted: Thu Sep 29, 2022 2:42 pm    Post subject: Reply with quote

Since you are using RPI 4, you can set VIDEO_CARDS="vc4 v3d"

your /boot/config.txt should have a line like
Code:
dtoverlay=vc4-fkms-v3d
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Thu Sep 29, 2022 4:10 pm    Post subject: Reply with quote

Progman3K,

What pingtoo said plus a few warts.

Xorg will use the modeset driver.
In addition, you need a few knobs in /dev
Code:
$ ls /dev/rpivid-*
/dev/rpivid-h264mem  /dev/rpivid-hevcmem  /dev/rpivid-intcmem  /dev/rpivid-vp9mem

but ...
To get those entries in /dev config.txt needs enough RAM for the GPU to do its thing. I have
Code:
gpu_mem=256


fbdev used to work too. That's a low value of 'work' as the CPU plots every pixel.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Thu Sep 29, 2022 4:11 pm    Post subject: Reply with quote

Moved from Desktop Environments to Gentoo on ARM.

as its one of these.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 926
Location: Richmond Hill, Canada

PostPosted: Thu Sep 29, 2022 5:35 pm    Post subject: Reply with quote

NeddySeagoon,

what are /dev/rpivid* for?

My setting,
Code:
me@pi-3 ~ $ grep gpu_mem /boot/config.txt
gpu_mem=16

me@pi-3 ~ $ ls -l /dev/rpi*
crw-rw---- 1 root video 239, 0 Dec 31  1969 /dev/rpivid-h264mem
crw-rw---- 1 root video 241, 0 Dec 31  1969 /dev/rpivid-hevcmem
crw-rw---- 1 root video 240, 0 Dec 31  1969 /dev/rpivid-intcmem
crw-rw---- 1 root video 238, 0 Dec 31  1969 /dev/rpivid-vp9mem

me@pi-3 ~ $ uname -a
Linux pi-3.home 5.10.11-v8-p4 #1 SMP PREEMPT Tue Apr 27 18:58:07 -00 2021 aarch64 GNU/Linux

So since my gpu_mem is only 16 does it mean those /dev/rpivid* will not function?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Thu Sep 29, 2022 6:04 pm    Post subject: Reply with quote

pingtoo,

I need to poke about a bit more. I had gpu=16 and had to increase it to 256 to get hardware acceleration to work.

My full /dev is
Code:
Pi4_~arm64 ~ $ ls /dev
ashmem           dm-7       loop2         ppp    random          tty10  tty28  tty45  tty62      vcs2    vcsa8        vhost-vsock
autofs           dm-8       loop3         ptmx   raw             tty11  tty29  tty46  tty63      vcs3    vcsa9        video10
block            dm-9       loop4         pts    rfkill          tty12  tty3   tty47  tty7       vcs4    vcsm-cma     video11
bsg              dma_heap   loop5         ram0   rpivid-h264mem  tty13  tty30  tty48  tty8       vcs5    vcsu         video12
btrfs-control    dri        loop6         ram1   rpivid-hevcmem  tty14  tty31  tty49  tty9       vcs6    vcsu1        video13
bus              fd         loop7         ram10  rpivid-intcmem  tty15  tty32  tty5   ttyAMA0    vcs7    vcsu10       video14
cachefiles       full       loop-control  ram11  rpivid-vp9mem   tty16  tty33  tty50  ttyprintk  vcs8    vcsu11       video15
char             fuse       mapper        ram12  sda             tty17  tty34  tty51  uhid       vcs9    vcsu12       video16
console          gpiochip0  media0        ram13  sda1            tty18  tty35  tty52  uinput     vcsa    vcsu2        video18
cpu_dma_latency  gpiochip1  media1        ram14  sda2            tty19  tty36  tty53  urandom    vcsa1   vcsu3        video20
cuse             gpiomem    media2        ram15  sda3            tty2   tty37  tty54  v4l        vcsa10  vcsu4        video21
disk             gpmctl     mem           ram2   shm             tty20  tty38  tty55  vchiq      vcsa11  vcsu5        video22
dm-0             hwrng      mmcblk0       ram3   snd             tty21  tty39  tty56  vcio       vcsa12  vcsu6        video23
dm-1             input      mmcblk0p1     ram4   stderr          tty22  tty4   tty57  vc-mem     vcsa2   vcsu7        watchdog
dm-2             kmsg       mqueue        ram5   stdin           tty23  tty40  tty58  vcs        vcsa3   vcsu8        watchdog0
dm-3             kvm        net           ram6   stdout          tty24  tty41  tty59  vcs1       vcsa4   vcsu9        zero
dm-4             log        null          ram7   tty             tty25  tty42  tty6   vcs10      vcsa5   vga_arbiter
dm-5             loop0      Pi3_64        ram8   tty0            tty26  tty43  tty60  vcs11      vcsa6   vhci
dm-6             loop1      port          ram9   tty1            tty27  tty44  tty61  vcs12      vcsa7   vhost-net


Maybe I am remembering the wrong /dev nodes?

Eww my Pi is still on Xorg 1.20. Its badly in need of an update.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 926
Location: Richmond Hill, Canada

PostPosted: Thu Sep 29, 2022 6:15 pm    Post subject: Reply with quote

NeddySeagoon,

How to know if my system have hardware acceleration or not? Is there a line or two in Xorg.0.log that indicate hardware acceleration turn on?

I am also on xserver 1.20
Code:
X.Org X Server 1.20.13
X Protocol Version 11, Revision 0
[    36.123] Build Operating System: Linux 5.10.60 aarch64 Gentoo
[    36.123] Current Operating System: Linux pi-3.home 5.10.11-v8-p4 #1 SMP PREEMPT Tue Apr 27 18:58:07 -00 2021 aarch64
[    36.123] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-
1:1920x1080M@60 video=HDMI-A-2:1920x1080M@60 smsc95xx.macaddr=DC:A6:32:6D:16:7B vc_mem.mem_base=0x3f000000 vc_mem.mem_size=0x3f600000  usb-
storage.quirks=125f:a67a:u console=ttyS0,115200 console=tty1 dwc_otg.lpm_enable=0 root=PARTUUID=67e6ea33-02 rootfstype=btrfs fsck.repair=no
 usbhid.mousepoll=0 rootwait=10 init=/sbin/init
[    36.123] Build Date: 12 January 2022  05:43:33PM
[    36.124] 
[    36.124] Current version of pixman: 0.40.0
...
...
...
Back to top
View user's profile Send private message
Progman3K
l33t
l33t


Joined: 03 Jan 2004
Posts: 773

PostPosted: Sun Oct 02, 2022 8:06 pm    Post subject: Reply with quote

pingtoo, neddy,

Thanks! X is working now.

For comparison, I am running package xorg-server-21.1.4

Which is reported in
~/.local/share/xorg/Xorg.0.log
as

X.Org X Server 1.21.1.4
X Protocol Version 11, Revision 0

Full disclosure, I have two rpi units; an rpi 3, and an rpi 4

Both units:
Linux localhost 5.15.32-v8 #1 SMP PREEMPT Tue Sep 27 13:26:30 EDT 2022 aarch64 GNU/Linux

Using the tips you both have provided, both units have functioning X.

Only the rpi4 unit has the /dev/rpivid-h264mem, /dev/rpivid-hevcmem, /dev/rpivid-intcmem and /dev/rpivid-vp9mem nodes.

Oddly though, this doesn't seem to hinder the rpi3's X from being operational.

One thing I did note, and the problem showed up on both units: After installing Windowmaker (call me an old retro user), even though the desktop environment did start and all its bells & whistles seemed to be functional, it could not run
wmsystemtray, which is a system-tray specifically written FOR Windowmaker.

I was getting the same error on both devices where starting wmsystemtray from an xterm inside Windowmaker would report that it could not find the proper font.

The problem was easily solved by running the following commands (as root) and then rebooting:

mkfontdir
mkfontscale

Invoking both commands produced no output in the terminal, but as related above, did solve the problem.

My theory is that the sum of installing X and Windowmaker somehow doesn't perform this necessary initialization step.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54234
Location: 56N 3W

PostPosted: Mon Oct 03, 2022 8:20 am    Post subject: Reply with quote

Progman3K.

Up until the Pi4, all the Pis used the vc4 GPU. The Pi4 uses the vc6 and does things differently. Both use modesetting in Xorg but mesa has different options for the Pi3 and Pi4.
You can build both, so that the build can run on both.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum