Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2018 10:11:13 +0000 (UTC)
From:      "Carlos J. Puga Medina" <cpm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r477783 - in head/www/iridium: . files
Message-ID:  <201808221011.w7MABDlV069695@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cpm
Date: Wed Aug 22 10:11:13 2018
New Revision: 477783
URL: https://svnweb.freebsd.org/changeset/ports/477783

Log:
  - Conveniently apply r477781 to iridium

Added:
  head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp   (contents, props changed)
Modified:
  head/www/iridium/Makefile
  head/www/iridium/files/patch-base_process_memory__unittest.cc
  head/www/iridium/files/patch-chrome_test_base_in__process__browser__test.cc
  head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h
  head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp
  head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp

Modified: head/www/iridium/Makefile
==============================================================================
--- head/www/iridium/Makefile	Wed Aug 22 10:01:02 2018	(r477782)
+++ head/www/iridium/Makefile	Wed Aug 22 10:11:13 2018	(r477783)
@@ -3,7 +3,7 @@
 
 PORTNAME=	iridium
 PORTVERSION=	2018.5.67
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 MASTER_SITES=	https://downloads.iridiumbrowser.de/source/
 PKGNAMESUFFIX=	-browser
@@ -241,9 +241,13 @@ do-install:
 	${INSTALL_DATA} ${WRKDIR}/iridium-browser.desktop \
 		${STAGEDIR}${DESKTOPDIR}
 	${INSTALL_SCRIPT} ${WRKDIR}/iridium ${STAGEDIR}${PREFIX}/bin
