1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

multimedia/libva: USES-= alias, augment patches

Threading is still broken on DragonFly when alias is used, so fix by
augmenting the same patches FreeBSD uses.  These are no-op pre-processor
changes for FreeBSD.

Approved by:	non-invasive DF support blanket
This commit is contained in:
John Marino 2016-06-30 12:44:33 +00:00
parent 38a31b30c1
commit 862b9b85de
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=417824
3 changed files with 19 additions and 9 deletions

View File

@ -14,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat
LIB_DEPENDS= libdrm.so:graphics/libdrm
USES= alias autoreconf gmake libtool localbase pkgconfig tar:bzip2
USES= autoreconf gmake libtool localbase pkgconfig tar:bzip2
USE_XORG= glproto pciaccess xext xfixes
USE_GL= gl
GNU_CONFIGURE= yes

View File

@ -1,4 +1,4 @@
--- test/v4l_h264/encode/capture.cpp.orig 2015-07-01 07:54:24 UTC
--- test/v4l_h264/encode/capture.cpp.orig 2016-06-21 01:29:25 UTC
+++ test/v4l_h264/encode/capture.cpp
@@ -30,6 +30,7 @@
*/
@ -12,7 +12,7 @@
#include <fcntl.h> /* low-level i/o */
#include <errno.h>
#include <unistd.h>
+#ifdef __FreeBSD__
+#if defined __FreeBSD__ || defined __DragonFly__
+#include <stdlib.h>
+#else
#include <malloc.h>
@ -24,7 +24,7 @@
}
for (n_buffers = 0; n_buffers < 4; ++n_buffers) {
buffers[n_buffers].length = buffer_size;
+#ifdef __FreeBSD__
+#if defined __FreeBSD__ || defined __DragonFly__
+ if(posix_memalign(&buffers[n_buffers].start, page_size, buffer_size))
+ {
+#else

View File

@ -10,60 +10,70 @@
#include <unistd.h>
#include <time.h>
#include <errno.h>
@@ -294,7 +297,11 @@ static void add_trace_config_info(
@@ -294,7 +297,13 @@ static void add_trace_config_info(
{
struct trace_config_info *pconfig_info;
int idx = 0;
+#ifdef __FreeBSD__
+ pid_t thd_id = pthread_getthreadid_np();
+#elif defined __DragonFly__
+ pid_t thd_id = syscall(SYS_lwp_gettid);
+#else
pid_t thd_id = syscall(__NR_gettid);
+#endif
LOCK_RESOURCE(pva_trace);
@@ -318,7 +325,11 @@ static void delete_trace_config_info(
@@ -318,7 +327,13 @@ static void delete_trace_config_info(
{
struct trace_config_info *pconfig_info;
int idx = 0;
+#ifdef __FreeBSD__
+ pid_t thd_id = pthread_getthreadid_np();
+#elif defined __DragonFly__
+ pid_t thd_id = syscall(SYS_lwp_gettid);
+#else
pid_t thd_id = syscall(__NR_gettid);
+#endif
LOCK_RESOURCE(pva_trace);
@@ -663,7 +674,11 @@ static struct trace_log_file *start_trac
@@ -663,7 +678,13 @@ static struct trace_log_file *start_trac
{
struct trace_log_files_manager *plog_files_mgr = NULL;
struct trace_log_file *plog_file = NULL;
+#ifdef __FreeBSD__
+ pid_t thd_id = pthread_getthreadid_np();
+#elif defined __DragonFly__
+ pid_t thd_id = syscall(SYS_lwp_gettid);
+#else
pid_t thd_id = syscall(__NR_gettid);
+#endif
int i = 0;
LOCK_RESOURCE(pva_trace);
@@ -702,7 +717,11 @@ static void refresh_log_file(
@@ -702,7 +723,13 @@ static void refresh_log_file(
struct trace_context *ptra_ctx)
{
struct trace_log_file *plog_file = NULL;
+#ifdef __FreeBSD__
+ pid_t thd_id = pthread_getthreadid_np();
+#elif defined __DragonFly__
+ pid_t thd_id = syscall(SYS_lwp_gettid);
+#else
pid_t thd_id = syscall(__NR_gettid);
+#endif
int i = 0;
plog_file = ptra_ctx->plog_file;
@@ -1226,7 +1245,11 @@ static void internal_TraceUpdateContext
@@ -1226,7 +1253,13 @@ static void internal_TraceUpdateContext
{
struct trace_context *trace_ctx = NULL;
int i = 0, delete = 1;
+#ifdef __FreeBSD__
+ pid_t thd_id = pthread_getthreadid_np();
+#elif defined __DragonFly__
+ pid_t thd_id = syscall(SYS_lwp_gettid);
+#else
pid_t thd_id = syscall(__NR_gettid);
+#endif