mirror of
https://github.com/Lurkki14/tuxclocker.git
synced 2025-02-25 18:55:24 -06:00
Add AMD placeholder functions
This commit is contained in:
parent
588ff85f34
commit
882a37dff2
37
amd.cpp
Normal file
37
amd.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
#ifdef AMD
|
||||
#include "gputypes.h"
|
||||
|
||||
amd::amd() {}
|
||||
bool amd::setupGPU()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool amd::setupGPUSecondary(int GPUIndex){return true;}
|
||||
void amd::queryGPUCount(){}
|
||||
void amd::queryGPUNames(){}
|
||||
void amd::queryGPUUIDs(){}
|
||||
void amd::queryGPUFeatures(){}
|
||||
void amd::queryGPUVoltage(int GPUIndex){}
|
||||
void amd::queryGPUTemp(int GPUIndex){}
|
||||
void amd::queryGPUFrequencies(int GPUIndex){}
|
||||
void amd::queryGPUFanSpeed(int GPUIndex){}
|
||||
void amd::queryGPUUsedVRAM(int GPUIndex){}
|
||||
void amd::queryGPUFreqOffset(int GPUIndex){}
|
||||
void amd::queryGPUMemClkOffset(int GPUIndex){}
|
||||
void amd::queryGPUVoltageOffset(int GPUIndex){}
|
||||
|
||||
void amd::queryGPUUtils(int GPUIndex){}
|
||||
void amd::queryGPUPowerDraw(int GPUIndex){}
|
||||
void amd::queryGPUPowerLimit(int GPUIndex){}
|
||||
void amd::queryGPUPowerLimitLimits(int GPUIndex){}
|
||||
void amd::queryGPUCurrentMaxClocks(int GPUIndex){}
|
||||
void amd::queryGPUPowerLimitAvailability(int GPUIndex){}
|
||||
|
||||
bool amd::assignGPUFanSpeed(int GPUIndex, int targetValue){}
|
||||
bool amd::assignGPUFanCtlMode(int GPUIndex, bool manual){}
|
||||
bool amd::assignGPUFreqOffset(int GPUIndex, int targetValue){}
|
||||
bool amd::assignGPUMemClockOffset(int GPUIndex, int targetValue){}
|
||||
bool amd::assignGPUVoltageOffset(int GPUIndex, int targetValue){}
|
||||
bool amd::assignGPUPowerLimit(uint targetValue){}
|
||||
|
||||
#endif
|
44
gputypes.h
44
gputypes.h
@ -14,7 +14,7 @@ class gputypes : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
gputypes();
|
||||
enum Type{NV, AMD};
|
||||
//enum Type{NV, AMD};
|
||||
struct GPU
|
||||
{
|
||||
int gputype;
|
||||
@ -137,4 +137,46 @@ public slots:
|
||||
private slots:
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef AMD
|
||||
class amd : public gputypes
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
amd();
|
||||
signals:
|
||||
public slots:
|
||||
bool setupGPU();
|
||||
bool setupGPUSecondary(int GPUIndex);
|
||||
void queryGPUCount();
|
||||
void queryGPUNames();
|
||||
void queryGPUUIDs();
|
||||
void queryGPUFeatures();
|
||||
void queryGPUVoltage(int GPUIndex);
|
||||
void queryGPUTemp(int GPUIndex);
|
||||
void queryGPUFrequencies(int GPUIndex);
|
||||
void queryGPUFanSpeed(int GPUIndex);
|
||||
void queryGPUUsedVRAM(int GPUIndex);
|
||||
void queryGPUFreqOffset(int GPUIndex);
|
||||
void queryGPUMemClkOffset(int GPUIndex);
|
||||
void queryGPUVoltageOffset(int GPUIndex);
|
||||
|
||||
void queryGPUUtils(int GPUIndex);
|
||||
void queryGPUPowerDraw(int GPUIndex);
|
||||
void queryGPUPowerLimit(int GPUIndex);
|
||||
void queryGPUPowerLimitLimits(int GPUIndex);
|
||||
void queryGPUCurrentMaxClocks(int GPUIndex);
|
||||
void queryGPUPowerLimitAvailability(int GPUIndex);
|
||||
|
||||
bool assignGPUFanSpeed(int GPUIndex, int targetValue);
|
||||
bool assignGPUFanCtlMode(int GPUIndex, bool manual);
|
||||
bool assignGPUFreqOffset(int GPUIndex, int targetValue);
|
||||
bool assignGPUMemClockOffset(int GPUIndex, int targetValue);
|
||||
bool assignGPUVoltageOffset(int GPUIndex, int targetValue);
|
||||
// NVML functions know the GPU index already based on the dev object passed in setupNVML()
|
||||
bool assignGPUPowerLimit(uint targetValue);
|
||||
private slots:
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // GPUTYPES_H
|
||||
|
@ -22,12 +22,16 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
#ifdef NVIDIA
|
||||
nv = new nvidia;
|
||||
types = nv;
|
||||
#endif
|
||||
#ifdef AMD
|
||||
amdptr = new amd;
|
||||
types = amdptr;
|
||||
#endif
|
||||
// This is for libxnvctrl
|
||||
types->setupGPU();
|
||||
// This is for NVML
|
||||
types->setupGPUSecondary(currentGPUIndex);
|
||||
types->queryGPUFeatures();
|
||||
/*types->queryGPUFeatures();
|
||||
types->queryGPUFreqOffset(currentGPUIndex);
|
||||
types->queryGPUMemClkOffset(currentGPUIndex);
|
||||
types->queryGPUVoltageOffset(currentGPUIndex);
|
||||
@ -39,10 +43,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
for (int i=0; i<types->gpuCount; i++) {
|
||||
ui->GPUComboBox->addItem("GPU-" + QString::number(i) + ": " + types->GPUList[i].name);
|
||||
}
|
||||
*/
|
||||
loadProfileSettings();
|
||||
setupMonitorTab();
|
||||
setupGraphMonitorTab();
|
||||
|
||||
/*
|
||||
// Enable sliders according to GPU properties
|
||||
if (types->GPUList[currentGPUIndex].overClockAvailable) {
|
||||
ui->frequencySlider->setRange(types->GPUList[currentGPUIndex].minCoreClkOffset, types->GPUList[currentGPUIndex].maxCoreClkOffset);
|
||||
@ -103,7 +108,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
manualMode->setEnabled(false);
|
||||
manualMode->setToolTip("Manual fan control is not available for current GPU");
|
||||
}
|
||||
|
||||
*/
|
||||
connect(fanUpdateTimer, SIGNAL(timeout()), this, SLOT(fanSpeedUpdater()));
|
||||
fanUpdateTimer->start(2000);
|
||||
|
||||
|
@ -157,6 +157,9 @@ private:
|
||||
QString latestUUID;
|
||||
#ifdef NVIDIA
|
||||
nvidia *nv;
|
||||
#endif
|
||||
#ifdef AMD
|
||||
amd *amdptr;
|
||||
#endif
|
||||
gputypes *types;
|
||||
|
||||
|
@ -27,7 +27,8 @@ CONFIG (release, debug|release) {
|
||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||
}
|
||||
|
||||
DEFINES += NVIDIA
|
||||
#DEFINES += NVIDIA
|
||||
DEFINES += AMD
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
@ -37,7 +38,8 @@ SOURCES += \
|
||||
newprofile.cpp \
|
||||
plotwidget.cpp \
|
||||
nvidia.cpp \
|
||||
gputypes.cpp
|
||||
gputypes.cpp \
|
||||
amd.cpp
|
||||
|
||||
HEADERS += \
|
||||
mainwindow.h \
|
||||
@ -58,7 +60,7 @@ FORMS += \
|
||||
INCLUDEPATH += "/usr/lib"
|
||||
INCLUDEPATH += $$(INCLUDEPATH)
|
||||
|
||||
LIBS += -lXext -lXNVCtrl -lX11 -lnvidia-ml
|
||||
#LIBS += -lXext -lXNVCtrl -lX11 -lnvidia-ml
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
|
Loading…
Reference in New Issue
Block a user