+
+	# ANGLE
 .for f in libEGL.so libGLESv2.so
 	${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/${f} ${STAGEDIR}${DATADIR}
 .endfor
+
+	# SwiftShader
 	@${MKDIR} ${STAGEDIR}${DATADIR}/swiftshader
 .for g in libEGL.so libGLESv2.so
 	${INSTALL_LIB} ${WRKSRC}/out/${BUILDTYPE}/swiftshader/${g} \

Modified: head/www/iridium/files/patch-base_process_memory__unittest.cc
==============================================================================
--- head/www/iridium/files/patch-base_process_memory__unittest.cc	Wed Aug 22 10:01:02 2018	(r477782)
+++ head/www/iridium/files/patch-base_process_memory__unittest.cc	Wed Aug 22 10:11:13 2018	(r477783)
@@ -1,5 +1,5 @@
---- base/process/memory_unittest.cc.orig	2017-09-05 21:05:11.000000000 +0200
-+++ base/process/memory_unittest.cc	2017-09-06 16:53:33.919374000 +0200
+--- base/process/memory_unittest.cc.orig	2018-08-08 21:10:31.000000000 +0200
++++ base/process/memory_unittest.cc	2018-08-20 13:06:25.303428000 +0200
 @@ -104,7 +104,7 @@
  // OpenBSD does not support these tests. Don't test these on ASan/TSan/MSan
  // configurations: only test the real allocator.
@@ -9,9 +9,9 @@
      !defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
  
  namespace {
-@@ -507,5 +507,5 @@
+@@ -529,5 +529,5 @@
    EXPECT_FALSE(base::UncheckedCalloc(1, test_size_, &value_));
-   EXPECT_TRUE(value_ == NULL);
+   EXPECT_TRUE(value_ == nullptr);
  }
 -#endif  // !defined(OS_OPENBSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&
 +#endif  // !defined(OS_BSD) && BUILDFLAG(ENABLE_WIN_ALLOCATOR_SHIM_TESTS) &&

Modified: head/www/iridium/files/patch-chrome_test_base_in__process__browser__test.cc
==============================================================================
--- head/www/iridium/files/patch-chrome_test_base_in__process__browser__test.cc	Wed Aug 22 10:01:02 2018	(r477782)
+++ head/www/iridium/files/patch-chrome_test_base_in__process__browser__test.cc	Wed Aug 22 10:11:13 2018	(r477783)
@@ -1,13 +1,22 @@
---- chrome/test/base/in_process_browser_test.cc.orig	2017-06-05 19:03:04 UTC
-+++ chrome/test/base/in_process_browser_test.cc
-@@ -95,6 +95,10 @@
+--- chrome/test/base/in_process_browser_test.cc.orig	2018-08-08 21:10:43.000000000 +0200
++++ chrome/test/base/in_process_browser_test.cc	2018-08-21 00:58:24.257483000 +0200
+@@ -69,6 +69,10 @@
+ #include "chrome/test/base/scoped_bundle_swizzler_mac.h"
+ #endif
  
- namespace {
- 
 +#if defined(OS_FREEBSD)
 +#include <signal.h>
 +#endif
 +
- // Passed as value of kTestType.
- const char kBrowserTestType[] = "browser";
+ #if defined(OS_WIN)
+ #include "base/win/scoped_com_initializer.h"
+ #include "base/win/windows_version.h"
+@@ -88,7 +92,7 @@
+ #include "chrome/test/base/default_ash_event_generator_delegate.h"
+ #endif  // defined(OS_CHROMEOS)
+ 
+-#if !defined(OS_CHROMEOS) && defined(OS_LINUX)
++#if !defined(OS_CHROMEOS) && (defined(OS_LINUX) || defined(OS_BSD))
+ #include "ui/views/test/test_desktop_screen_x11.h"
+ #endif
  

Modified: head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h
==============================================================================
--- head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h	Wed Aug 22 10:01:02 2018	(r477782)
+++ head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_internal.h	Wed Aug 22 10:11:13 2018	(r477783)
@@ -1,6 +1,6 @@
---- third_party/angle/src/gpu_info_util/SystemInfo_internal.h.orig	2017-09-10 02:31:40.635170000 +0200
-+++ third_party/angle/src/gpu_info_util/SystemInfo_internal.h	2017-09-10 02:32:27.153701000 +0200
-@@ -14,6 +14,8 @@
+--- third_party/angle/src/gpu_info_util/SystemInfo_internal.h.orig	2018-08-08 12:13:09.000000000 -0700
++++ third_party/angle/src/gpu_info_util/SystemInfo_internal.h	2018-08-20 09:43:56.141492000 -0700
+@@ -14,8 +14,13 @@
  namespace angle
  {
  
@@ -8,4 +8,9 @@
 +
  // Defined in SystemInfo_libpci when GPU_INFO_USE_LIBPCI is defined.
  bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices);
++#if defined(__FreeBSD__)
++bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices);
++#endif
  // Defined in SystemInfo_x11 when GPU_INFO_USE_X11 is defined.
+ bool GetNvidiaDriverVersionWithXNVCtrl(std::string *version);
+ 

Added: head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_libpci.cpp	Wed Aug 22 10:11:13 2018	(r477783)
@@ -0,0 +1,90 @@
+--- third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp.orig	2018-08-20 10:00:10.885543000 -0700
++++ third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp	2018-08-20 09:50:32.387980000 -0700
+@@ -12,6 +12,11 @@
+ #include <pci/pci.h>
+ #include <unistd.h>
+ 
++#if defined(__FreeBSD__)
++#include <fcntl.h>
++#include <sys/pciio.h>
++#endif
++
+ #include "common/angleutils.h"
+ #include "common/debug.h"
+ 
+@@ -82,6 +87,75 @@
+ };
+ 
+ }  // anonymous namespace
++
++#if defined(__FreeBSD__)
++// Adds an entry per PCI GPU found and fills the device and vendor ID.
++bool GetPCIDevicesFreeBSD(std::vector<GPUDeviceInfo> *devices)
++{
++    int fd;
++    struct pci_conf_io conf;
++    struct pci_conf *matches;
++    uint32_t offset = 0;
++
++    fd = open("/dev/pci", O_RDONLY);
++    if (fd < 0)
++        return false;
++
++    matches = new struct pci_conf[32];
++    conf.generation = 0;
++    do {
++        conf.pat_buf_len = 0;
++        conf.num_patterns = 0;
++        conf.patterns = NULL;
++        conf.match_buf_len = 32 * sizeof(struct pci_conf);
++        conf.num_matches = 32;
++        conf.matches = matches;
++        conf.offset = offset;
++        conf.status = PCI_GETCONF_ERROR;
++        if (ioctl(fd, PCIOCGETCONF, &conf) < 0) {
++            if (errno == ENODEV)
++                break;
++        }
++        /* PCI_GETCONF_LIST_CHANGED would require us to start over. */
++        if (conf.status == PCI_GETCONF_ERROR || conf.status == PCI_GETCONF_LIST_CHANGED) {
++            break;
++        }
++
++        for (unsigned int i = 0; i < conf.num_matches; i++) {
++            uint16_t device_class = (matches[i].pc_class << 8) |  matches[i].pc_subclass;
++
++            // Skip non-GPU devices
++            switch (device_class)
++            {
++                case PCI_CLASS_DISPLAY_VGA:
++                case PCI_CLASS_DISPLAY_XGA:
++                case PCI_CLASS_DISPLAY_3D:
++                    break;
++                default:
++                    continue;
++            }
++
++            // Skip unknown devices
++            if (matches[i].pc_vendor == 0 || matches[i].pc_device == 0) {
++                continue;
++            }
++
++            GPUDeviceInfo info;
++            info.vendorId = matches[i].pc_vendor;
++            info.deviceId = matches[i].pc_device;
++
++            devices->push_back(info);
++        }
++        offset += conf.num_matches;
++    } while (conf.status == PCI_GETCONF_MORE_DEVS);
++
++    delete[] matches;
++
++    close(fd);
++
++    return true;
++}
++#endif
+ 
+ // Adds an entry per PCI GPU found and fills the device and vendor ID.
+ bool GetPCIDevicesWithLibPCI(std::vector<GPUDeviceInfo> *devices)

