diff options
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/gmmlib/files/patch-thread-id | 11 | ||||
-rw-r--r-- | multimedia/libva-intel-media-driver/files/patch-thread-id | 14 | ||||
-rw-r--r-- | multimedia/libva/files/patch-va_va__trace.c | 12 |
3 files changed, 28 insertions, 9 deletions
diff --git a/multimedia/gmmlib/files/patch-thread-id b/multimedia/gmmlib/files/patch-thread-id index bf667612c763..293667fcb4bf 100644 --- a/multimedia/gmmlib/files/patch-thread-id +++ b/multimedia/gmmlib/files/patch-thread-id @@ -2,7 +2,7 @@ Add more BSDs and update to modern way to get thread ID --- Source/GmmLib/Utility/GmmLog/spdlog/details/os.h.orig 2018-09-28 18:59:39 UTC +++ Source/GmmLib/Utility/GmmLog/spdlog/details/os.h -@@ -39,9 +39,13 @@ +@@ -39,9 +39,16 @@ #include <unistd.h> #include <chrono> @@ -15,10 +15,13 @@ Add more BSDs and update to modern way to get thread ID +#elif defined(__NetBSD__) +#include <lwp.h> // for _lwp_self + ++#elif defined(__sun) ++#include <thread.h> // for thr_self ++ #else #include <thread> -@@ -302,10 +308,10 @@ inline size_t thread_id() +@@ -302,10 +308,14 @@ inline size_t thread_id() # define SYS_gettid __NR_gettid # endif return static_cast<size_t>(syscall(SYS_gettid)); @@ -30,6 +33,10 @@ Add more BSDs and update to modern way to get thread ID + return static_cast<size_t>(pthread_getthreadid_np()); +#elif defined(__NetBSD__) + return static_cast<size_t>(_lwp_self()); ++#elif defined(__OpenBSD__) ++ return getthrid(); ++#elif defined(__sun) ++ return thr_self(); #else //Default to standard C++11 (OSX and other Unix) return static_cast<size_t>(std::hash<std::thread::id>()(std::this_thread::get_id())); #endif diff --git a/multimedia/libva-intel-media-driver/files/patch-thread-id b/multimedia/libva-intel-media-driver/files/patch-thread-id index 2f320db91915..fe108d791037 100644 --- a/multimedia/libva-intel-media-driver/files/patch-thread-id +++ b/multimedia/libva-intel-media-driver/files/patch-thread-id @@ -15,7 +15,7 @@ media_driver/linux/common/cm/cm_innerdef_os.h:98:37: note: expanded from macro ' --- media_driver/linux/common/cm/cm_innerdef_os.h.orig 2018-10-01 21:39:52 UTC +++ media_driver/linux/common/cm/cm_innerdef_os.h -@@ -35,8 +35,16 @@ +@@ -35,8 +35,18 @@ #include "mos_os.h" #include "media_libva_common.h" @@ -26,13 +26,15 @@ media_driver/linux/common/cm/cm_innerdef_os.h:98:37: note: expanded from macro ' +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> -+#else // OpenBSD, Solaris ++#elif defined(__sun) ++#include <thread.h> ++#else // fallback +#include <stdint.h> +#endif #include <unistd.h> //Require DRM VMAP patch, -@@ -95,5 +103,13 @@ inline void GetLocalTime(PSYSTEMTIME psystime) +@@ -95,5 +103,17 @@ inline void GetLocalTime(PSYSTEMTIME psystime) #endif #define CmGetCurProcessId() getpid() @@ -42,7 +44,11 @@ media_driver/linux/common/cm/cm_innerdef_os.h:98:37: note: expanded from macro ' +#define CmGetCurThreadId() pthread_getthreadid_np() +#elif defined(__NetBSD__) +#define CmGetCurThreadId() _lwp_self() -+#else // OpenBSD, Solaris ++#elif defined(__OpenBSD__) ++#define CmGetCurThreadId() getthrid() ++#elif defined(__sun) ++#define CmGetCurThreadId() thr_self() ++#else // fallback +#define CmGetCurThreadId() (uintptr_t)pthread_self() +#endif diff --git a/multimedia/libva/files/patch-va_va__trace.c b/multimedia/libva/files/patch-va_va__trace.c index 3a37bc42e5d5..44530c28d8b6 100644 --- a/multimedia/libva/files/patch-va_va__trace.c +++ b/multimedia/libva/files/patch-va_va__trace.c @@ -2,7 +2,7 @@ --- va/va_trace.c.orig 2019-07-05 13:14:31 UTC +++ va/va_trace.c -@@ -48,12 +48,36 @@ +@@ -48,12 +48,42 @@ #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> @@ -18,7 +18,9 @@ +#include <pthread_np.h> +#elif defined(__NetBSD__) +#include <lwp.h> -+#else // OpenBSD, Solaris ++#elif defined(__sun) ++#include <thread.h> ++#else // fallback +#include <stdint.h> +#endif + @@ -31,7 +33,11 @@ + return pthread_getthreadid_np(); +#elif defined(__NetBSD__) + return _lwp_self(); -+#else // OpenBSD, Solaris ++#elif defined(__OpenBSD__) ++ return getthrid(); ++#elif defined(__sun) ++ return thr_self(); ++#else // fallback + return (intptr_t) pthread_self(); +#endif +} |