commit:     ee5e5804a9a10db5fd95022efe5e9217b56dd6d1
Author:     Ilya Trukhanov <lahvuun <AT> gmail <DOT> com>
AuthorDate: Sat May 23 14:13:15 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Sun May 24 20:28:54 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee5e5804

media-libs/mesa: check for CONFIG_CHECKPOINT_RESTORE=y

This lets AMDGPU users know they should enable the kernel config option.
It should be enabled by CONFIG_GENTOO_LINUX_INIT_SYSTEMD, but if e.g.
OpenRC is used, it's possible for the option to be unset, as was in
my case.

Not doing so can cause the following spooky warning:
"amdgpu: os_same_file_description couldn't determine if two DRM fds
reference the same file description. If they do, bad things may happen!"

I haven't experienced any issues with the config option disabled, but
the warning is likely there for a reason.

Closes: https://github.com/gentoo/gentoo/pull/15926
Signed-off-by: Ilya Trukhanov <lahvuun <AT> gmail.com>
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 media-libs/mesa/mesa-19.3.5.ebuild     | 11 ++++++++++-
 media-libs/mesa/mesa-20.0.4-r1.ebuild  | 11 ++++++++++-
 media-libs/mesa/mesa-20.0.7.ebuild     | 11 ++++++++++-
 media-libs/mesa/mesa-20.1.0_rc4.ebuild | 11 ++++++++++-
 media-libs/mesa/mesa-9999.ebuild       | 11 ++++++++++-
 5 files changed, 50 insertions(+), 5 deletions(-)

diff --git a/media-libs/mesa/mesa-19.3.5.ebuild 
b/media-libs/mesa/mesa-19.3.5.ebuild
index 7773329bcc6..734d4a391c5 100644
--- a/media-libs/mesa/mesa-19.3.5.ebuild
+++ b/media-libs/mesa/mesa-19.3.5.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit llvm meson multilib-minimal pax-utils python-any-r1
+inherit llvm meson multilib-minimal pax-utils python-any-r1 linux-info
 
 OPENGL_DIR="xorg-x11"
 
@@ -325,6 +325,15 @@ pkg_setup() {
                ewarn "detected! This can cause problems. For details, see bug 
459306."
        fi
 
+       # os_same_file_description requires the kcmp syscall,
+       # which is only available with CONFIG_CHECKPOINT_RESTORE=y.
+       # Currently only AMDGPU utilizes this function, so only AMDGPU users 
would
+       # get a spooky warning message if the syscall fails.
+       if use gallium && use video_cards_radeonsi; then
+               CONFIG_CHECK="~CHECKPOINT_RESTORE"
+               linux-info_pkg_setup
+       fi
+
        if use gallium && use llvm; then
                llvm_pkg_setup
        fi

diff --git a/media-libs/mesa/mesa-20.0.4-r1.ebuild 
b/media-libs/mesa/mesa-20.0.4-r1.ebuild
index 7beeaef918f..097105ff4c5 100644
--- a/media-libs/mesa/mesa-20.0.4-r1.ebuild
+++ b/media-libs/mesa/mesa-20.0.4-r1.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit llvm meson multilib-minimal python-any-r1
+inherit llvm meson multilib-minimal python-any-r1 linux-info
 
 OPENGL_DIR="xorg-x11"
 
@@ -330,6 +330,15 @@ pkg_setup() {
                ewarn "detected! This can cause problems. For details, see bug 
459306."
        fi
 
+       # os_same_file_description requires the kcmp syscall,
+       # which is only available with CONFIG_CHECKPOINT_RESTORE=y.
+       # Currently only AMDGPU utilizes this function, so only AMDGPU users 
would
+       # get a spooky warning message if the syscall fails.
+       if use gallium && use video_cards_radeonsi; then
+               CONFIG_CHECK="~CHECKPOINT_RESTORE"
+               linux-info_pkg_setup
+       fi
+
        if use gallium && use llvm; then
                llvm_pkg_setup
        fi

diff --git a/media-libs/mesa/mesa-20.0.7.ebuild 
b/media-libs/mesa/mesa-20.0.7.ebuild
index 03083871b14..ff719014070 100644
--- a/media-libs/mesa/mesa-20.0.7.ebuild
+++ b/media-libs/mesa/mesa-20.0.7.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit llvm meson multilib-minimal python-any-r1
+inherit llvm meson multilib-minimal python-any-r1 linux-info
 
 OPENGL_DIR="xorg-x11"
 
@@ -334,6 +334,15 @@ pkg_setup() {
                ewarn "detected! This can cause problems. For details, see bug 
459306."
        fi
 
+       # os_same_file_description requires the kcmp syscall,
+       # which is only available with CONFIG_CHECKPOINT_RESTORE=y.
+       # Currently only AMDGPU utilizes this function, so only AMDGPU users 
would
+       # get a spooky warning message if the syscall fails.
+       if use gallium && use video_cards_radeonsi; then
+               CONFIG_CHECK="~CHECKPOINT_RESTORE"
+               linux-info_pkg_setup
+       fi
+
        if use gallium && use llvm; then
                llvm_pkg_setup
        fi

diff --git a/media-libs/mesa/mesa-20.1.0_rc4.ebuild 
b/media-libs/mesa/mesa-20.1.0_rc4.ebuild
index 03083871b14..ff719014070 100644
--- a/media-libs/mesa/mesa-20.1.0_rc4.ebuild
+++ b/media-libs/mesa/mesa-20.1.0_rc4.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit llvm meson multilib-minimal python-any-r1
+inherit llvm meson multilib-minimal python-any-r1 linux-info
 
 OPENGL_DIR="xorg-x11"
 
@@ -334,6 +334,15 @@ pkg_setup() {
                ewarn "detected! This can cause problems. For details, see bug 
459306."
        fi
 
+       # os_same_file_description requires the kcmp syscall,
+       # which is only available with CONFIG_CHECKPOINT_RESTORE=y.
+       # Currently only AMDGPU utilizes this function, so only AMDGPU users 
would
+       # get a spooky warning message if the syscall fails.
+       if use gallium && use video_cards_radeonsi; then
+               CONFIG_CHECK="~CHECKPOINT_RESTORE"
+               linux-info_pkg_setup
+       fi
+
        if use gallium && use llvm; then
                llvm_pkg_setup
        fi

diff --git a/media-libs/mesa/mesa-9999.ebuild b/media-libs/mesa/mesa-9999.ebuild
index 03083871b14..ff719014070 100644
--- a/media-libs/mesa/mesa-9999.ebuild
+++ b/media-libs/mesa/mesa-9999.ebuild
@@ -5,7 +5,7 @@ EAPI=7
 
 PYTHON_COMPAT=( python3_{6,7,8} )
 
-inherit llvm meson multilib-minimal python-any-r1
+inherit llvm meson multilib-minimal python-any-r1 linux-info
 
 OPENGL_DIR="xorg-x11"
 
@@ -334,6 +334,15 @@ pkg_setup() {
                ewarn "detected! This can cause problems. For details, see bug 
459306."
        fi
 
+       # os_same_file_description requires the kcmp syscall,
+       # which is only available with CONFIG_CHECKPOINT_RESTORE=y.
+       # Currently only AMDGPU utilizes this function, so only AMDGPU users 
would
+       # get a spooky warning message if the syscall fails.
+       if use gallium && use video_cards_radeonsi; then
+               CONFIG_CHECK="~CHECKPOINT_RESTORE"
+               linux-info_pkg_setup
+       fi
+
        if use gallium && use llvm; then
                llvm_pkg_setup
        fi

Reply via email to