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
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
gputypes();
|
gputypes();
|
||||||
enum Type{NV, AMD};
|
//enum Type{NV, AMD};
|
||||||
struct GPU
|
struct GPU
|
||||||
{
|
{
|
||||||
int gputype;
|
int gputype;
|
||||||
@ -137,4 +137,46 @@ public slots:
|
|||||||
private slots:
|
private slots:
|
||||||
};
|
};
|
||||||
#endif
|
#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
|
#endif // GPUTYPES_H
|
||||||
|
@ -22,12 +22,16 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
#ifdef NVIDIA
|
#ifdef NVIDIA
|
||||||
nv = new nvidia;
|
nv = new nvidia;
|
||||||
types = nv;
|
types = nv;
|
||||||
|
#endif
|
||||||
|
#ifdef AMD
|
||||||
|
amdptr = new amd;
|
||||||
|
types = amdptr;
|
||||||
#endif
|
#endif
|
||||||
// This is for libxnvctrl
|
// This is for libxnvctrl
|
||||||
types->setupGPU();
|
types->setupGPU();
|
||||||
// This is for NVML
|
// This is for NVML
|
||||||
types->setupGPUSecondary(currentGPUIndex);
|
types->setupGPUSecondary(currentGPUIndex);
|
||||||
types->queryGPUFeatures();
|
/*types->queryGPUFeatures();
|
||||||
types->queryGPUFreqOffset(currentGPUIndex);
|
types->queryGPUFreqOffset(currentGPUIndex);
|
||||||
types->queryGPUMemClkOffset(currentGPUIndex);
|
types->queryGPUMemClkOffset(currentGPUIndex);
|
||||||
types->queryGPUVoltageOffset(currentGPUIndex);
|
types->queryGPUVoltageOffset(currentGPUIndex);
|
||||||
@ -39,10 +43,11 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
for (int i=0; i<types->gpuCount; i++) {
|
for (int i=0; i<types->gpuCount; i++) {
|
||||||
ui->GPUComboBox->addItem("GPU-" + QString::number(i) + ": " + types->GPUList[i].name);
|
ui->GPUComboBox->addItem("GPU-" + QString::number(i) + ": " + types->GPUList[i].name);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
loadProfileSettings();
|
loadProfileSettings();
|
||||||
setupMonitorTab();
|
setupMonitorTab();
|
||||||
setupGraphMonitorTab();
|
setupGraphMonitorTab();
|
||||||
|
/*
|
||||||
// Enable sliders according to GPU properties
|
// Enable sliders according to GPU properties
|
||||||
if (types->GPUList[currentGPUIndex].overClockAvailable) {
|
if (types->GPUList[currentGPUIndex].overClockAvailable) {
|
||||||
ui->frequencySlider->setRange(types->GPUList[currentGPUIndex].minCoreClkOffset, types->GPUList[currentGPUIndex].maxCoreClkOffset);
|
ui->frequencySlider->setRange(types->GPUList[currentGPUIndex].minCoreClkOffset, types->GPUList[currentGPUIndex].maxCoreClkOffset);
|
||||||
@ -103,7 +108,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
manualMode->setEnabled(false);
|
manualMode->setEnabled(false);
|
||||||
manualMode->setToolTip("Manual fan control is not available for current GPU");
|
manualMode->setToolTip("Manual fan control is not available for current GPU");
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
connect(fanUpdateTimer, SIGNAL(timeout()), this, SLOT(fanSpeedUpdater()));
|
connect(fanUpdateTimer, SIGNAL(timeout()), this, SLOT(fanSpeedUpdater()));
|
||||||
fanUpdateTimer->start(2000);
|
fanUpdateTimer->start(2000);
|
||||||
|
|
||||||
|
@ -157,6 +157,9 @@ private:
|
|||||||
QString latestUUID;
|
QString latestUUID;
|
||||||
#ifdef NVIDIA
|
#ifdef NVIDIA
|
||||||
nvidia *nv;
|
nvidia *nv;
|
||||||
|
#endif
|
||||||
|
#ifdef AMD
|
||||||
|
amd *amdptr;
|
||||||
#endif
|
#endif
|
||||||
gputypes *types;
|
gputypes *types;
|
||||||
|
|
||||||
|
@ -27,7 +27,8 @@ CONFIG (release, debug|release) {
|
|||||||
DEFINES += QT_NO_DEBUG_OUTPUT
|
DEFINES += QT_NO_DEBUG_OUTPUT
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINES += NVIDIA
|
#DEFINES += NVIDIA
|
||||||
|
DEFINES += AMD
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
main.cpp \
|
main.cpp \
|
||||||
@ -37,7 +38,8 @@ SOURCES += \
|
|||||||
newprofile.cpp \
|
newprofile.cpp \
|
||||||
plotwidget.cpp \
|
plotwidget.cpp \
|
||||||
nvidia.cpp \
|
nvidia.cpp \
|
||||||
gputypes.cpp
|
gputypes.cpp \
|
||||||
|
amd.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
mainwindow.h \
|
mainwindow.h \
|
||||||
@ -58,7 +60,7 @@ FORMS += \
|
|||||||
INCLUDEPATH += "/usr/lib"
|
INCLUDEPATH += "/usr/lib"
|
||||||
INCLUDEPATH += $$(INCLUDEPATH)
|
INCLUDEPATH += $$(INCLUDEPATH)
|
||||||
|
|
||||||
LIBS += -lXext -lXNVCtrl -lX11 -lnvidia-ml
|
#LIBS += -lXext -lXNVCtrl -lX11 -lnvidia-ml
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
|
Loading…
Reference in New Issue
Block a user