Bug 225415 - graphics/mesa-dri: update to 18.0.0
Summary: graphics/mesa-dri: update to 18.0.0
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: freebsd-x11 mailing list
URL: https://www.mesa3d.org/relnotes/18.0....
Keywords: patch
Depends on: 225035
Blocks: 227685
  Show dependency treegraph
 
Reported: 2018-01-23 22:56 UTC by Jan Beich
Modified: 2019-09-25 02:50 UTC (History)
8 users (show)

See Also:
bugzilla: maintainer-feedback? (x11)


Attachments
rc2 (16.33 KB, patch)
2018-01-23 22:56 UTC, Jan Beich
no flags Details | Diff
rc2 (16.92 KB, patch)
2018-01-25 03:31 UTC, Jan Beich
no flags Details | Diff
rc2 (17.16 KB, patch)
2018-01-25 04:41 UTC, Jan Beich
no flags Details | Diff
Prefer clock_gettime(2) over gettimeofday(2) (542 bytes, patch)
2018-01-25 19:57 UTC, Jung-uk Kim
no flags Details | Diff
Use CLOCK_MONOTONIC for futex_wait() (1.44 KB, patch)
2018-01-25 19:59 UTC, Jung-uk Kim
no flags Details | Diff
Use CLOCK_MONOTONIC for futex_wait() (1.44 KB, patch)
2018-01-25 20:08 UTC, Jung-uk Kim
no flags Details | Diff
Prefer clock_gettime(2) over gettimeofday(2) and use clock_nanosleep(2) if available (860 bytes, patch)
2018-01-25 20:33 UTC, Jung-uk Kim
no flags Details | Diff
rc3 (19.70 KB, patch)
2018-01-29 13:23 UTC, Jan Beich
no flags Details | Diff
rc4 (21.02 KB, patch)
2018-02-09 12:40 UTC, Jan Beich
no flags Details | Diff
rc4 (19.70 KB, patch)
2018-02-16 06:47 UTC, Jan Beich
no flags Details | Diff
rc4 (19.70 KB, patch)
2018-02-27 01:39 UTC, Jan Beich
no flags Details | Diff
rc4 (21.36 KB, patch)
2018-03-09 13:16 UTC, Jan Beich
no flags Details | Diff
rc5 (21.37 KB, patch)
2018-03-21 19:59 UTC, Jan Beich
no flags Details | Diff
release (21.22 KB, patch)
2018-03-27 21:19 UTC, Jan Beich
jbeich: maintainer-approval? (x11)
Details | Diff
glxinfo-mesa-18.0.0.txt (25.02 KB, text/plain)
2018-03-28 00:08 UTC, Carlos J. Puga Medina
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 Niclas Zeising freebsd_committer 2018-01-24 08:12:57 UTC
Looking at this.
Comment 2 Jan Beich freebsd_committer 2018-01-25 02:17:29 UTC
Comment on attachment 190018 [details]
rc2

Oops, broke build on armv6 and armv7. --build-id is now used even for non-Vulkan drivers. powerpc* and sparc64 already pull new ld.bfd via USES=compiler:c++11-lib.

gmake[7]: Entering directory '/usr/ports/graphics/mesa-dri/work/mesa-18.0.0-rc2/src/mesa/drivers/dri'
/bin/sh ../../../../libtool  --tag=CXX   --mode=link /usr/bin/c++  -O2 -pipe -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include -Wall -fno-math-errno -fno-trapping-math -Qunused-arguments  -shared -shrext .so -module -no-undefined -avoid-version -Wl,--build-id=sha1 -Wl,-Bsymbolic -Wl,--gc-sections -Wl,--no-undefined -Wl,-rpath=/usr/local/llvm50/lib -o mesa_dri_drivers.la -rpath /usr/local/lib/dri  ../../libmesa.la common/libmegadriver_stub.la common/libdricommon.la ../../../../src/util/libxmlconfig.la ../../../../src/mapi/shared-glapi/libglapi.la      swrast/libswrast_dri.la -L/usr/local/lib -ldrm  -L/usr/local/lib -lexpat  -lm -lpthread -pthread   -L/usr/local/lib
/usr/bin/ld: unrecognized option '--build-id=sha1'
/usr/bin/ld: use the --help option for usage information
c++: error: linker command failed with exit code 1 (use -v to see invocation)

