svn commit: r328436 - head/sys/compat/linuxkpi/common/src

Jan Beich jbeich at FreeBSD.org
Thu Feb 1 18:13:42 UTC 2018


Hans Petter Selasky <hps at selasky.org> writes:

> On 02/01/18 12:04, Hans Petter Selasky wrote:
>
>> On 02/01/18 11:25, Jan Beich wrote:
>>> Hans Petter Selasky <hselasky at FreeBSD.org> writes:
>>>
>>>> Author: hselasky
>>>> Date: Fri Jan 26 10:49:02 2018
>>>> New Revision: 328436
>>>> URL: https://svnweb.freebsd.org/changeset/base/328436
>>>>
>>>> Log:
>>>>  Decouple Linux files from the belonging character device right
>>>> after open
>>>>  in the LinuxKPI. This is done by calling finit() just before
>>>> returning a magic
>>>>  value of ENXIO in the "linux_dev_fdopen" function.
>>>
>>> This breaks DRI3 (uses DMABUF) on drm-next-kmod (Linux 4.9 atm) e.g.,
>>>
>>> $ LIBGL_DRI3_ENABLE=1 LIBGL_DEBUG=verbose MESA_DEBUG=context glxgears
>>> libGL: screen 0 does not appear to be DRI3 capable
>>> libGL error: Connection closed during DRI3 initialization failure
>>> XIO: fatal IO error 35 (Resource temporarily unavailable) on X
>>> server ":0"
>>>  after 22 requests (22 known processed) with 0 events remaining.
>>>
>>
>> Hi,
>>
>> I'll have a look. It might be an issue in libdrm, because it uses
>> some out-of date methods to enumerate the device nodes, like the
>> major and minor numbers.
>>
>> Did you recompile drm-next-kmod after recompiling the LinuxKPI?
>>
>> --HPS
>>
>
> Hi,
>
> I'm still running:
>
> freebsd-base-graphics
> git at github.com:FreeBSDDesktop/freebsd-base-graphics.git

drm-next branch from freebsd-base-graphics is out of date compared to
master from kms-drm which is the basis for graphics/drm-next-kmod port.
I've switched to drm-next-kmod long ago as resolving regular merge
conflicts under sys/compat/linuxkpi became very tedious.

> With r328436 applied on top and glxgears work:
>
>> env LIBGL_DRI3_ENABLE=1 LIBGL_DEBUG=verbose MESA_DEBUG=context glxgears
>> libGL: OpenDriver: trying /usr/local/lib/dri/i965_dri.so
>> libGL: Can't open configuration file /home/hans/.drirc: No such file or directory.
>> libGL: Using DRI2 for screen 0

What DDX driver do you use? modesetting(4x) uses DRI3 by default but for intel(4x)
you need to explicitly enable it via xorg.conf e.g., see (**) lines below

  $ fgrep DRI /var/log/Xorg.0.log
  [    11.875] (**) intel(0): Option "DRI" "3"
  [    11.880] (II) intel(0): [DRI2] Setup complete
  [    11.880] (II) intel(0): [DRI2]   DRI driver: i965
  [    11.880] (II) intel(0): [DRI2]   VDPAU driver: va_gl
  [    11.880] (II) intel(0): direct rendering: DRI2 DRI3 enabled
  [    11.902] (II) GLX: Initialized DRI2 GL provider for screen 0

Maybe also build graphics/mesa-{dri,libs} with CFLAGS += -D__DRM_NEXT__
in case LIBGL_DRI3_ENABLE=1 doesn't work for X server.

Here's what I see with the commit reverted:

$ LIBGL_DRI3_ENABLE=1 LIBGL_DEBUG=verbose MESA_DEBUG=context glxgears
libGL: Can't open configuration file /home/foo/.drirc: No such file or directory.
libGL: pci id for fd 4: 8086:1912, driver i965
libGL: OpenDriver: trying /usr/local/lib/dri/i965_dri.so
libGL: Can't open configuration file /home/foo/.drirc: No such file or directory.
libGL: Can't open configuration file /home/foo/.drirc: No such file or directory.
libGL: Using DRI3 for screen 0
libGL: Can't open configuration file /home/foo/.drirc: No such file or directory.
308 frames in 5.0 seconds = 61.437 FPS
^C

