Bug 252197 - benchmarks/glmark2: expose KMS console and Wayland support
Summary: benchmarks/glmark2: expose KMS console and Wayland support
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords: patch, patch-ready
Depends on:
Blocks:
 
Reported: 2020-12-27 11:06 UTC by Jan Beich
Modified: 2021-01-12 15:32 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (danfe)
jbeich: merge-quarterly?


Attachments
v1 (3.51 KB, patch)
2020-12-27 11:06 UTC, Jan Beich
no flags Details | Diff
v1.1 (3.56 KB, patch)
2020-12-28 02:18 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer 2020-12-27 11:06:42 UTC
Created attachment 220990 [details]
v1

Make it possible to compare performance overhead between windowing systems.

Tested on 13.0 (base r368766) amd64 via Intel Skylake GT2 (0x1912):
- glmark2 and glmark2-es2 run fine under Xwayland
- glmark2-drm and glmark2-es2-drm run fine under console
- glmark2-wayland and glmark2-es2-wayland run fine under Sway
- libglvnd ( review D25020 ) builds fine
- DRM=ON WAYLAND=ON X11=ON builds fine
- X11=ON DRM=OFF WAYLAND=OFF builds fine
- X11=ON DRM=OFF X11=OFF builds fine
- DRM=ON X11=OFF X11=OFF builds fine

 =>> Checking shared library dependencies
  0x00000001 NEEDED               Shared library: [libX11.so.6]
  0x00000001 NEEDED               Shared library: [libc++.so.1]
  0x00000001 NEEDED               Shared library: [libc.so.7]
  0x00000001 NEEDED               Shared library: [libcxxrt.so.1]
+ 0x00000001 NEEDED               Shared library: [libdrm.so.2]
+ 0x00000001 NEEDED               Shared library: [libgbm.so.1]
  0x00000001 NEEDED               Shared library: [libgcc_s.so.1]
  0x00000001 NEEDED               Shared library: [libjpeg.so.8]
  0x00000001 NEEDED               Shared library: [libm.so.5]
  0x00000001 NEEDED               Shared library: [libpng16.so.16]
  0x00000001 NEEDED               Shared library: [libthr.so.3]
+ 0x00000001 NEEDED               Shared library: [libudev.so.0]
+ 0x00000001 NEEDED               Shared library: [libwayland-client.so.0]
+ 0x00000001 NEEDED               Shared library: [libwayland-egl.so.1]
  0x00000001 NEEDED               Shared library: [libz.so.6]
Comment 1 Jan Beich freebsd_committer 2020-12-28 02:18:37 UTC
Created attachment 221035 [details]
v1.1

- Disallow building without DRM, WAYLAND, X11 due to build error
- Adjust DRM_DESC after ports r559445
Comment 2 Jan Beich freebsd_committer 2020-12-30 10:08:23 UTC
I plan to merge this into 2021Q1. Wayland support is important to me.
Comment 3 Alexey Dokuchaev freebsd_committer 2021-01-12 02:15:34 UTC
> glmark2-drm and glmark2-es2-drm run fine under console
Actually, both of them segfault for me (just as they used to do before, so I've never enabled them).  Looking at https://github.com/glmark2/glmark2/issues/125 it seems that those patches only fix the -l mode (--list-scenes) which is quite useless as to the actual benchmarking.  Can you elaborate/confirm?

I cannot test or comment on the Wayland part, I guess it's okay to have it enabled (as it had metastased into other ports already) so long as it can be turned off.
Comment 4 Jan Beich freebsd_committer 2021-01-12 12:55:07 UTC
(In reply to Alexey Dokuchaev from comment #3)
> Actually, both of them segfault for me (just as they used to do before, so I've never enabled them).

Which drm-*-kmod version did you test? glmark2-drm and glmark2-es2-drm require GBM but DMABUF isn't supported by drm-legacy-kmod. nvidia-driver probably still doesn't support KMS unlike Linux version.

> it seems that those patches only fix the -l mode (--list-scenes)

In upstream issue the first tested command was "glmark2-drm -d" i.e., didn't contain "-l" flag. Without the patches I get the following:

$ glmark2-drm
Error: eglCreateWindowSurface failed with error: 0x3009
Error: eglCreateWindowSurface failed with error: 0x3009
Error: CanvasGeneric: Invalid EGL state
Error: main: Could not initialize canvas

$ glmark2-es2-drm
Error: eglCreateWindowSurface failed with error: 0x3009
Error: eglCreateWindowSurface failed with error: 0x3009
Error: CanvasGeneric: Invalid EGL state
Error: main: Could not initialize canvas

> I cannot test or comment on the Wayland part

Wayland support can be tested (and nested) from Xorg comfort zone e.g.,

  $ startx
  xorg$ pkg install cage glmark2
  xorg$ cage -d glmark2-wayland

However, wlroots like glmark2-drm may not work without DMABUF support.
Comment 5 Jan Beich freebsd_committer 2021-01-12 15:32:44 UTC
FWIW, if glmark2-drm doesn't work for you confirm with kmscube and mpv --gpu-context=drm.