Modified: head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp
==============================================================================
--- head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp	Wed Aug 22 10:01:02 2018	(r477782)
+++ head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_linux.cpp	Wed Aug 22 10:11:13 2018	(r477783)
@@ -1,13 +1,14 @@
---- third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp.orig	2017-09-10 02:34:01.568975000 +0200
-+++ third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp	2017-09-10 02:35:52.870068000 +0200
-@@ -71,10 +71,17 @@
+--- third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp.orig	2018-08-08 12:13:09.000000000 -0700
++++ third_party/angle/src/gpu_info_util/SystemInfo_linux.cpp	2018-08-20 09:50:36.331947000 -0700
+@@ -71,10 +71,18 @@
  
  bool GetSystemInfo(SystemInfo *info)
  {
 +#if defined(__FreeBSD__)
 +    if (!CollectMesaCardInfo(&(info->gpus)))
 +    {
-+        return false;
++        if (!GetPCIDevicesFreeBSD(&(info->gpus)))
++            return false;
 +    }
 +#else
      if (!GetPCIDevicesWithLibPCI(&(info->gpus)))

Modified: head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp
==============================================================================
--- head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp	Wed Aug 22 10:01:02 2018	(r477782)
+++ head/www/iridium/files/patch-third__party_angle_src_gpu_info_util_SystemInfo_x11.cpp	Wed Aug 22 10:11:13 2018	(r477783)
@@ -1,5 +1,5 @@
---- third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp.orig	2017-12-15 02:05:36.000000000 +0100
-+++ third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp	2017-12-30 05:11:53.917801000 +0100
+--- third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp.orig	2018-08-08 12:13:09.000000000 -0700
++++ third_party/angle/src/gpu_info_util/SystemInfo_x11.cpp	2018-08-20 09:34:48.052352000 -0700
 @@ -8,6 +8,8 @@
  
  #include "gpu_info_util/SystemInfo_internal.h"
@@ -9,7 +9,7 @@
  #include <X11/Xlib.h>
  
  #include "common/debug.h"
-@@ -18,8 +20,40 @@
+@@ -18,8 +20,43 @@
  #error SystemInfo_x11.cpp compiled without GPU_INFO_USE_X11
  #endif
  
@@ -32,6 +32,9 @@
 +    PFNGLXQUERYRENDERERINTEGERMESAPROC queryInteger =
 +        (PFNGLXQUERYRENDERERINTEGERMESAPROC) glXGetProcAddressARB((const GLubyte *)
 +        "glXQueryRendererIntegerMESA");
++
++    if (!queryInteger)
++        return false;
 +
 +    bool vendor_ret =
 +        queryInteger(display, 0, 0, GLX_RENDERER_VENDOR_ID_MESA, vid);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808221011.w7MABDlV069695>