https://cgit.freedesktop.org/mesa/mesa/commit/?id=ccb700526f64
Comment 3 Jan Beich freebsd_committer 2018-01-25 03:31:08 UTC
Created attachment 190045 [details]
rc2

--build-id=sha1 is only used by anv and i965 but Mesa builds i915, i965, r200, radeon as a hardlinks for a single file. So, use devel/binutils for any DRI_DRIVERS.

$ fgrep -rl build_id .
./src/mesa/drivers/dri/i965/brw_disk_cache.c
./src/mesa/drivers/dri/i965/brw_program_binary.c
./src/util/Makefile.sources
./src/util/build_id.h
./src/util/build_id.c
./src/util/meson.build
./src/util/Makefile.in
./src/intel/vulkan/anv_device.c
Comment 4 Jan Beich freebsd_committer 2018-01-25 04:41:36 UTC
Created attachment 190047 [details]
rc2

Oops, radeonsi needs futex_wait() to support timeout argument.
https://cgit.freedesktop.org/mesa/mesa/commit/?id=e3a8013de8ca
https://cgit.freedesktop.org/mesa/mesa/commit/?id=609a230375ca
https://cgit.freedesktop.org/mesa/mesa/commit/?id=e6dbc804a87a

$ fgrep -rl util_queue_fence_wait_timeout .
./src/util/u_queue.c
./src/util/u_queue.h
./src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
./src/gallium/drivers/radeonsi/si_fence.c
Comment 5 Jan Beich freebsd_committer 2018-01-25 05:11:10 UTC
@jkim, does my attempt to emulate absolute timeout for sys_futex() look correct? It's based on _umtx_wait_uint() from libc.