>> libGL: Can't open configuration file /home/hans/.drirc: No such file or directory.
>> Running synchronized to the vertical refresh.  The framerate should be
>> approximately the same as the monitor refresh rate.
>> 302 frames in 5.0 seconds = 60.252 FPS
>
> Can you do a ktrace and see where it stops?

It stops after one of messages from X server via unix(4) socket.

 glxgears CALL  mmap(0,0x7000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0)
 glxgears RET   mmap 34429681664/0x8042b4000
 glxgears CALL  mmap(0,0x7000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_PRIVATE|MAP_ANON>,0xffffffff,0)
 glxgears RET   mmap 34429710336/0x8042bb000
 glxgears CALL  poll(0x7fffffffe588,0x1,0xffffffff)
 glxgears RET   poll 1
 glxgears CALL  writev(0x3,0x7fffffffe628,0x1)
 glxgears GIO   fd 3 wrote 12 bytes
-0x0000 9501 0300 5501 0000 0000 0000                                     |....U.......|
+0x0000 9501 0300 5501 0000 0000 0000                                                         |....U.......|
 
 glxgears RET   writev 12/0xc
 glxgears CALL  poll(0x7fffffffe5e8,0x1,0xffffffff)
 glxgears RET   poll 1
 glxgears CALL  recvmsg(0x3,0x7fffffffe4a8,0)
-glxgears GIO   fd 3 read 32 bytes
-0x0000 0101 1700 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000  |..........................|
-0x001a 0000 0000 0000                                                    |......|
-
-glxgears RET   recvmsg 32/0x20
-glxgears CALL  fcntl(0x4,F_GETFD)
-glxgears RET   fcntl 0
-glxgears CALL  fcntl(0x4,F_SETFD,FD_CLOEXEC)
-glxgears RET   fcntl 0
-glxgears CALL  getpid
-glxgears RET   getpid 46871/0xb717
-glxgears CALL  __sysctl(0x7fffffffe488,0x2,0x7fffffffe400,0x7fffffffe3f8,0,0)
-glxgears SCTL  "kern.arandom"
-glxgears RET   __sysctl 0
-glxgears CALL  openat(AT_FDCWD,0x800c0138d,0<O_RDONLY>)
-glxgears NAMI  "/usr/local/etc/drirc"
-glxgears RET   openat 5
-glxgears CALL  read(0x5,0x804246000,0x1000)
-glxgears GIO   fd 5 read 4096 bytes
[...]
-glxgears RET   read 348/0x15c
-glxgears CALL  read(0x5,0x8042c2578,0x1000)
-glxgears GIO   fd 5 read 0 bytes
+glxgears GIO   fd 3 read 0 bytes
 ""
-glxgears RET   read 0
-glxgears CALL  close(0x5)
-glxgears RET   close 0
-glxgears CALL  openat(AT_FDCWD,0x80422e2e0,0<O_RDONLY>)
-glxgears NAMI  "/home/foo/.drirc"
-glxgears RET   openat -1 errno 2 No such file or directory
-glxgears CALL  fstatat(AT_FDCWD,0x7fffffffdf70,0x7fffffffe370,0)
+glxgears RET   recvmsg 0
+glxgears CALL  write(0x2,0x7fffffffdf60,0x7)
+glxgears GIO   fd 2 wrote 7 bytes
+"libGL: "
+glxgears RET   write 7
+glxgears CALL  write(0x2,0x7fffffffe060,0x2c)
+glxgears GIO   fd 2 wrote 44 bytes
+"screen 0 does not appear to be DRI3 capable
+"
+glxgears RET   write 44/0x2c
+glxgears CALL  write(0x2,0x7fffffffdf60,0xd)
+glxgears GIO   fd 2 wrote 13 bytes
+"libGL error: "
+glxgears RET   write 13/0xd
+glxgears CALL  write(0x2,0x7fffffffe060,0x34)
+glxgears GIO   fd 2 wrote 52 bytes
+"Connection closed during DRI3 initialization failure"
+glxgears RET   write 52/0x34

> Can you also verify:
>
> 1) run "xhost +"
> 2) run application as root

Neither (1) nor (2) helps.


More information about the svn-src-head mailing list