From owner-freebsd-questions@freebsd.org Mon Apr 20 20:16:22 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 176172AE8A9; Mon, 20 Apr 2020 20:16:22 +0000 (UTC) (envelope-from chardon.frederic@gmail.com) Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 495dJ56y9Sz42pJ; Mon, 20 Apr 2020 20:16:21 +0000 (UTC) (envelope-from chardon.frederic@gmail.com) Received: by mail-il1-x130.google.com with SMTP id x2so9892686ilp.13; Mon, 20 Apr 2020 13:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LB2kBGCQ8JQXLcRlJiRndGTLOlyEwlw37Q0lCCMEcnQ=; b=VKUkKdEi+LvNsi1EioQvsxJmQdKQmDZDG2B19IC039pvqM5/j1Xze46KiOAZhrJVOC +VHNWlkD/vFaWzx+B3hFpDeQAcQTwLidPRbtW8pCsH7myvuoWpR9PQdhwm31aO1vDCr2 4umjMikwlKXInO3OLrsFM+XsWtAToA60Tt8TDwpzS2ugFYUfAdx4bkHqhqoZmQLcM0GN tV0FiENpvyAFDzVSDuCN9JpIpCHaqXQX3HgAxzmmq4NF5txvfVApkLPmynydrwM3gBjE VckZBXIbKKSCQ2o6I4fs0iH7n/BMIshWMk8YOg5IiMrClKxiBHxGZdxxpNutZ7rJVgwr p+BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LB2kBGCQ8JQXLcRlJiRndGTLOlyEwlw37Q0lCCMEcnQ=; b=DiPeQ1A9wJx858ULf2gPvgDDslU8uIVaV6qDjDOEMxBr/Fn6AGZ4gC5ADHZ8zU6m4+ a9npkh4ET6gPVPeOSosrkY+wYX2DkVihqXLD6EI6SaJ9SdaJ8KGrhhZumvy8iIgEkOg8 eXmf4Q1UdBL9oezzCmpU7DSCJRmG9jEtvrTHNJcQMal/yx54RWcfntUmFqinS16yNFxh y50zaYyruXfx6UxXR2EYirV5BZwScptNbERlDAs2K++erI9eZg/6v5W01iOMrMkpU+3i u9iKJf3MNwD086YzDZcONW0j4uBrF437PCLzP7TvnNu9GwgMLWqB2kNRwpWd9ziMbgTw FQOg== X-Gm-Message-State: AGi0PuYMkJ8IfhGw9cgVf4FJ1EheQ7vgUAUSpgNX92ketmLvU4AWEn/6 F9C5Zk3AbODTnQAQR2Eyi6VjPRO1niZ19hYkB0qglKnfY8Gmdw== X-Google-Smtp-Source: APiQypIvsp/rJabxeTjByJyrW1fh7uj3RZIfSMlDTAWOLs0VzXb4EjmMgvlvlMcIP/OV7z1publkJVNrl54Tf7c6CpA= X-Received: by 2002:a92:8bd1:: with SMTP id i200mr18295526ild.46.1587413780142; Mon, 20 Apr 2020 13:16:20 -0700 (PDT) MIME-Version: 1.0 References: <6c7abdcf-aeef-4af4-b8f4-9d7fd0e45cf0@localhost> <7fba319c-c012-8893-3ce0-e2a166c38d2d@daemonic.se> In-Reply-To: From: Frederic Chardon Date: Mon, 20 Apr 2020 22:16:08 +0200 Message-ID: Subject: Re: Wayland on FreeBSD To: Jan Beich Cc: Niclas Zeising , freebsd-x11@freebsd.org, FreeBSD Questions Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 495dJ56y9Sz42pJ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; TAGGED_RCPT(0.00)[freebsd]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Apr 2020 20:16:22 -0000 Le lun. 20 avr. 2020 =C3=A0 20:54, Jan Beich a =C3=A9c= rit : > > Frederic Chardon writes: > > > Le lun. 20 avr. 2020 =C3=A0 15:20, Jan Beich a =C3= =A9crit : > > > >> > >> Frederic Chardon writes: > >> > >> > Le lun. 20 avr. 2020 =C3=A0 12:20, Niclas Zeising > >> > a =C3=A9crit : > >> > > >> >> > >> >> On 2020-04-20 12:07, Greg V wrote: > >> >> > Apr 20, 2020 12:56:35 PM Frederic Chardon : > >> >> > > >> >> >> Le dim. 19 avr. 2020 =C3=A0 13:50, Jan Beich a =C3=A9crit : > >> >> >> > >> >> >>> > >> >> >>> > >> >> >>> I'm using Sway myself primarily with X11 applications. For exam= ple, > >> >> >>> "vblank_mode=3D0 glxgears" shows 3x more FPS than on real Xorg = server. ;) > >> >> >>> > >> >> >> > >> >> >> I decided to give it a try, is hardware acceleration supposed to= work? > >> >> >> glxgears gives 10x less fps than with X, and 3D is incredibly > >> >> >> sluggish. > >> >> >> eglinfo output that leads me to believe it is not: > >> >> >> GBM platform: > >> >> >> i965_dri.so does not support the 0xffffffff PCI ID. > >> >> >> > >> >> >> It is with sway, -current from yesterday, intel HD4000 iGPU (Ivy= bridge i5-3320M) > >> >> >> no difference between drm-devel-kmod or drm-current-kmod. > >> >> > > >> >> > Sway itself wouldn't even start without hardware rendering, it do= esn't *have* a software renderer. > >> >> > > >> >> > For the X applications like glxgears, I guess with the mesa build > >> >> > that's in official ports currently you still need that DRI3 > >> >> > something environment variable.. > >> >> > >> >> You shouldn't need that one. We switched the default to use DRI3 n= ot > >> >> long after xorg-server was updated to 1.20. > >> >> https://svnweb.freebsd.org/ports?view=3Drevision&revision=3D528071 > >> >> It should also be in the latest quarterly branch. > >> >> Regards > >> >> -- > >> >> Niclas > >> > > >> > With or without LIBGL_DRI3_ENABLE=3D1 in the environment the result = is > >> > the same. I use official packages, updated yesterday. > >> > > >> > The problem I face might be due to permission issue. ktrace shows th= is: > >> > 28047 eglinfo CALL openat(AT_FDCWD,0x7fffffffc820,0x100002) > >> > 28047 eglinfo NAMI "/dev/dri/card0" > >> > 28047 eglinfo RET openat 3 > >> > /..../ > >> > 28047 eglinfo CALL ioctl(0x3,0xc0106446,0x7fffffffbc70) > >> > 28047 eglinfo RET ioctl -1 errno 13 Permission denied > >> > >> What initializes DRI3 is Xwayland which is started by Sway. DRI3 can > >> fail for weird reasons (e.g., bug 241821), so make sure you have > >> > >> https://reviews.freebsd.org/D23846 > >> > >> As graphics/mesa-demos doesn't install eglgears_wayland to check OpenG= L > >> acceleration in native Wayland clients try multimedia/mpv instead e.g.= , > >> > >> $ pkg install mpv > >> $ mpv --no-config --msg-level=3Dvo/gpu=3Dv --gpu-api=3Dopengl --gpu-= context=3Dwayland /path/to/foo.mp4 > > > > Thanks, I'm at r360105 so this fix is included. mpv doesn't output any = error. > > What does mpv show as GL_RENDERER? If not llvmpipe (or swrast) then > hardware acceleration in native Wayland clients works fine for you. [vo/gpu/wayland] GL_RENDERER=3D'Mesa DRI Intel(R) Ivybridge Mobile ' > > > I installed benchmarks/glmark2, it scores an average of 8 times less > > fps under wayland than X11. So wayland in general works, but OpenGL is > > slow. Is it expected? > > glmark2 doesn't seem to support Wayland natively, so like glxgears it > tests Xwayland support. If Xwayland failed to initialize DRI3 then > all X11 clients would use slow software rendering. > > $ printenv | fgrep -i display > DISPLAY=3D:0 > WAYLAND_DISPLAY=3Dwayland-0 > > $ env -u DISPLAY glmark2 > Error: main: Could not initialize canvas > > $ env -u DISPLAY glmark2-es2 > Error: main: Could not initialize canvas I have the exact same output for all 3. > > Try starting Sway via "ktrace -i" or replace Xwayland binary with a > wrapper (see below) that starts it via ktrace. Tracing glxgears is too > late as Mesa will simply give up if DRI3 is not initialized. > > # Make sure Xwayland on restart prints "i965_dri.so does not support the = 0xffffffff PCI ID." > $ pkill Xwayland > $ PATH=3D$HOME/.local/bin:$PATH > $ cat ~/.local/bin/Xwayland > #! /bin/sh > > # Exclude current directory from PATH > PATH=3D$(IFS=3D:; for p in $PATH; do case $p in (${0%/*});; (*) echo -n "= $p:" ;; esac; done) > > # Run the actual app > exec ktrace -f /tmp/xwayland.$(id -u).ktrace ${0##*/} "$@" The trace shows usage of llvmpipe after the failed ioctl on /dev/dri/card0, so as I understand the lack of hardware acceleration concerns only Xwayland, whereas wayland itself is accelerated ? I also have this output: Refusing to try glamor on llvmpipe EGL setup failed, disabling glamor Failed to initialize glamor, falling back to sw