mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 09:58:03 +02:00
3rdparty (igcl): write our implementation
This commit is contained in:
Vendored
-27
@@ -1,27 +0,0 @@
|
||||
Intel Software License Agreement
|
||||
10.07.21
|
||||
|
||||
Use and Redistribution. You may use and redistribute Intel’s Control API software and the header files for the Intel® Graphics Control Library (collectively, the “Software”), solely for use on Intel platforms, provided the following conditions are met:
|
||||
* Redistributions must reproduce the above copyright notice and the following terms of use in the Software and in the documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Intel nor the names of its suppliers may be used to endorse or promote products derived from this Software without specific prior written permission.
|
||||
* No reverse engineering, decompilation, or disassembly of Software provided to you in binary form is permitted.
|
||||
|
||||
Third Party Software. The Software may contain Third Party Software. “Third Party Software” is third party software, open source software or other Intel software listed in the “third-party-software.txt” or other similarly named text file that is included with the Software. Third Party Software, even if included with the distribution of the Software, may be governed by separate license terms, including without limitation, third party license terms, open source software notices and terms, and/or other Intel software license terms. These separate license terms solely govern your use of the Third Party Software.
|
||||
|
||||
Ownership. Title to the Software and all copies remain with Intel or its suppliers.
|
||||
|
||||
DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND ATTORNEYS’ FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE.
|
||||
|
||||
LIMITATION OF LIABILITY; INDEMNITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. YOU AGREE TO INDEMNIFY, DEFEND, AND HOLD INTEL HARMLESS AGAINST ANY CLAIMS, DAMAGES, AND EXPENSES RESULTING FROM YOUR USE OR UNAUTHORIZED USE OF THE SOFTWARE.
|
||||
|
||||
No support. Intel may make changes to the Software, at any time without notice, and is not obligated to support, update or provide training for the Software.
|
||||
|
||||
Termination. Your right to use the Software is terminated immediately in the event of your breach of this agreement.
|
||||
|
||||
Feedback. Should you provide Intel with comments, modifications, corrections, enhancements or other input (“Feedback”) related to the Software Intel will be free to use, disclose, reproduce, license or otherwise distribute or exploit the Feedback in its sole discretion without any obligations or restrictions of any kind, including without limitation, intellectual property rights or licensing obligations.
|
||||
|
||||
Compliance with laws. You agree to comply with all applicable laws and regulations governing your use, transfer, import or export (or prohibition thereof) of the Software.
|
||||
|
||||
Governing law. All disputes will be governed by the laws of the United States of America and the State of Delaware without reference to conflict of law principles and subject to the exclusive jurisdiction of the state or federal courts sitting in the State of Delaware, and each party agrees that it submits to the personal jurisdiction and venue of those courts and waives any objections. The United Nations Convention on Contracts for the International Sale of Goods (1980) is specifically excluded and will not apply to the Software.
|
||||
|
||||
Severability. The parties intend that if a court holds that any provision of this agreement is invalid or unenforceable under applicable law, the court will modify the provision to the minimum extent necessary to make it valid and enforceable or sever and delete the provision from this agreement. Any change to or deletion of a provision of this agreement under this Section will not affect the validity or enforceability of the remainder of this agreement, which will continue in full force and effect.
|
||||
Vendored
-7906
File diff suppressed because it is too large
Load Diff
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"home": "https://github.com/intel/drivers.gpu.control-library",
|
||||
"license": "./LICENSE",
|
||||
"version": "v184",
|
||||
"author": "Intel Corporation"
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
#include "gpu_driver_specific.h"
|
||||
|
||||
#include "3rdparty/igcl/igcl_api.h"
|
||||
#include "common/library.h"
|
||||
#include "util/mallocHelper.h"
|
||||
#include "igcl.h"
|
||||
|
||||
struct FFIgclData {
|
||||
FF_LIBRARY_SYMBOL(ctlClose)
|
||||
@@ -47,7 +47,7 @@ const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverRe
|
||||
FF_LIBRARY_LOAD_SYMBOL_VAR_MESSAGE(libigcl, igclData, ctlFrequencyGetProperties)
|
||||
|
||||
if (ffctlInit(&(ctl_init_args_t) {
|
||||
.AppVersion = CTL_MAKE_VERSION(CTL_IMPL_MAJOR_VERSION, CTL_IMPL_MINOR_VERSION),
|
||||
.AppVersion = CTL_IMPL_VERSION,
|
||||
.flags = CTL_INIT_FLAG_USE_LEVEL_ZERO,
|
||||
.Size = sizeof(ctl_init_args_t),
|
||||
.Version = 0,
|
||||
|
||||
@@ -0,0 +1,169 @@
|
||||
#pragma once
|
||||
|
||||
// DISCLAIMER:
|
||||
// THIS FILE IS CREATED FROM SCRATCH, BY READING THE OFFICIAL IGCL API
|
||||
// DOCUMENTATION REFERENCED BELOW, IN ORDER TO MAKE FASTFETCH MIT COMPLIANT.
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv412ctl_result_t
|
||||
typedef enum ctl_result_t
|
||||
{
|
||||
CTL_RESULT_SUCCESS = 0,
|
||||
} ctl_result_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv420ctl_application_id_t
|
||||
typedef struct ctl_application_id_t
|
||||
{
|
||||
uint32_t Data1;
|
||||
uint16_t Data2;
|
||||
uint16_t Data3;
|
||||
uint8_t Data4[8];
|
||||
} ctl_application_id_t;
|
||||
|
||||
#define CTL_IMPL_VERSION (( 1 /*major*/ << 16 )|( 1 /*minor*/ & 0x0000ffff))
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv415ctl_init_flag_t
|
||||
typedef enum ctl_init_flag_t
|
||||
{
|
||||
CTL_INIT_FLAG_USE_LEVEL_ZERO = 1,
|
||||
CTL_INIT_FLAG_MAX
|
||||
} ctl_init_flag_t;
|
||||
|
||||
typedef uint32_t ctl_version_info_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv415ctl_init_args_t
|
||||
typedef struct ctl_init_args_t
|
||||
{
|
||||
uint32_t Size;
|
||||
uint8_t Version;
|
||||
ctl_version_info_t AppVersion;
|
||||
ctl_init_flag_t flags;
|
||||
ctl_version_info_t SupportedVersion;
|
||||
ctl_application_id_t ApplicationUID;
|
||||
} ctl_init_args_t;
|
||||
|
||||
typedef struct ctl_api_handle_t* ctl_api_handle_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv47ctlInitP15ctl_init_args_tP16ctl_api_handle_t
|
||||
extern ctl_result_t ctlInit(ctl_init_args_t *pInitDesc, ctl_api_handle_t *phAPIHandle);
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#ctlclose
|
||||
extern ctl_result_t ctlClose(ctl_api_handle_t hAPIHandle);
|
||||
|
||||
typedef struct ctl_device_adapter_handle_t* ctl_device_adapter_handle_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv419ctlEnumerateDevices16ctl_api_handle_tP8uint32_tP27ctl_device_adapter_handle_t
|
||||
extern ctl_result_t ctlEnumerateDevices(ctl_api_handle_t hAPIHandle, uint32_t *pCount, ctl_device_adapter_handle_t* phDevices);
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv417ctl_device_type_t
|
||||
typedef enum ctl_device_type_t
|
||||
{
|
||||
CTL_DEVICE_TYPE_GRAPHICS = 1,
|
||||
CTL_DEVICE_TYPE_SYSTEM = 2,
|
||||
CTL_DEVICE_TYPE_MAX
|
||||
} ctl_device_type_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv422ctl_firmware_version_t
|
||||
typedef struct ctl_firmware_version_t
|
||||
{
|
||||
uint64_t major_version;
|
||||
uint64_t minor_version;
|
||||
uint64_t build_number;
|
||||
} ctl_firmware_version_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv417ctl_adapter_bdf_t
|
||||
typedef struct ctl_adapter_bdf_t
|
||||
{
|
||||
uint8_t bus;
|
||||
uint8_t device;
|
||||
uint8_t function;
|
||||
} ctl_adapter_bdf_t;
|
||||
|
||||
#define IGCL_CTL_MAX_DEVICE_NAME_LEN 100
|
||||
#define IGCL_CTL_MAX_RESERVED_SIZE 112
|
||||
|
||||
typedef enum ctl_adapter_properties_flag_t
|
||||
{
|
||||
CTL_ADAPTER_PROPERTIES_FLAG_INTEGRATED = 1,
|
||||
} ctl_adapter_properties_flag_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv431ctl_device_adapter_properties_t
|
||||
typedef struct ctl_device_adapter_properties_t
|
||||
{
|
||||
uint32_t Size;
|
||||
uint8_t Version;
|
||||
void* pDeviceID;
|
||||
uint32_t device_id_size;
|
||||
ctl_device_type_t device_type;
|
||||
uint32_t /*ctl_supported_functions_flags_t*/ supported_subfunction_flags;
|
||||
uint64_t driver_version;
|
||||
ctl_firmware_version_t firmware_version;
|
||||
uint32_t pci_vendor_id;
|
||||
uint32_t pci_device_id;
|
||||
uint32_t rev_id;
|
||||
uint32_t num_eus_per_sub_slice;
|
||||
uint32_t num_sub_slices_per_slice;
|
||||
uint32_t num_slices;
|
||||
char name[IGCL_CTL_MAX_DEVICE_NAME_LEN];
|
||||
ctl_adapter_properties_flag_t graphics_adapter_properties;
|
||||
uint32_t Frequency;
|
||||
uint16_t pci_subsys_id;
|
||||
uint16_t pci_subsys_vendor_id;
|
||||
ctl_adapter_bdf_t adapter_bdf;
|
||||
char reserved[IGCL_CTL_MAX_RESERVED_SIZE];
|
||||
} ctl_device_adapter_properties_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv422ctlGetDeviceProperties27ctl_device_adapter_handle_tP31ctl_device_adapter_properties_t
|
||||
extern ctl_result_t ctlGetDeviceProperties(ctl_device_adapter_handle_t hDAhandle, ctl_device_adapter_properties_t* pProperties);
|
||||
|
||||
typedef struct ctl_temp_handle_t* ctl_temp_handle_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#ctlenumtemperaturesensors
|
||||
extern ctl_result_t ctlEnumTemperatureSensors(ctl_device_adapter_handle_t hDAhandle, uint32_t* pCount, ctl_temp_handle_t* phTemperature);
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#ctltemperaturegetstate
|
||||
extern ctl_result_t ctlTemperatureGetState(ctl_temp_handle_t hTemperature, double* pTemperature);
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv420ctlEnumMemoryModules27ctl_device_adapter_handle_tP8uint32_tP16ctl_mem_handle_t
|
||||
|
||||
typedef struct ctl_mem_handle_t* ctl_mem_handle_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv420ctlEnumMemoryModules27ctl_device_adapter_handle_tP8uint32_tP16ctl_mem_handle_t
|
||||
extern ctl_result_t ctlEnumMemoryModules(ctl_device_adapter_handle_t hDAhandle, uint32_t *pCount, ctl_mem_handle_t* phMemory);
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv415ctl_mem_state_t
|
||||
typedef struct ctl_mem_state_t
|
||||
{
|
||||
uint32_t Size;
|
||||
uint8_t Version;
|
||||
uint64_t free;
|
||||
uint64_t size;
|
||||
} ctl_mem_state_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv417ctlMemoryGetState16ctl_mem_handle_tP15ctl_mem_state_t
|
||||
extern ctl_result_t ctlMemoryGetState(ctl_mem_handle_t hMemory, ctl_mem_state_t *pState);
|
||||
|
||||
typedef struct ctl_freq_handle_t* ctl_freq_handle_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#ctlenumfrequencydomains
|
||||
extern ctl_result_t ctlEnumFrequencyDomains(ctl_device_adapter_handle_t hDAhandle, uint32_t* pCount, ctl_freq_handle_t* phFrequency);
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv417ctl_freq_domain_t
|
||||
typedef enum ctl_freq_domain_t
|
||||
{
|
||||
CTL_FREQ_DOMAIN_GPU = 0,
|
||||
CTL_FREQ_DOMAIN_MEMORY = 1,
|
||||
CTL_FREQ_DOMAIN_MAX
|
||||
} ctl_freq_domain_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv421ctl_freq_properties_t
|
||||
typedef struct ctl_freq_properties_t
|
||||
{
|
||||
uint32_t Size;
|
||||
uint8_t Version;
|
||||
ctl_freq_domain_t type;
|
||||
bool canControl;
|
||||
double min;
|
||||
double max;
|
||||
} ctl_freq_properties_t;
|
||||
|
||||
// https://intel.github.io/drivers.gpu.control-library/Control/api.html#_CPPv425ctlFrequencyGetProperties17ctl_freq_handle_tP21ctl_freq_properties_t
|
||||
extern ctl_result_t ctlFrequencyGetProperties(ctl_freq_handle_t hFrequency, ctl_freq_properties_t* pProperties);
|
||||
Reference in New Issue
Block a user