Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-24 Thread Marton Balint



On Mon, 19 Apr 2021, Brad Smith wrote:


Can this please be back ported to the 4.4 branch?


Ok, done.

Regards,
Marton



On 4/18/2021 4:50 PM, Marton Balint wrote:



On Fri, 16 Apr 2021, Brad Smith wrote:


ping.


Will apply, thanks.

Marton



On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), 
_aff, _aff))

  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+    int mib[2] = { CTL_HW, HW_NCPUONLINE };
+    size_t len = sizeof(nb_cpus);
+
+    if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+    nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-19 Thread Brad Smith

Can this please be back ported to the 4.4 branch?

On 4/18/2021 4:50 PM, Marton Balint wrote:



On Fri, 16 Apr 2021, Brad Smith wrote:


ping.


Will apply, thanks.

Marton



On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), 
_aff, _aff))

  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+    int mib[2] = { CTL_HW, HW_NCPUONLINE };
+    size_t len = sizeof(nb_cpus);
+
+    if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+    nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-19 Thread James Almer

On 4/19/2021 9:15 PM, Derek Buitenhuis wrote:

On 16/04/2021 23:10, Brad Smith wrote:

ping.


I found this in my spam folder, so it's possible others using GMail had the 
same issue.


Yes, same for me. All of Brad emails are sent to my spam folder.



- Derek



On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
   libavutil/cpu.c | 6 ++
   1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
   DWORD_PTR proc_aff, sys_aff;
   if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
   nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+nb_cpus = 0;
   #elif HAVE_SYSCTL && defined(HW_NCPU)
   int mib[2] = { CTL_HW, HW_NCPU };
   size_t len = sizeof(nb_cpus);

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-19 Thread Derek Buitenhuis
On 16/04/2021 23:10, Brad Smith wrote:
> ping.

I found this in my spam folder, so it's possible others using GMail had the 
same issue.

- Derek

> 
> On 4/3/2021 2:49 PM, Brad Smith wrote:
>> avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD
>>
>> Signed-off-by: Brad Smith 
>> ---
>>   libavutil/cpu.c | 6 ++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/libavutil/cpu.c b/libavutil/cpu.c
>> index 8e3576a1f3..9d249737df 100644
>> --- a/libavutil/cpu.c
>> +++ b/libavutil/cpu.c
>> @@ -291,6 +291,12 @@ int av_cpu_count(void)
>>   DWORD_PTR proc_aff, sys_aff;
>>   if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
>>   nb_cpus = av_popcount64(proc_aff);
>> +#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
>> +int mib[2] = { CTL_HW, HW_NCPUONLINE };
>> +size_t len = sizeof(nb_cpus);
>> +
>> +if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
>> +nb_cpus = 0;
>>   #elif HAVE_SYSCTL && defined(HW_NCPU)
>>   int mib[2] = { CTL_HW, HW_NCPU };
>>   size_t len = sizeof(nb_cpus);
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-18 Thread Marton Balint




On Fri, 16 Apr 2021, Brad Smith wrote:


ping.


Will apply, thanks.

Marton



On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-16 Thread Brad Smith

ping.

On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-10 Thread Brad Smith

ping.

On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-03 Thread Brad Smith
avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
 libavutil/cpu.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
 DWORD_PTR proc_aff, sys_aff;
 if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
 nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+nb_cpus = 0;
 #elif HAVE_SYSCTL && defined(HW_NCPU)
 int mib[2] = { CTL_HW, HW_NCPU };
 size_t len = sizeof(nb_cpus);
-- 
2.30.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".