Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Apr 2020 15:10:23 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r533253 - head/lang/intel-compute-runtime/files
Message-ID:  <202004281510.03SFANJL075814@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Tue Apr 28 15:10:22 2020
New Revision: 533253
URL: https://svnweb.freebsd.org/changeset/ports/533253

Log:
  lang/intel-compute-runtime: simplify r532647 by dropping fstat

Modified:
  head/lang/intel-compute-runtime/files/patch-max_freq   (contents, props changed)

Modified: head/lang/intel-compute-runtime/files/patch-max_freq
==============================================================================
--- head/lang/intel-compute-runtime/files/patch-max_freq	Tue Apr 28 14:52:41 2020	(r533252)
+++ head/lang/intel-compute-runtime/files/patch-max_freq	Tue Apr 28 15:10:22 2020	(r533253)
@@ -5,14 +5,14 @@
 
 --- shared/source/os_interface/linux/drm_query.cpp.orig	2020-04-17 18:43:38 UTC
 +++ shared/source/os_interface/linux/drm_query.cpp
-@@ -11,10 +11,41 @@
+@@ -11,10 +11,37 @@
  
  #include <fstream>
  
 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
 +#include <sys/param.h>
 +#include <sys/sysctl.h>
-+#include <sys/stat.h>
++#include <cstdio>
 +#include <cstdlib>
 +#endif
 +
@@ -21,12 +21,8 @@
  int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int &maxGpuFrequency) {
      maxGpuFrequency = 0;
 +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-+    struct stat sb;
-+    if (fstat(getFileDescriptor(), &sb)) {
-+        return 0;
-+    }
 +    char name[SPECNAMELEN + 1];
-+    if (!devname_r(sb.st_rdev, S_IFCHR, name, sizeof(name))) {
++    if (!fdevname_r(getFileDescriptor(), name, sizeof(name))) {
 +        return 0;
 +    }
 +    int id;
@@ -47,7 +43,7 @@
      std::string clockSysFsPath = getSysFsPciPath();
  
      clockSysFsPath += "/gt_max_freq_mhz";
-@@ -26,6 +57,7 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int 
+@@ -26,6 +53,7 @@ int Drm::getMaxGpuFrequency(HardwareInfo &hwInfo, int 
  
      ifs >> maxGpuFrequency;
      ifs.close();



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