Created attachment 225476 [details] work around execbuffer2 test failure For long time, I was not able to enable DRI3 with SNA. It turned out DRM_IOCTL_I915_GEM_EXECBUFFER2 ioctl returns a different error code, i.e., ENOENT instead of EFAULT. The attached patch fixed the following error for me. (WW) intel(0): Detected unsupported/dysfunctional hardware, disabling acceleration.
Before and after (without timestamps): % diff -u Xorg.0.log.old Xorg.0.log --- Xorg.0.log.old 2021-06-01 16:52:12.239091000 -0400 +++ Xorg.0.log 2021-06-01 16:52:34.902882000 -0400 @@ -11,7 +11,7 @@ Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. -(==) Log file: "/var/log/Xorg.0.log", Time: Tue Jun 1 16:46:01 2021 +(==) Log file: "/var/log/Xorg.0.log", Time: Tue Jun 1 16:48:22 2021 (==) Using config directory: "/usr/local/etc/X11/xorg.conf.d" (==) Using system config directory "/usr/local/share/X11/xorg.conf.d" (==) No Layout section. Using the first Screen section. @@ -79,7 +79,6 @@ (==) intel(0): Default visual is TrueColor (**) intel(0): Option "AccelMethod" "SNA" (**) intel(0): Option "DRI" "3" -(WW) intel(0): Detected unsupported/dysfunctional hardware, disabling acceleration. (II) intel(0): Output eDP-1 has no monitor section (II) intel(0): Enabled output eDP-1 (II) intel(0): Output DP-1 has no monitor section @@ -106,14 +105,12 @@ (II) Loading sub module "present" (II) LoadModule: "present" (II) Module "present" already built-in -(II) intel(0): SNA initialized with disabled backend +(II) intel(0): SNA initialized with Kabylake (gen9) backend (==) intel(0): Backing store enabled (==) intel(0): Silken mouse enabled (II) intel(0): HW Cursor enabled (==) intel(0): DPMS enabled (==) intel(0): Display hotplug detection enabled -(II) intel(0): Textured video not supported on this hardware or backend -(WW) intel(0): loading DRI2 whilst acceleration is disabled. (II) intel(0): [DRI2] Setup complete (II) intel(0): [DRI2] DRI driver: iris (II) intel(0): [DRI2] VDPAU driver: va_gl
FYI, I am using graphics/drm-devel-kmod and graphics/mesa-dri.
Do you know which part is returning ENOENT ? I'm not finding any difference between linux and freebsd in drm for this
(In reply to Emmanuel Vadot from comment #3) No, I don't. I'll check.
(In reply to Emmanuel Vadot from comment #3) -ENOENT is set from here: https://github.com/freebsd/drm-kmod/blob/4024d812abf46d0d1b759bd6e3a885a6b69b37ed/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c#L782 How we got here: i915_gem_execbuffer2_iocl() -> i915_gem_do_execbuffer() -> eb_relocate() -> eb_relocate_slow() -> eb_lookup_vmas() -> i915_gem_object_lookup()
(In reply to Jung-uk Kim from comment #5) I meant "i915_gem_execbuffer2_ioctl()", sorry.
Thanks for digging. Looks good to me now that I have the explanation.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=ca4de4fd36ff7ca59898ab2910213f060458f528 commit ca4de4fd36ff7ca59898ab2910213f060458f528 Author: Jung-uk Kim <jkim@FreeBSD.org> AuthorDate: 2021-07-01 18:40:17 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-07-01 19:01:14 +0000 x11-drivers/xf86-video-intel: work around execbuffer2 test failure Work around execbuffer2 test failure. I was not able to enable DRI3 with SNA. It turned out DRM_IOCTL_I915_GEM_EXECBUFFER2 ioctl returns a different error code, i.e., ENOENT instead of EFAULT. Allow both to return true. PR: 256354 Approved by: x11 (manu) x11-drivers/xf86-video-intel/Makefile | 1 + .../files/patch-src_sna_kgem.c (new) | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+)