Greg, can you check radeonsi on amdgpu works fine?
Comment 6 Greg V 2018-01-25 13:07:19 UTC
(In reply to Jan Beich from comment #5)
Yep, everything seems to work great (tested OpenMW on both Weston and Xorg, Dolphin with Vulkan, an OpenCL demo with Clover).

Also

- this obsoletes bug 223030 (merged upstream)
- but does not obsolete bug 221540

BTW, my patch for building Mesa with Meson on *BSD has landed, and cc'd to mesa-stable https://cgit.freedesktop.org/mesa/mesa/commit/?id=c38c60a63c63b02d1030c6c349aa0a73105e10eb 

( the whole patch series: https://patchwork.freedesktop.org/series/35931/ — I'll need to update the futex patch there )
Comment 7 Jung-uk Kim freebsd_committer 2018-01-25 19:56:11 UTC
(In reply to Jan Beich from comment #5)
Yes, it looks good.

(In reply to Greg V from comment #6)
While you're at it, can you please switch clock code from gettimeofday(2) to clock_gettime(2)?  Then, we can use CLOCK_MONOTONIC for futex_wait().
Comment 8 Jung-uk Kim freebsd_committer 2018-01-25 19:57:56 UTC
Created attachment 190061 [details]
Prefer clock_gettime(2) over gettimeofday(2)
Comment 9 Jung-uk Kim freebsd_committer 2018-01-25 19:59:04 UTC
Created attachment 190062 [details]
Use CLOCK_MONOTONIC for futex_wait()

While I am here, I changed coding style little bit. :-)
Comment 10 Jung-uk Kim freebsd_committer 2018-01-25 20:08:49 UTC
Created attachment 190063 [details]
Use CLOCK_MONOTONIC for futex_wait()
Comment 11 Jung-uk Kim freebsd_committer 2018-01-25 20:21:18 UTC
(In reply to Jung-uk Kim from comment #8)
BTW, clock_nanosleep(2) is available from 11.1.  I think we should test __FreeBSD_version.
Comment 12 Jung-uk Kim freebsd_committer 2018-01-25 20:33:09 UTC
Created attachment 190064 [details]
Prefer clock_gettime(2) over gettimeofday(2) and use clock_nanosleep(2) if available
Comment 13 Jan Beich freebsd_committer 2018-01-29 13:23:27 UTC
Created attachment 190159 [details]
rc3

- Update to rc3, see https://lists.freedesktop.org/archives/mesa-announce/2018-January/000397.html
- Merge patches from jkim@
- Detect clock_nanosleep() at configure, so it can be used on NetBSD 7.0+ as well
  http://netbsd.gw.com/cgi-bin/man-cgi?clock_nanosleep+2+NetBSD-current
- Fix a BSD patch warning in files/patch-src_intel_tools_aubinator.c:
  No such line 1236 in input file, ignoring
Comment 14 Jan Beich freebsd_committer 2018-02-09 12:40:49 UTC
Created attachment 190459 [details]
rc4

https://lists.freedesktop.org/archives/mesa-announce/2018-February/000398.html

https://cgit.freedesktop.org/mesa/mesa/commit/?id=53f8d524a0ce relyies on assert() being turned off in --disable-debug mode. i965 uses build_id.h for on-disk shader cache and ARB_get_program_binary. More changes are required to support disabling build_id.h, so let's not copy OS X folly.
Comment 15 Jan Beich freebsd_committer 2018-02-09 12:55:27 UTC
... or maybe OS X doesn't build i965 at all.
Comment 16 Jan Beich freebsd_committer 2018-02-16 06:47:33 UTC
Created attachment 190681 [details]
rc4

rebase against attachment 190680 [details]
Comment 17 Jan Beich freebsd_committer 2018-02-27 01:39:24 UTC
Created attachment 191041 [details]
rc4

rebase against attachment 191040 [details]
Comment 18 Jan Beich freebsd_committer 2018-03-09 13:16:02 UTC
Created attachment 191335 [details]
rc4

Add patch for src/util/u_thread.h:
- Implement setting thread name
- Use monotonic clock for timeouts
Comment 20 Jan Beich freebsd_committer 2018-03-27 21:19:31 UTC
Created attachment 191881 [details]
release

https://lists.freedesktop.org/archives/mesa-announce/2018-March/000412.html

- Let's start maintainer timeout countdown
- No upstream code changes since rc5
- Reordered struct initializers, see

  -const struct _umtx_time tmo = { ._clockid = CLOCK_MONOTONIC, ._flags = UMTX_ABSTIME, ._timeout = *timeout };
  +const struct _umtx_time tmo = { ._timeout = *timeout, ._flags = UMTX_ABSTIME, ._clockid = CLOCK_MONOTONIC };

to pacify GCC

  In file included from ../../src/util/simple_mtx.h:27:0,
		   from ../../src/mesa/main/mtypes.h:49,
		   from glsl/main.cpp:36:
  ../../src/util/futex.h: In function 'int futex_wait(uint32_t*, int32_t, timespec*)':
  ../../src/util/futex.h:54:113: sorry, unimplemented: non-trivial designated initializers not supported
	 const struct _umtx_time tmo = { ._clockid = CLOCK_MONOTONIC, ._flags = UMTX_ABSTIME, ._timeout = *timeout };
														   ^
  ../../src/util/futex.h:54:113: sorry, unimplemented: non-trivial designated initializers not supported
Comment 21 Carlos J. Puga Medina freebsd_committer 2018-03-28 00:08:18 UTC
Created attachment 191890 [details]
glxinfo-mesa-18.0.0.txt

Jan, it works fine for me. Tested with GPU Sandy Bridge on 10.4/amd64.

Thanks for the update.
Comment 22 Arrigo Marchiori 2018-03-29 07:14:49 UTC
Hello all,

thank you for the work you are doing on this.

I installed Xorg on a new 11-STABLE system with a Radeon HD 7450.
Xorg segfaults when playing videos because this patch is missing:
https://patchwork.freedesktop.org/patch/182902/
I applied it by hand and it now I ``only'' get a black window instead of the video.

For this reason, I am really looking forward to see the new release of mesa in the ports tree, as I hope it will solve my problems. Please let me know if I can be of any help to you.

Thank you again and best regards.
Comment 23 rkoberman 2018-03-30 05:11:09 UTC
On my Sandybridge system this breaks DRI. glxgears slows from 26761 frames in 5.0 seconds = 5352.118 FPS to 6060 frames in 5.0 seconds = 1211.919 FPS. Firefox reports that llvmpipe is in use (software rasterization). The Xorg.log shows:
[242860.833] (EE) AIGLX error: Calling driver entry point failed
[242860.834] (EE) AIGLX: reverting to software rendering

System is running 11-STABLE r331492.

FWIW, I tried just going to 17.3.7 and it has the same problem.

I'll be happy to provide addition data if I can collect it. I have both versions packaged and can swap fairly quickly. (I don't have 17.3.7 packages, but I can do so.
Comment 24 rkoberman 2018-04-05 03:27:48 UTC
(In reply to rkoberman from comment #23)
Using the latest patches, 18.0.0 is working correctly on my Sandybridge system. glxgears show over 510 FPS. I will continue with this version and report any issues I see.
Comment 25 Jan Beich freebsd_committer 2018-04-08 23:21:07 UTC
(In reply to Arrigo Marchiori from comment #22)
> Xorg segfaults when playing videos because this patch is missing:
> https://patchwork.freedesktop.org/patch/182902/

Is it a regression? If so when did you notice relative to graphics/mesa-dri updates?

> I applied it by hand and it now I ``only'' get a black window instead of the video.

Not much of an improvement then. Can you try radeonkms from either graphics/drm-stable-kmod or graphics/drm-next-kmod?
Comment 26 commit-hook freebsd_committer 2018-04-10 00:14:39 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:14:03 UTC 2018
New revision: 466923
URL: https://svnweb.freebsd.org/changeset/ports/466923

Log:
  graphics/mesa-dri: always lower kernel version check

  Sandybridge on FreeBSD 11.* is also affected:

  $ glxgears
  [intel_init_bufmgr: 1685] Kernel 3.9 required.
  libGL error: failed to create dri screen
  libGL error: failed to load driver: i965
  5373 frames in 5.0 seconds = 1074.496 FPS

  Reported by:	Kevin Oberman
  PR:		225035 225415

Changes:
  head/graphics/mesa-dri/Makefile
Comment 27 commit-hook freebsd_committer 2018-04-10 00:15:49 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:15:07 UTC 2018
New revision: 466926
URL: https://svnweb.freebsd.org/changeset/ports/466926

Log:
  graphics/mesa-{libs,dri}: update to 18.0.0

  Changes:	https://www.mesa3d.org/relnotes/18.0.0.html
  PR:		225415
  Tested by:	Greg V, cpm, Kevin Oberman, Juan Ram?n Molina Menor
  Reviewed by:	Greg V (Wayland, Vulkan), jkim (umtx)
  Approved by:	maintainer timeout (2 weeks)

Changes:
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/distinfo
  head/graphics/mesa-dri/files/configure.ac
  head/graphics/mesa-dri/files/patch-configure
  head/graphics/mesa-dri/files/patch-src_amd_vulkan_winsys_amdgpu_radv__amdgpu__cs.c
  head/graphics/mesa-dri/files/patch-src_egl_drivers_dri2_platform__x11.c
  head/graphics/mesa-dri/files/patch-src_gallium_auxiliary_util_u__network.c
  head/graphics/mesa-dri/files/patch-src_gallium_winsys_svga_drm_vmw__screen__ioctl.c
  head/graphics/mesa-dri/files/patch-src_intel_compiler_brw__fs__bank__conflicts.cpp
  head/graphics/mesa-dri/files/patch-src_intel_tools_aubinator.c
  head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__allocator.c
  head/graphics/mesa-dri/files/patch-src_intel_vulkan_anv__device.c
  head/graphics/mesa-dri/files/patch-src_loader_loader.c
  head/graphics/mesa-dri/files/patch-src_util_futex.h
  head/graphics/mesa-dri/files/patch-src_util_os__time.c
  head/graphics/mesa-dri/files/patch-src_util_u__endian.h
  head/graphics/mesa-dri/files/patch-src_util_u__thread.h
Comment 28 commit-hook freebsd_committer 2018-04-10 00:18:59 UTC
A commit references this bug:

Author: jbeich
Date: Tue Apr 10 00:18:05 UTC 2018
New revision: 466929
URL: https://svnweb.freebsd.org/changeset/ports/466929

Log:
  MFH: r466923

  graphics/mesa-dri: always lower kernel version check

  Sandybridge on FreeBSD 11.* is also affected:

  $ glxgears
  [intel_init_bufmgr: 1685] Kernel 3.9 required.
  libGL error: failed to create dri screen
  libGL error: failed to load driver: i965
  5373 frames in 5.0 seconds = 1074.496 FPS

  Reported by:	Kevin Oberman
  PR:		225035 225415
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2018Q2/
  branches/2018Q2/graphics/mesa-dri/Makefile
Comment 29 Arrigo Marchiori 2018-04-13 13:42:05 UTC
Hello Jan,

sorry for the late reply. I could just test the new port today.

(In reply to Jan Beich from comment #25)
> (In reply to Arrigo Marchiori from comment #22)
> > Xorg segfaults when playing videos because this patch is missing:
> > https://patchwork.freedesktop.org/patch/182902/
> 
> Is it a regression? If so when did you notice relative to graphics/mesa-dri
> updates?

I cannot say whether it is a regression or not, unfortunately.
I just installed 11-STABLE on a brand new system, and I found this problem. It is my first experience on this hardware.

> > I applied it by hand and it now I ``only'' get a black window instead of the video.
> 
> Not much of an improvement then.

IMHO yes, it is: Xorg does not crash any more!

> Can you try radeonkms from either
> graphics/drm-stable-kmod or graphics/drm-next-kmod?

I tried installing graphics/drm-stable-kmod; amdgpu did not load; radeonkms did but it lead to a panic, issued in r100_reg_safe_bm() from /boot/kernel/radeonkms.ko

Shall I open a new PR?
Comment 30 commit-hook freebsd_committer 2018-04-18 17:49:09 UTC
A commit references this bug:

Author: jbeich
Date: Wed Apr 18 17:48:30 UTC 2018
New revision: 467724
URL: https://svnweb.freebsd.org/changeset/ports/467724

Log:
  graphics/mesa-{libs,dri}: update to 18.0.1

  Changes:	https://www.mesa3d.org/relnotes/18.0.1.html
  PR:		225415

Changes:
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/distinfo
Comment 31 commit-hook freebsd_committer 2018-04-28 20:57:02 UTC
A commit references this bug:

Author: jbeich
Date: Sat Apr 28 20:56:05 UTC 2018
New revision: 468593
URL: https://svnweb.freebsd.org/changeset/ports/468593

Log:
  graphics/mesa-{libs,dri}: update to 18.0.2

  Changes:	https://www.mesa3d.org/relnotes/18.0.2.html
  PR:		225415

Changes:
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/distinfo
Comment 32 commit-hook freebsd_committer 2018-05-08 00:35:18 UTC
A commit references this bug:

Author: jbeich
Date: Tue May  8 00:34:28 UTC 2018
New revision: 469340
URL: https://svnweb.freebsd.org/changeset/ports/469340

Log:
  graphics/mesa-{libs,dri}: update to 18.0.3

  Changes:	https://www.mesa3d.org/relnotes/18.0.3.html
  PR:		225415

Changes:
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/distinfo
Comment 33 commit-hook freebsd_committer 2018-05-18 09:00:02 UTC
A commit references this bug:

Author: jbeich
Date: Fri May 18 08:59:42 UTC 2018
New revision: 470280
URL: https://svnweb.freebsd.org/changeset/ports/470280

Log:
  graphics/mesa-{libs,dri}: update to 18.0.4

  Changes:	https://www.mesa3d.org/relnotes/18.0.4.html
  PR:		225415

Changes:
  head/graphics/mesa-dri/Makefile.common
  head/graphics/mesa-dri/distinfo