Files
fastfetch/src/detection/gpu/gpu_driver_specific.h
T

51 lines
1.3 KiB
C
Raw Normal View History

#pragma once
#include "gpu.h"
typedef enum FFGpuDriverConditionType
{
FF_GPU_DRIVER_CONDITION_TYPE_BUS_ID = 1 << 0,
FF_GPU_DRIVER_CONDITION_TYPE_DEVICE_ID = 1 << 1,
FF_GPU_DRIVER_CONDITION_TYPE_LUID = 1 << 2,
} FFGpuDriverConditionType;
typedef struct FFGpuDriverPciBusId
{
uint32_t domain;
uint32_t bus;
uint32_t device;
uint32_t func;
} FFGpuDriverPciBusId;
typedef struct FFGpuDriverPciDeviceId
{
uint32_t deviceId;
uint32_t vendorId;
uint32_t subSystemId;
uint32_t revId;
} FFGpuDriverPciDeviceId;
// Use pciBusId if not NULL; use pciDeviceId otherwise
typedef struct FFGpuDriverCondition
{
FFGpuDriverConditionType type;
FFGpuDriverPciBusId pciBusId;
FFGpuDriverPciDeviceId pciDeviceId;
uint64_t luid;
} FFGpuDriverCondition;
// detect x if not NULL
typedef struct FFGpuDriverResult
{
double* temp;
FFGPUMemory* memory;
uint32_t* coreCount;
2024-08-01 14:10:07 +08:00
double* coreUsage;
FFGPUType* type;
2024-07-17 14:52:35 +08:00
uint32_t* frequency;
} FFGpuDriverResult;
const char* ffDetectNvidiaGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResult result, const char* soName);
const char* ffDetectIntelGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResult result, const char* soName);
2023-12-21 14:53:35 +08:00
const char* ffDetectAmdGpuInfo(const FFGpuDriverCondition* cond, FFGpuDriverResult result, const char* soName);