Bug 244298 - x11-drivers/xorgxrdp: enable dri3/glamor support
Summary: x11-drivers/xorgxrdp: enable dri3/glamor support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Koichiro Iwao
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-22 02:43 UTC by Derek Schrock
Modified: 2020-02-29 07:21 UTC (History)
1 user (show)

See Also:
meta: maintainer-feedback+


Attachments
Add DRI3/glamor support (1.56 KB, patch)
2020-02-22 02:43 UTC, Derek Schrock
meta: maintainer-approval+
Details | Diff
Xorg.10.log (17.04 KB, text/plain)
2020-02-26 12:51 UTC, Koichiro Iwao
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Schrock 2020-02-22 02:43:06 UTC
Created attachment 211824 [details]
Add DRI3/glamor support

portlint: ok. (1 warning)
testport: ok. 12amd64

With the advent of 1.20.x x11-server/xorg-server xorgxrdp can support
dri3/glamor [1] to enable hardware supported OpenGL acceleration with an
xorgxrdp desktop.

Updating xorgxrdp's xorg.conf [2] and adding the user to the video
group.

[1] https://github.com/neutrinolabs/xrdp/issues/1029
[2] https://github.com/neutrinolabs/xorgxrdp/blob/devel/xrdpdev/xorg.conf#L47
Comment 1 Koichiro Iwao freebsd_committer 2020-02-25 04:24:06 UTC
Thank. Did you confirm if OpenGL acceleration actually working?
Comment 2 Derek Schrock 2020-02-25 04:33:51 UTC
I have and it is.

...
[171166.288] (II) XRDPDEV(0): glamor X acceleration enabled on Mesa DRI Intel(R) Sandybridge Server 
...

Get about a 40% increased score when compared with llvmpipe using webgl benchmark in Firefox

https://beta.unity3d.com/jonas/benchmark2015/
Comment 3 Koichiro Iwao freebsd_committer 2020-02-26 07:26:45 UTC
Great, thanks!
Comment 4 Koichiro Iwao freebsd_committer 2020-02-26 07:33:50 UTC
BTW, where's the part of modifying xorg.conf?
Comment 5 Koichiro Iwao freebsd_committer 2020-02-26 12:51:15 UTC
Created attachment 211952 [details]
Xorg.10.log

Hmm, I finally got accelerated desktop via xrdp.

> [1226780.024] (II) XRDPDEV(0): glamor X acceleration enabled on Mesa DRI Intel(R) Ivybridge Desktop
Comment 6 Koichiro Iwao freebsd_committer 2020-02-26 13:03:58 UTC
The benchmark score is...

WITH ACCEL: 47552
  NO ACCEL: 34963


about 40% faster as well as you.
Comment 7 Derek Schrock 2020-02-26 13:24:51 UTC
The change to the xorgxrdp xorg.conf could be dependent on the env. /dev/dri/ might have card0, renderD128, etc... 

I was just stating from comment #1 that a couple extra steps were needed that maybe the port shouldn't handle?  Adding the user to the video group and maybe updating DRMDevice.

The upstream xorg.conf [1] should work out of the box but it's possible that DRMDevice would need to be changed.


[1]  https://github.com/neutrinolabs/xorgxrdp/blob/devel/xrdpdev/xorg.conf#L47
Comment 8 Koichiro Iwao freebsd_committer 2020-02-27 02:13:29 UTC
(In reply to Derek Schrock from comment #7)
Okay, I'll mention that in pkg-message. DRMDevice is /dev/dri/card0 for me so I needed to change it. What about you?
Comment 9 Derek Schrock 2020-02-27 03:58:36 UTC
card0 for me too.
Comment 10 Koichiro Iwao freebsd_committer 2020-02-27 04:06:02 UTC
I'm thinking of pkg-message like the following.

> xorgxrdp supports hardware acceleration as well as usual xorg-server.
> To configure hardware acceleration, follow the following steps.
> 
> 1. Install drm-kmod
>     # pkg install drm-kmod
> 
> 2. Configure to load kernel module (either one of the following)
>     # sysrc kld_list="/boot/modules/i915kms.ko"
>     # sysrc kld_list="/boot/modules/amdgpu.ko"
>     # sysrc kld_list="/boot/modules/radeonkms.ko"
> 
> 3. Ensure users who login via xrdp are member of the "video" group
>     # pw groupmod video -m username|| pw groupmod wheel -m username
> 
> 4. Edit /etc/X11/xrdp/xorg.conf to fit your environment
>    /dev/dri/renderD128 might be different depending on your environment.
>    Find the following line and change it to the actual path.
>     Option "DRMDevice" "/dev/dri/renderD128"
> 
> 5. Restart your system and login via xrdp
> 
> See also the Wiki page for detailed instructions:
>   https://wiki.freebsd.org/Graphics#Hardware_Support
> 
> 
> If hardware acceleration is properly configured, you will see logs like the
> following in ~/.local/share/xorg/Xorg.10.log. 10 can be replaced with display
> number.
> 
>     "glamor X acceleration enabled on Mesa DRI Intel(R) Ivybridge Desktop"
Comment 11 Derek Schrock 2020-02-27 04:08:57 UTC
Looks good to me.
Comment 12 commit-hook freebsd_committer 2020-02-27 04:14:53 UTC
A commit references this bug:

Author: meta
Date: Thu Feb 27 04:14:26 UTC 2020
New revision: 527235
URL: https://svnweb.freebsd.org/changeset/ports/527235

Log:
  x11-drivers/xorgxrdp: enable DRI3/glamor support

  With the advent of 1.20.x x11-server/xorg-server xorgxrdp can support
  dri3/glamor [1] to enable hardware supported OpenGL acceleration with an
  xorgxrdp desktop.

  Also add pkg-message to explain how to enable hardware acceleration.

  While here, fix misuse of "-I" flag to specify LIBDIR.

  [1] https://github.com/neutrinolabs/xrdp/issues/1029

  PR:		244298
  Submitted by:	Derek Schrock <dereks@lifeofadishwasher.com> (initial revision)
  Approved by:	meta (myself, maintainer)
  Sponsored by:	HAW International

Changes:
  head/x11-drivers/xorgxrdp/Makefile
  head/x11-drivers/xorgxrdp/files/
  head/x11-drivers/xorgxrdp/files/pkg-message.in
Comment 13 Koichiro Iwao freebsd_committer 2020-02-27 06:00:36 UTC
Committed, thanks for your support!
Comment 14 commit-hook freebsd_committer 2020-02-29 07:21:29 UTC
A commit references this bug:

Author: meta
Date: Sat Feb 29 07:20:50 UTC 2020
New revision: 527400
URL: https://svnweb.freebsd.org/changeset/ports/527400

Log:
  x11-drivers/xorgxrdp: disable DRI3 option by default

  because it is not very stable right now. Sometimes VLC causes coredump,
  sometimes Xorg server hangs up.

  PR:		244298

Changes:
  head/x11-drivers/xorgxrdp/Makefile