Skip to content

Instantly share code, notes, and snippets.

@Danysan1
Last active January 8, 2017 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Danysan1/bcb6fad12ad73f8e6d73ac58aeb3593f to your computer and use it in GitHub Desktop.
Save Danysan1/bcb6fad12ad73f8e6d73ac58aeb3593f to your computer and use it in GitHub Desktop.
diff --git a/flatpak-builder.json b/flatpak-builder.json
new file mode 100644
index 0000000..95451ca
--- /dev/null
+++ b/flatpak-builder.json
@@ -0,0 +1,33 @@
+{
+ "app-id": "org.rp.RadeonProfile",
+ "runtime": "org.kde.Platform",
+ "sdk": "org.kde.Sdk",
+ "command": "radeon-profile",
+ "rename-icon": "radeon-profile",
+ "rename-desktop-file": "radeon-profile.desktop",
+ "rename-appdata-file": "radeon-profile.appdata.xml",
+ "finish-args": [
+ "--device=dri",
+ "--socket=x11",
+ "--share=ipc",
+ "--filesystem=/tmp",
+ "--filesystem=/sys/kernel/debug/dri",
+ "--filesystem=/sys/class/drm",
+ "--filesystem=/sys/class/hwmon"
+ ],
+ "modules": [
+ {
+ "name": "radeon-profile",
+ "subdir": "radeon-profile",
+ "no-autogen": true,
+ "sources": [
+ {
+ "type": "git",
+ "path": ".",
+ "url": "https://github.com/marazmista/radeon-profile.git",
+ "branch": "master"
+ }
+ ]
+ }
+ ]
+}
diff --git a/radeon-profile/configure b/radeon-profile/configure
new file mode 100755
index 0000000..f4f3fb6
--- /dev/null
+++ b/radeon-profile/configure
@@ -0,0 +1,85 @@
+#!/bin/bash
+
+if [ "$CFLAGS" ] ; then
+ ARG="$ARG QMAKE_CFLAGS+='$CFLAGS'"
+fi
+
+if [ "$CXXFLAGS" ] ; then
+ ARG="$ARG QMAKE_CXXFLAGS+='$CXXFLAGS'"
+fi
+
+if [ "$LDFLAGS" ] ; then
+ ARG="$ARG QMAKE_LFLAGS+='$LDFLAGS'"
+fi
+
+for IN in $@ ; do
+ case $IN in
+ '--prefix='*)
+ ARG="$ARG PREFIX='${IN##--prefix=}'"
+ ;;
+
+ '--libdir='*)
+ ARG="$ARG QMAKE_LIBDIR+='${IN##--libdir=}'"
+ ;;
+
+ '--includedir='*)
+ DIR="${IN##--includedir=}"
+ if [ "$DIR" == "/usr/include" ] ; then
+ echo "$0: ignoring '$IN', see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129#c0"
+ else
+ ARG="$ARG QMAKE_INCDIR+='$DIR'"
+ fi
+ ;;
+
+ 'CFLAGS='*)
+ ARG="$ARG QMAKE_CFLAGS+='${IN##CFLAGS=}'"
+ ;;
+
+ 'CXXFLAGS='*)
+ ARG="$ARG QMAKE_CXXFLAGS+='${IN##CXXFLAGS=}'"
+ ;;
+
+ 'LDFLAGS='*)
+ ARG="$ARG QMAKE_LFLAGS+='${IN##LDFLAGS=}'"
+ ;;
+
+ 'QMAKE_STRIP='*)
+ ;&
+ *'.pro')
+ ;&
+ '-W'*)
+ ;&
+ '-d')
+ ARG="$ARG $IN"
+ ;;
+
+ '--help')
+ ;&
+ 'help')
+ ;&
+ '-h')
+ echo "Create the Makefile for the execution of 'make'. Usage:"
+ echo "$0 [options] [project_file.pro]"
+ echo "Possible options:"
+ echo " Compilation/linking flags:"
+ echo " CFLAGS=..."
+ echo " CXXFLAGS=..."
+ echo " LDFLAGS=..."
+ echo " QMAKE_STRIP=..."
+ echo " Directories:"
+ echo " --prefix=..."
+ echo " --libdir=..."
+ echo " --includedir=..."
+ echo "The prefix will be used by 'make install' to install files in \$INSTALL_ROOT/\$DESTDIR/\$PREFIX/"
+ exit
+ ;;
+
+ *)
+ echo "$0: ignoring '$IN'"
+ ;;
+ esac
+done
+
+echo "qmake $ARG"
+
+eval qmake-qt5 $ARG || eval qmake-qt4 $ARG || eval qmake $ARG
diff --git a/radeon-profile/extra/radeon-profile.appdata.xml b/radeon-profile/extra/radeon-profile.appdata.xml
new file mode 100644
index 0000000..7fb970a
--- /dev/null
+++ b/radeon-profile/extra/radeon-profile.appdata.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Goes into /usr/share/appdata/ -->
+<!-- https://www.freedesktop.org/software/appstream/docs/chap-Quickstart.html#sect-Quickstart-DesktopApps -->
+<component type="desktop">
+ <id>radeon-profile.desktop</id>
+ <metadata_license>CC0-1.0</metadata_license>
+ <project_license>GPL-2.0+</project_license>
+ <name>Radeon Profile</name>
+ <summary>Display info about radeon cards</summary>
+ <description>
+ <p>Radeon profile is an user friendly application that allows to read clocks, voltages and temperatures, manage power profiles and fan speed (on HD7000 series cards and above) and overclock your GPU (on Amdgpu driver).</p>
+ <p>Radeon profile works with the open source radeon driver (xf86-video-ati), the Amdgpu driver (xf86-video-amdgpu or Amdgpu-Pro) and the Catalyst driver (fglrx).</p>
+ </description>
+ <screenshots>
+ <screenshot type="default">
+ <caption>The main page</caption>
+ <image>http://i.imgur.com/knL5abL.png</image>
+ </screenshot>
+ <screenshot type="default">
+ <caption>The graphs page</caption>
+ <image>http://i.imgur.com/wSGDQTZ.png</image>
+ </screenshot>
+ </screenshots>
+ <url type="homepage">https://github.com/marazmista/radeon-profile</url>
+ <url type="bugtracker">https://github.com/marazmista/radeon-profile/issues</url>
+ <url type="help">https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/open-source-amd-linux/37384-radeon-profile-tool-for-changing-profiles-and-monitoring-some-gpu-parameters</url>
+ <url type="translate">https://github.com/marazmista/radeon-profile/tree/master/radeon-profile/translations</url>
+ <developer_name>marazmista</developer_name>
+ <provides>
+ <binary>radeon-profile</binary>
+ </provides>
+ <translation type="qt">
+ <!-- https://github.com/hughsie/appstream-glib/issues/88 -->
+ strings
+ </translation>
+ <update_contact>
+ https://github.com/marazmista/radeon-profile/issues
+ </update_contact>
+ <releases>
+ <release date="2016-12-21" version="20161221">
+ <description>
+ <p>Created event tab, improved fan control, updated translations.</p>
+ </description>
+ </release>
+ </releases>
+</component>
diff --git a/radeon-profile/extra/radeon-profile.desktop b/radeon-profile/extra/radeon-profile.desktop
index a074b80..ff76494 100644
--- a/radeon-profile/extra/radeon-profile.desktop
+++ b/radeon-profile/extra/radeon-profile.desktop
@@ -6,5 +6,6 @@ Exec=radeon-profile
Icon=radeon-profile
Terminal=false
Type=Application
-Categories=System;Monitor;HardwareSettings;TrayIcon;
+Categories=System;Monitor;HardwareSettings;Settings;Qt;
StartupNotify=false
+Keywords=Radeon;GPU;Video card;
diff --git a/radeon-profile/radeon-profile.pro b/radeon-profile/radeon-profile.pro
index fdb5927..e5143d3 100644
--- a/radeon-profile/radeon-profile.pro
+++ b/radeon-profile/radeon-profile.pro
@@ -72,6 +72,38 @@ TRANSLATIONS += translations/strings.it.ts \
translations/strings.hr.ts
DISTFILES += \
- translations/strings.it.ts \
- translations/strings.pl.ts \
- translations/strings.hr.ts
+ configure \
+ $$TRANSLATIONS
+
+
+# AUTOMATIC MAKEFILE INSTRUCTIONS FOR make clean
+# http://doc.qt.io/qt-5/qmake-variable-reference.html#qmake-clean
+QMFILES = $$replace(TRANSLATIONS,".ts",".qm")
+QMAKE_CLEAN += $$QMFILES
+
+
+# AUTOMATIC MAKEFILE INSTRUCTIONS FOR make install
+# http://doc.qt.io/qt-5/qmake-advanced-usage.html#installing-files
+# binary: /usr/bin/radeon-profile
+binary.path = /$(DESTDIR)/$$PREFIX/bin/
+binary.files = radeon-profile
+# https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html#install_icons
+# icon: /usr/share/icons/hicolor/512x512/apps/radeon-profile.png
+icon.path = /$(DESTDIR)/$$PREFIX/share/icons/hicolor/512x512/apps/
+icon.files = extra/radeon-profile.png
+# desktop: /usr/share/applications/radeon-profile.desktop
+desktop.path = /$(DESTDIR)/$$PREFIX/share/applications/
+desktop.files = extra/radeon-profile.desktop
+# appdata: /usr/share/appdata/radeon-profile.appdata.xml
+appdata.path = /$(DESTDIR)/$$PREFIX/share/appdata/
+appdata.files = extra/radeon-profile.appdata.xml
+# translate: /usr/share/radeon-profile/strings.*.qm
+# https://wiki.qt.io/Undocumented_QMake#Custom_install_config
+# https://wiki.qt.io/Automating_generation_of_qm_files
+translate.path = /$(DESTDIR)/$$PREFIX/share/radeon-profile/
+translate.files = $$QMFILES
+qtPrepareTool(LRELEASE, lrelease)
+translate.extra = $$LRELEASE $$_PRO_FILE_
+translate.CONFIG += no_check_exist
+INSTALLS += binary icon desktop appdata translate
+
diff --git a/radeon-profile/dxorg.cpp b/radeon-profile/dxorg.cpp
index 8be6988..56f3c6b 100644
--- a/radeon-profile/dxorg.cpp
+++ b/radeon-profile/dxorg.cpp
@@ -172,6 +172,21 @@ void dXorg::figureOutGpuDataFilePaths(const QString &gpuName) {
}
}
+/**
+ * @brief dXorg::isDataAvailable check if shared memory contains anything
+ * @return true if the shared memory is not empty
+ */
+bool dXorg::isDataAvailable(){
+ if(!sharedMem.lock())
+ return false;
+
+ const char *data = (const char*)sharedMem.constData();
+ bool out = data && *data;
+
+ sharedMem.unlock();
+ return out;
+}
+
// method for gather info about clocks from deamon or from debugfs if root
QString dXorg::getClocksRawData(bool resolvingGpuFeatures) {
QFile clocksFile(filePaths.clocksPath);
@@ -192,16 +207,19 @@ QString dXorg::getClocksRawData(bool resolvingGpuFeatures) {
// fist call, so notihing is in sharedmem and we need to wait for data
// because we need correctly figure out what is available
// see: https://stackoverflow.com/a/11487434/2347196
- if (Q_UNLIKELY(resolvingGpuFeatures)) {
+ if (Q_UNLIKELY(resolvingGpuFeatures && !isDataAvailable())) {
+ // Check regurarely if the first data reading is complete
+ // Max waiting time: 1200 msec, then give up
QTime delayTime = QTime::currentTime().addMSecs(1200);
- qDebug() << "Waiting for first daemon data read...";
- while (QTime::currentTime() < delayTime)
+ qDebug() << QTime::currentTime() << "Waiting for first daemon data read...";
+ while (QTime::currentTime() < delayTime && !isDataAvailable())
QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
+ qDebug() << QTime::currentTime() << "First daemon data read completed";
}
- if (sharedMem.lock()) {
+ if (Q_LIKELY(sharedMem.lock())) {
const char *to = (const char*)sharedMem.constData();
- if (to != NULL) {
+ if (Q_LIKELY(to != NULL)) {
qDebug() << "Reading data from shared memory";
data = QString(QByteArray::fromRawData(to, SHARED_MEM_SIZE)).trimmed();
} else
diff --git a/radeon-profile/dxorg.h b/radeon-profile/dxorg.h
index 7cbc993..a116bdd 100644
--- a/radeon-profile/dxorg.h
+++ b/radeon-profile/dxorg.h
@@ -103,6 +103,7 @@ private:
static tempSensor testSensor();
static void setNewValue(const QString &filePath, const QString &newValue);
static QString findSysFsHwmonForGpu();
+ static bool isDataAvailable();
};
#endif // DXORG_H
diff --git a/radeon-profile/gpu.cpp b/radeon-profile/gpu.cpp
index 0fddb9d..eebe6eb 100644
--- a/radeon-profile/gpu.cpp
+++ b/radeon-profile/gpu.cpp
@@ -51,7 +51,7 @@ bool gpu::daemonConnected() {
// and call some things that need to be done before read data
QStringList gpu::initialize() {
- QStringList gpuList;
+ qDebug() << "Searching available driver";
gpuList = gpu::initialize(gpu::XORG);
if (gpuList.length() > 0)
@@ -67,25 +67,24 @@ QStringList gpu::initialize() {
QStringList gpu::initialize(gpu::driver driver) {
currentDriver = driver;
- QStringList gpuList;
switch (currentDriver) {
case gpu::XORG:
gpuList = dXorg::detectCards();
if(currentGpuIndex < gpuList.size()){
- dXorg::configure(gpuList[currentGpuIndex]);
- features = dXorg::figureOutDriverFeatures();
+ qDebug() << "Using XORG driver";
+ changeGpu(currentGpuIndex);
}
break;
case gpu::FGLRX:
- dFglrx::configure(currentGpuIndex);
- features = dFglrx::figureOutDriverFeatures();
+ gpuList = dFglrx::detectCards();
+ if(currentGpuIndex < gpuList.size()){
+ qDebug() << "Using FGLRX driver";
+ changeGpu(currentGpuIndex);
+ }
break;
case gpu::DRIVER_UNKNOWN:
- globalStuff::driverFeatures f;
- f.pm = globalStuff::PM_UNKNOWN;
- f.canChangeProfile = f.temperatureAvailable = f.coreVoltAvailable = f.coreClockAvailable = false;
- features = f;
+ features = globalStuff::driverFeatures(); // Nothing available
gpuList << QObject::tr("Unknown");
break;
}
@@ -127,12 +126,19 @@ globalStuff::gpuTemperatureStructString gpu::convertTemperature(const globalStuf
tmp.current = QString::number(data.current) + QString::fromUtf8("\u00B0C");
tmp.max = QString::number(data.max) + QString::fromUtf8("\u00B0C");
tmp.min = QString::number(data.min) + QString::fromUtf8("\u00B0C");
- tmp.pwmSpeed = QString::number(data.pwmSpeed)+"%";
+ if(data.pwmSpeed != -1)
+ tmp.pwmSpeed = QString::number(data.pwmSpeed)+"%";
return tmp;
}
void gpu::changeGpu(char index) {
+ if((index < 0) || (index >= gpuList.size())) {
+ qCritical() << "Asked to choose GPU n." << (int)index << "but only" << gpuList.size() << "GPUs are available";
+ return;
+ }
+
+ qDebug() << "Switching to GPU n." << (int)index << "(" << gpuList[index] << ")";
currentGpuIndex = index;
switch (currentDriver) {
diff --git a/radeon-profile/gpu.h b/radeon-profile/gpu.h
index a6c12cd..6883adc 100644
--- a/radeon-profile/gpu.h
+++ b/radeon-profile/gpu.h
@@ -24,6 +24,7 @@ public:
gpuTemeperatureData.max =
gpuTemeperatureData.min =
gpuTemeperatureData.sum = 0;
+ gpuTemeperatureData.pwmSpeed = -1;
}
globalStuff::gpuClocksStruct gpuClocksData;
diff --git a/radeon-profile/main.cpp b/radeon-profile/main.cpp
index 81febbb..529726a 100644
--- a/radeon-profile/main.cpp
+++ b/radeon-profile/main.cpp
@@ -1,10 +1,19 @@
#include "radeon_profile.h"
#include <QApplication>
#include <QTranslator>
+#include <QSplashScreen>
+#include <QPixmap>
+#include <QBitmap>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
+
+ QPixmap pm(":/icon/extra/radeon-profile.png");
+ QSplashScreen loading(pm);
+ loading.setMask(pm.mask());
+ loading.show();
+
QTranslator translator;
QLocale locale;
@@ -20,6 +29,7 @@ int main(int argc, char *argv[])
}
radeon_profile w(a.arguments());
+ loading.close();
return a.exec();
}
diff --git a/radeon-profile/radeon_profile.cpp b/radeon-profile/radeon_profile.cpp
index 8db463a..4530098 100644
--- a/radeon-profile/radeon_profile.cpp
+++ b/radeon-profile/radeon_profile.cpp
@@ -228,10 +228,11 @@ void radeon_profile::setupUiEnabledFeatures(const globalStuff::driverFeatures &f
void radeon_profile::refreshGpuData() {
device.refreshPowerLevel();
device.getClocks();
- device.getTemperature();
if (device.features.pwmAvailable)
- device.getPwmSpeed();
+ device.getPwmSpeed(); // Fill gpuTemeperatureData.pwmSpeed
+
+ device.getTemperature(); // Fill gpuTemeperatureData, translate in gpuTemeperatureDataString
if (Q_LIKELY(execsRunning.count() == 0))
return;
diff --git a/radeon-profile/translations/strings.it.ts b/radeon-profile/translations/strings.it.ts
index a566f82..4aaa0c9 100644
--- a/radeon-profile/translations/strings.it.ts
+++ b/radeon-profile/translations/strings.it.ts
@@ -6,131 +6,131 @@
<message>
<location filename="../dialog_rpevent.ui" line="20"/>
<source>Event definition</source>
- <translation type="unfinished"></translation>
+ <translation>Creazione evento</translation>
</message>
<message>
<location filename="../dialog_rpevent.ui" line="35"/>
<source>Save</source>
- <translation type="unfinished">Salva</translation>
+ <translation>Salva</translation>
</message>
<message>
<location filename="../dialog_rpevent.ui" line="48"/>
<source>Cancel</source>
- <translation type="unfinished">Annulla</translation>
+ <translation>Annulla</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="61"/>
+ <location filename="../dialog_rpevent.ui" line="283"/>
<source>Event trigger</source>
- <translation type="unfinished"></translation>
+ <translation>Innesco dell&apos;evento</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="74"/>
+ <location filename="../dialog_rpevent.ui" line="249"/>
<source>Event name</source>
- <translation type="unfinished"></translation>
+ <translation>Nome dell&apos;evento</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="98"/>
+ <location filename="../dialog_rpevent.ui" line="270"/>
<source>Temperature</source>
- <translation type="unfinished">Temperatura</translation>
+ <translation>Temperatura</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="103"/>
+ <location filename="../dialog_rpevent.ui" line="275"/>
<source>Binary</source>
- <translation type="unfinished">Comando</translation>
+ <translation>Eseguibile</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="117"/>
+ <location filename="../dialog_rpevent.ui" line="61"/>
<source>Modify:</source>
- <translation type="unfinished"></translation>
+ <translation>Modifica:</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="132"/>
+ <location filename="../dialog_rpevent.ui" line="76"/>
<source>Set power level:</source>
- <translation type="unfinished"></translation>
+ <translation>Cambia livello di potenza:</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="140"/>
- <location filename="../dialog_rpevent.ui" line="149"/>
- <location filename="../dialog_rpevent.ui" line="165"/>
+ <location filename="../dialog_rpevent.ui" line="84"/>
+ <location filename="../dialog_rpevent.ui" line="93"/>
+ <location filename="../dialog_rpevent.ui" line="109"/>
<source>No change</source>
- <translation type="unfinished"></translation>
+ <translation>Nessun cambiamento</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="157"/>
+ <location filename="../dialog_rpevent.ui" line="101"/>
<source>Set fan:</source>
- <translation type="unfinished"></translation>
+ <translation>Imposta ventola:</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="173"/>
+ <location filename="../dialog_rpevent.ui" line="117"/>
<source>Set DPM to:</source>
- <translation type="unfinished"></translation>
+ <translation>Cambia DPM:</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="189"/>
+ <location filename="../dialog_rpevent.ui" line="133"/>
<source>%</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="233"/>
+ <location filename="../dialog_rpevent.ui" line="177"/>
<source>Activate above this temperature:</source>
- <translation type="unfinished"></translation>
+ <translation>Attiva sopra questa temperatura:</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="261"/>
+ <location filename="../dialog_rpevent.ui" line="205"/>
<source>Binary (executing this binary will trigger event):</source>
- <translation type="unfinished"></translation>
+ <translation>Eseguibile (l&apos;esecuzione innescherà l&apos;evento):</translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="284"/>
+ <location filename="../dialog_rpevent.ui" line="228"/>
<source>...</source>
- <translation type="unfinished">...</translation>
+ <translation></translation>
</message>
<message>
- <location filename="../dialog_rpevent.ui" line="302"/>
+ <location filename="../dialog_rpevent.ui" line="259"/>
<source>Enabled</source>
- <translation type="unfinished"></translation>
+ <translation>Abilitato</translation>
</message>
<message>
- <location filename="../dialog_rpevent.cpp" line="31"/>
+ <location filename="../dialog_rpevent.cpp" line="33"/>
<source>Set Profile to:</source>
- <translation type="unfinished"></translation>
+ <translation>Imposta profilo:</translation>
</message>
<message>
- <location filename="../dialog_rpevent.cpp" line="37"/>
+ <location filename="../dialog_rpevent.cpp" line="39"/>
<source>Auto</source>
- <translation type="unfinished"></translation>
+ <translation></translation>
</message>
<message>
- <location filename="../dialog_rpevent.cpp" line="38"/>
+ <location filename="../dialog_rpevent.cpp" line="40"/>
<source>Fixed speed</source>
- <translation type="unfinished"></translation>
+ <translation>Velocità fissa</translation>
</message>
<message>
- <location filename="../dialog_rpevent.cpp" line="74"/>
+ <location filename="../dialog_rpevent.cpp" line="76"/>
<source>Selected trigger type is Binary, so the binary field cannot be empty.</source>
- <translation type="unfinished"></translation>
+ <translation>Hai selezionato l&apos;innesco da eseguibile, devi selezionare l&apos;eseguibile.</translation>
</message>
<message>
- <location filename="../dialog_rpevent.cpp" line="135"/>
+ <location filename="../dialog_rpevent.cpp" line="137"/>
<source>Select binary</source>
- <translation type="unfinished">Seleziona un eseguibile</translation>
+ <translation>Seleziona un eseguibile</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
- <location filename="../gpu.cpp" line="458"/>
- <location filename="../gpu.cpp" line="527"/>
+ <location filename="../gpu.cpp" line="464"/>
+ <location filename="../gpu.cpp" line="533"/>
<source>Resolution</source>
<translation>Risoluzione</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="466"/>
+ <location filename="../gpu.cpp" line="472"/>
<source>Minimum resolution</source>
<translation>Risoluzione minima</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="469"/>
+ <location filename="../gpu.cpp" line="475"/>
<source>Maximum resolution</source>
<translation>Risoluzione massima</translation>
</message>
@@ -167,7 +167,7 @@
<translation type="vanished">Temperatura della GPU</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="763"/>
+ <location filename="../gpu.cpp" line="765"/>
<source>No info</source>
<translation>Nessuna info</translation>
</message>
@@ -236,93 +236,93 @@
<translation type="vanished">Eseguire &quot;</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="89"/>
+ <location filename="../gpu.cpp" line="88"/>
<source>Unknown</source>
<translation>Sconosciuto</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="472"/>
+ <location filename="../gpu.cpp" line="478"/>
<source>Virtual size</source>
<translation>Dimensione virtuale</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="482"/>
+ <location filename="../gpu.cpp" line="488"/>
<source>Outputs</source>
<translation>Connessioni</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="516"/>
- <location filename="../gpu.cpp" line="518"/>
+ <location filename="../gpu.cpp" line="522"/>
+ <location filename="../gpu.cpp" line="524"/>
<source>Active</source>
<translation>Attivo</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="594"/>
+ <location filename="../gpu.cpp" line="598"/>
<source> Hz vertical, </source>
<translation> Hz verticale, </translation>
</message>
<message>
- <location filename="../gpu.cpp" line="597"/>
+ <location filename="../gpu.cpp" line="601"/>
<source> KHz horizontal, </source>
<translation> KHz orizzontale, </translation>
</message>
<message>
- <location filename="../gpu.cpp" line="600"/>
+ <location filename="../gpu.cpp" line="604"/>
<source> MHz dot clock</source>
<translation> MHz dot clock</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="518"/>
+ <location filename="../gpu.cpp" line="524"/>
<source>Yes</source>
<translation>Si</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="516"/>
+ <location filename="../gpu.cpp" line="522"/>
<source>No</source>
<translation>No</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="533"/>
+ <location filename="../gpu.cpp" line="539"/>
<source>Refresh rate</source>
<translation>Frequenza di aggiornamento</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="539"/>
+ <location filename="../gpu.cpp" line="545"/>
<source>Offset</source>
<translation></translation>
</message>
<message>
- <location filename="../gpu.cpp" line="551"/>
+ <location filename="../gpu.cpp" line="557"/>
<source>Brightness (software)</source>
<translation>Luminosità (software)</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="566"/>
+ <location filename="../gpu.cpp" line="572"/>
<source>Size</source>
<translation>Dimensione</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="569"/>
+ <location filename="../gpu.cpp" line="575"/>
<source>Supported modes</source>
<translation>Modalità supportate</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="618"/>
+ <location filename="../gpu.cpp" line="622"/>
<source>Properties</source>
<translation>Proprietà</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="686"/>
+ <location filename="../gpu.cpp" line="688"/>
<source>Serial number</source>
<translation>Numero di serie</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="685"/>
+ <location filename="../gpu.cpp" line="687"/>
<source>Not available</source>
<translation>Non disponibile</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="677"/>
+ <location filename="../gpu.cpp" line="679"/>
<source>Connected with </source>
<translation>Connesso con </translation>
</message>
@@ -335,7 +335,7 @@
<translation type="vanished">Velocità della ventola</translation>
</message>
<message>
- <location filename="../gpu.cpp" line="503"/>
+ <location filename="../gpu.cpp" line="509"/>
<source>Disconnected</source>
<translation>Disconnesso</translation>
</message>
@@ -484,7 +484,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<translation type="vanished">Salva</translation>
</message>
<message numerus="yes">
- <location filename="../gpu.cpp" line="472"/>
+ <location filename="../gpu.cpp" line="478"/>
<source>%n mm</source>
<translation>
<numerusform></numerusform>
@@ -492,7 +492,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</translation>
</message>
<message numerus="yes">
- <location filename="../gpu.cpp" line="566"/>
+ <location filename="../gpu.cpp" line="572"/>
<source>%n mm </source>
<translation>
<numerusform></numerusform>
@@ -500,7 +500,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</translation>
</message>
<message numerus="yes">
- <location filename="../gpu.cpp" line="566"/>
+ <location filename="../gpu.cpp" line="572"/>
<source>(%n inches)</source>
<translation>
<numerusform>(%n pollici)</numerusform>
@@ -508,8 +508,8 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</translation>
</message>
<message numerus="yes">
- <location filename="../gpu.cpp" line="472"/>
- <location filename="../gpu.cpp" line="566"/>
+ <location filename="../gpu.cpp" line="478"/>
+ <location filename="../gpu.cpp" line="572"/>
<source>%n mm x </source>
<translation>
<numerusform></numerusform>
@@ -517,7 +517,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</translation>
</message>
<message numerus="yes">
- <location filename="../gpu.cpp" line="747"/>
+ <location filename="../gpu.cpp" line="749"/>
<source>%n connected, </source>
<translation>
<numerusform>%n connesso, </numerusform>
@@ -525,7 +525,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</translation>
</message>
<message numerus="yes">
- <location filename="../gpu.cpp" line="747"/>
+ <location filename="../gpu.cpp" line="749"/>
<source>%n active</source>
<translation>
<numerusform>%n attivo</numerusform>
@@ -533,7 +533,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</translation>
</message>
<message numerus="yes">
- <location filename="../gpu.cpp" line="452"/>
+ <location filename="../gpu.cpp" line="458"/>
<source>Virtual screen n°%n</source>
<translatorcomment>Per un qualche motivo non viene tradotto correttamente a runtime, investigare</translatorcomment>
<translation>
@@ -585,13 +585,13 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</message>
<message>
<location filename="../radeon_profile.ui" line="309"/>
- <location filename="../radeon_profile.cpp" line="284"/>
+ <location filename="../radeon_profile.cpp" line="283"/>
<source>GPU temperature</source>
<translation>Temperatura della GPU</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="340"/>
- <location filename="../radeon_profile.cpp" line="269"/>
+ <location filename="../radeon_profile.cpp" line="268"/>
<location filename="../uiElements.cpp" line="44"/>
<source>GPU clock</source>
<translation>Clock della GPU</translation>
@@ -624,14 +624,14 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<translation>Velocità della ventola</translation>
</message>
<message>
- <location filename="../radeon_profile.cpp" line="279"/>
+ <location filename="../radeon_profile.cpp" line="278"/>
<location filename="../uiElements.cpp" line="52"/>
<source>I/O voltage (vddci)</source>
<translation>Voltaggio dell&apos;I/O</translation>
</message>
<message>
<location filename="../uiElements.cpp" line="93"/>
- <location filename="../uiEvents.cpp" line="201"/>
+ <location filename="../uiEvents.cpp" line="197"/>
<source>Quit</source>
<translation>Esci</translation>
</message>
@@ -694,7 +694,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</message>
<message>
<location filename="../radeon_profile.ui" line="244"/>
- <location filename="../radeon_profile.cpp" line="271"/>
+ <location filename="../radeon_profile.cpp" line="270"/>
<location filename="../uiElements.cpp" line="45"/>
<source>Memory clock</source>
<translation>Clock della memoria</translation>
@@ -824,7 +824,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<message>
<location filename="../radeon_profile.ui" line="157"/>
<location filename="../radeon_profile.ui" line="853"/>
- <location filename="../radeon_profile.cpp" line="267"/>
+ <location filename="../radeon_profile.cpp" line="266"/>
<source>Power level</source>
<translation>Livello di potenza</translation>
</message>
@@ -968,8 +968,8 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</message>
<message>
<location filename="../radeon_profile.ui" line="1774"/>
- <location filename="../fanControlTab.cpp" line="190"/>
- <location filename="../fanControlTab.cpp" line="243"/>
+ <location filename="../fanControlTab.cpp" line="193"/>
+ <location filename="../fanControlTab.cpp" line="246"/>
<location filename="../uiElements.cpp" line="38"/>
<source>Temperature</source>
<translation>Temperatura</translation>
@@ -1073,37 +1073,37 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<message>
<location filename="../radeon_profile.ui" line="1703"/>
<source>Unsaved</source>
- <translation type="unfinished"></translation>
+ <translation>Non salvato</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="1794"/>
<source>Events</source>
- <translation type="unfinished"></translation>
+ <translation>Eventi</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="1814"/>
<source>Enable event tracking</source>
- <translation type="unfinished"></translation>
+ <translation>Abilita tracciamento degli eventi</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="1834"/>
<source>Current active event:</source>
- <translation type="unfinished"></translation>
+ <translation>Evento attivo:</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="1854"/>
<source>Revoke current event</source>
- <translation type="unfinished"></translation>
+ <translation>Revoca l&apos;evento attuale</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="1882"/>
<source>Enabled</source>
- <translation type="unfinished"></translation>
+ <translation>Abilitato</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="1887"/>
<source>Event name</source>
- <translation type="unfinished"></translation>
+ <translation>Nome dell&apos;evento</translation>
</message>
<message>
<location filename="../radeon_profile.ui" line="1904"/>
@@ -1436,11 +1436,11 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<location filename="../execTab.cpp" line="64"/>
<location filename="../execTab.cpp" line="74"/>
<location filename="../execTab.cpp" line="289"/>
- <location filename="../fanControlTab.cpp" line="195"/>
- <location filename="../fanControlTab.cpp" line="211"/>
- <location filename="../fanControlTab.cpp" line="232"/>
- <location filename="../fanControlTab.cpp" line="237"/>
- <location filename="../uiEvents.cpp" line="390"/>
+ <location filename="../fanControlTab.cpp" line="198"/>
+ <location filename="../fanControlTab.cpp" line="214"/>
+ <location filename="../fanControlTab.cpp" line="235"/>
+ <location filename="../fanControlTab.cpp" line="240"/>
+ <location filename="../uiEvents.cpp" line="376"/>
<source>Error</source>
<translation>Errore</translation>
</message>
@@ -1471,7 +1471,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</message>
<message>
<location filename="../execTab.cpp" line="146"/>
- <location filename="../fanControlTab.cpp" line="71"/>
+ <location filename="../fanControlTab.cpp" line="74"/>
<source>Question</source>
<translation>Domanda</translation>
</message>
@@ -1502,7 +1502,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<translation>Eseguire &quot;</translation>
</message>
<message numerus="yes">
- <location filename="../radeon_profile.cpp" line="124"/>
+ <location filename="../radeon_profile.cpp" line="126"/>
<source>version %n</source>
<translation>
<numerusform>versione %n</numerusform>
@@ -1510,75 +1510,80 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
</translation>
</message>
<message>
- <location filename="../radeon_profile.cpp" line="138"/>
+ <location filename="../radeon_profile.cpp" line="140"/>
<source>Back to profiles</source>
<translation>Ritorna ai profili</translation>
</message>
<message>
- <location filename="../radeon_profile.cpp" line="273"/>
+ <location filename="../radeon_profile.cpp" line="272"/>
<location filename="../uiElements.cpp" line="46"/>
<source>UVD core clock (cclk)</source>
<translation>Clock del UVD (cclk)</translation>
</message>
<message>
- <location filename="../radeon_profile.cpp" line="275"/>
+ <location filename="../radeon_profile.cpp" line="274"/>
<location filename="../uiElements.cpp" line="47"/>
<source>UVD decoder clock (dclk)</source>
<translation>Clock del decoder UVD (dclk)</translation>
</message>
<message>
- <location filename="../radeon_profile.cpp" line="277"/>
+ <location filename="../radeon_profile.cpp" line="276"/>
<location filename="../uiElements.cpp" line="51"/>
<source>GPU voltage (vddc)</source>
<translation>Voltaggio GPU (vddc)</translation>
</message>
<message>
- <location filename="../radeon_profile.cpp" line="282"/>
+ <location filename="../radeon_profile.cpp" line="281"/>
<source>Can&apos;t read data</source>
<translation>Impossibile leggere i dati</translation>
</message>
<message>
- <location filename="../radeon_profile.cpp" line="282"/>
+ <location filename="../radeon_profile.cpp" line="281"/>
<source>You need debugfs mounted and either root rights or the daemon running</source>
<translation>È necessario che debugfs sia montato e che il demone sia attivo (o che il programma venga eseguito come root)</translation>
</message>
<message>
- <location filename="../uiEvents.cpp" line="201"/>
+ <location filename="../radeon_profile.cpp" line="460"/>
+ <source>Current profile: </source>
+ <translation>Profilo attuale:</translation>
+ </message>
+ <message>
+ <location filename="../uiEvents.cpp" line="197"/>
<source> is still running, exit anyway?</source>
<translation> è ancora in esecuzione, uscire comunque?</translation>
</message>
<message>
- <location filename="../uiEvents.cpp" line="253"/>
+ <location filename="../uiEvents.cpp" line="249"/>
<source>GPU data is disabled</source>
<translation>Dati della GPU disabilitati</translation>
</message>
<message>
- <location filename="../uiEvents.cpp" line="329"/>
+ <location filename="../uiEvents.cpp" line="325"/>
<source>Select new power profile</source>
<translation>Seleziona un nuovo profilo di potenza</translation>
</message>
<message>
- <location filename="../uiEvents.cpp" line="329"/>
+ <location filename="../uiEvents.cpp" line="325"/>
<source>Profile selection</source>
<translation>Selezione del profilo</translation>
</message>
<message>
- <location filename="../uiEvents.cpp" line="353"/>
+ <location filename="../uiEvents.cpp" line="339"/>
<source>Process is still running. Close tab?</source>
<translation>Il processo è ancora attivo. Chiudere comunque?</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="142"/>
+ <location filename="../fanControlTab.cpp" line="145"/>
<source>Cannot activate unsaved profile. Do you want to save it?</source>
- <translation type="unfinished"></translation>
+ <translation>Devo salvare il profilo prima di attivarlo. Vuoi salvarlo?</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="185"/>
+ <location filename="../fanControlTab.cpp" line="188"/>
<source>Fan control information</source>
<translation>Informazioni sul controllo della ventola</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="185"/>
+ <location filename="../fanControlTab.cpp" line="188"/>
<source>Don&apos;t overheat your card! Be careful! Don&apos;t use this if you don&apos;t know what you&apos;re doing!
Hovewer, looks like card won&apos;t apply too low values due its internal protection.
@@ -1591,23 +1596,23 @@ Il sistema di protezione della scheda grafica non accetta valori troppo bassi.
Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola su Auto. Se l&apos;applicazione va in crash, l&apos;ultimo valore usato rimarrà attivo. Sei stato avvertito!</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="195"/>
+ <location filename="../fanControlTab.cpp" line="198"/>
<source>This step already exists. Double click on it, to change its value</source>
<translation>Questa temperatura esiste già. Doppio click per modificarla</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="197"/>
- <location filename="../fanControlTab.cpp" line="252"/>
+ <location filename="../fanControlTab.cpp" line="200"/>
+ <location filename="../fanControlTab.cpp" line="255"/>
<source>Speed [%]</source>
<translation>Velocità [%]</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="232"/>
+ <location filename="../fanControlTab.cpp" line="235"/>
<source>You can&apos;t edit the last item</source>
<translation>Non puoi modificare l&apos;ultimo elemento</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="237"/>
+ <location filename="../fanControlTab.cpp" line="240"/>
<source>You can&apos;t edit temperature of the first item</source>
<translation>Non puoi modificare la temperatura del primo elemento</translation>
</message>
@@ -1616,12 +1621,12 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<translation type="vanished">Velocità [%] (10-100)</translation>
</message>
<message>
- <location filename="../uiEvents.cpp" line="398"/>
+ <location filename="../uiEvents.cpp" line="384"/>
<source>Export destination directory</source>
<translation>Cartella di destinazione</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="71"/>
+ <location filename="../fanControlTab.cpp" line="74"/>
<source>This option may cause overheat of your card and it is your responsibility if this happens. Do you want to enable it?</source>
<translation>Questa opzione può causare un sirriscaldamento della scheda video, ti assumi la responsabilità se questo succede. Vuoi abilitarla? </translation>
</message>
@@ -1630,7 +1635,7 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<translation type="vanished">Velocità [%] (20-100)</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="211"/>
+ <location filename="../fanControlTab.cpp" line="214"/>
<source>You can&apos;t delete the first and the last item</source>
<translation>Non puoi cancellare il primo e l&apos;ultimo elemento</translation>
</message>
@@ -1639,58 +1644,62 @@ Prima di chiudersi, l&apos;applicazione reimposterà il controllo della ventola
<translation type="vanished">Non puoi modificare il primo e l&apos;ultimo elemento</translation>
</message>
<message>
- <location filename="../uiEvents.cpp" line="390"/>
+ <location filename="../uiEvents.cpp" line="376"/>
<source>An error occurred, overclock failed</source>
<translation>Si è verificato un errore, overclock fallito</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="87"/>
+ <location filename="../fanControlTab.cpp" line="90"/>
<source>Cannot remove default profile.</source>
<translation>Non puoi rimuovere il profilo di default.</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="91"/>
+ <location filename="../fanControlTab.cpp" line="94"/>
<source>Remove profile: </source>
- <translation type="unfinished"></translation>
+ <translation>Rimuovi profilo:</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="118"/>
+ <location filename="../fanControlTab.cpp" line="121"/>
<source>Fan profile name:</source>
<translation>Nome del profilo:</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="121"/>
+ <location filename="../fanControlTab.cpp" line="124"/>
<source>Profile name musn&apos;t contain &apos;|&apos; character.</source>
<translation>Il nome del profilo non può contenere il carattere &apos;|&apos;.</translation>
</message>
<message>
- <location filename="../fanControlTab.cpp" line="126"/>
+ <location filename="../fanControlTab.cpp" line="129"/>
<source>Cannot add another profile with the same name that already exists.</source>
<translation>Esiste già un profilo con questo nome.</translation>
</message>
<message>
- <location filename="../eventsTab.cpp" line="154"/>
+ <location filename="../eventsTab.cpp" line="156"/>
<source>Events info</source>
- <translation type="unfinished"></translation>
+ <translation>Info sugli eventi</translation>
</message>
<message>
- <location filename="../eventsTab.cpp" line="155"/>
+ <location filename="../eventsTab.cpp" line="157"/>
<source>Here you can define events. Each event has a defined condition, and when this condition is fulfilled, event is activated.
After activation, defined power profile, power level and fan profile are applied. When one of events is activated, tracking is suspended.
When active event condition is no longer true, event is revoked and power profile, power level and fan profile are restored to state before event was activated.</source>
- <translation type="unfinished"></translation>
+ <translation>Qui puoi definire gli eventi. Ogni evento ha una condizione definita, quando questa si verifica l&apos;evento viene innescato.
+
+Una volta innescato, l&apos;evento applica profilo di potenza, livello di potenza e profilo della ventola in base ai valori inseriti alla creazione dell&apos;evento; il tracciamento viene sospeso.
+
+Una volta scomparsa la condizione dell&apos;evento, l&apos;evento viene revocato e profilo di potenza, livello di potenza e profilo della ventola vengono riportati ai valori precedenti all&apos;attivazione dell&apos;evento.</translation>
</message>
<message>
- <location filename="../eventsTab.cpp" line="194"/>
+ <location filename="../eventsTab.cpp" line="196"/>
<source>Cannot remove event that is currently active.</source>
- <translation type="unfinished"></translation>
+ <translation>Impossibile rimuovere un evento attivo.</translation>
</message>
<message>
- <location filename="../eventsTab.cpp" line="198"/>
+ <location filename="../eventsTab.cpp" line="200"/>
<source>Do you want to remove event: </source>
- <translation type="unfinished"></translation>
+ <translation>Vuoi rimuovere levento: </translation>
</message>
</context>
</TS>
diff --git a/radeon-profile/dxorg.cpp b/radeon-profile/dxorg.cpp
index 5c294ae..b359314 100644
--- a/radeon-profile/dxorg.cpp
+++ b/radeon-profile/dxorg.cpp
@@ -3,6 +3,10 @@
#include "dxorg.h"
#include "gpu.h"
+extern "C" {
+#include "radeon_ioctl.h"
+}
+
#include <QFile>
#include <QTextStream>
#include <QTime>
@@ -25,6 +29,7 @@ daemonComm *dXorg::dcomm = new daemonComm();
void dXorg::configure(const QString &gpuName) {
setupDriverModule(gpuName);
+ qDebug() << "Using module" << dXorg::driverModuleName;
figureOutGpuDataFilePaths(gpuName);
currentTempSensor = testSensor();
currentPowerMethod = getPowerMethod();
@@ -110,6 +115,31 @@ bool dXorg::daemonConnected() {
}
void dXorg::figureOutGpuDataFilePaths(const QString &gpuName) {
+
+#ifdef QT_DEBUG
+ // Example IOCTLs
+ // IOCTLs require root access
+ int fd = openCardFD(gpuName.toStdString().c_str());
+ if(fd >= 0){
+ int i;
+ unsigned u;
+ unsigned long ul;
+ float f;
+
+ qDebug() << "Testing IOCTLs";
+ if(!radeonCoreClock(fd, &u)) qDebug() << "Core clock:" << u << "MHz";
+ if(!radeonMaxCoreClock(fd, &u)) qDebug() << "Max core clock:" << u/1000 << "MHz";
+ if(!radeonMemoryClock(fd, &u)) qDebug() << "Memory clock:" << u << "MHz";
+ if(!radeonTemperature(fd, &i)) qDebug() << "Temperature:" << i/1000.0f << "°C";
+ if(!radeonVramUsage(fd,&ul)) qDebug() << "VRAM usage:" << ul/1024 << "KB";
+ if(!radeonGpuUsage(fd, &f, 500000, 150)) qDebug() << "GPU usage:" << f << "%";
+ if(!amdgpuVramUsage(fd,&ul)) qDebug() << "VRAM usage:" << ul/1024 << "KB";
+ if(!amdgpuGpuUsage(fd, &f, 500000, 150)) qDebug() << "GPU usage:" << f << "%";
+
+ closeCardFD(fd);
+ }
+#endif
+
gpuSysIndex = gpuName.at(gpuName.length()-1);
QString devicePath = "/sys/class/drm/"+gpuName+"/device/";
diff --git a/radeon-profile/radeon-profile.pro b/radeon-profile/radeon-profile.pro
index 8fa10c2..fdb5927 100644
--- a/radeon-profile/radeon-profile.pro
+++ b/radeon-profile/radeon-profile.pro
@@ -17,7 +17,7 @@ QMAKE_CXXFLAGS += -std=c++0x
# http://doc.qt.io/qt-5/qtglobal.html#QtMsgType-enum
# qDebug will work only when compiled for Debug
# QtWarning, QtCritical and QtFatal will still work on Release
-CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT
+CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT NO_IOCTL
SOURCES += main.cpp\
radeon_profile.cpp \
@@ -31,6 +31,7 @@ SOURCES += main.cpp\
daemonComm.cpp \
execTab.cpp \
execbin.cpp \
+ radeon_ioctl.c \
dialog_rpevent.cpp \
eventsTab.cpp \
fanControlTab.cpp
@@ -43,6 +44,7 @@ HEADERS += radeon_profile.h \
globalStuff.h \
daemonComm.h \
execbin.h \
+ radeon_ioctl.h \
dialog_rpevent.h \
rpevent.h
diff --git a/radeon-profile/radeon_ioctl.c b/radeon-profile/radeon_ioctl.c
new file mode 100644
index 0000000..f47ff01
--- /dev/null
+++ b/radeon-profile/radeon_ioctl.c
@@ -0,0 +1,197 @@
+#include "radeon_ioctl.h"
+
+
+#ifdef NO_IOCTL
+
+
+int openCardFD(const char * card){(void)card; return -1;}
+void closeCardFD(int fd){(void)fd;}
+int radeonTemperature(int fd, int *data){(void)fd;(void)data; return -1;}
+int radeonCoreClock(int fd, unsigned *data){(void)fd;(void)data; return -1;}
+int radeonMemoryClock(int fd, unsigned *data){(void)fd;(void)data; return -1;}
+int radeonMaxCoreClock(int fd, unsigned *data){(void)fd;(void)data; return -1;}
+int radeonVramUsage(int fd, unsigned long *data){(void)fd;(void)data; return -1;}
+int radeonGttUsage(int fd, unsigned long *data){(void)fd;(void)data; return -1;}
+int radeonReadRegistry(int fd, unsigned *data){(void)fd;(void)data; return -1;}
+int radeonGpuUsage(int fd, float *data, unsigned time, unsigned frequency){(void)fd;(void)data;(void)time;(void)frequency; return -1;}
+int amdgpuVramSize(int fd, unsigned long *data){(void)fd;(void)data; return -1;}
+int amdgpuVramUsage(int fd, unsigned long *data){(void)fd;(void)data; return -1;}
+int amdgpuGttUsage(int fd, unsigned long *data){(void)fd;(void)data; return -1;}
+int amdgpuReadRegistry(int fd, unsigned *data){(void)fd;(void)data; return -1;}
+int amdgpuGpuUsage(int fd, float *data, unsigned time, unsigned frequency){(void)fd;(void)data;(void)time;(void)frequency; return -1;}
+
+
+#else
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <inttypes.h>
+
+#define CLEAN(object) memset(&(object), 0, sizeof(object))
+#define PATH_SIZE 20
+
+void errorDebug(const char * title){
+#ifdef QT_NO_DEBUG_OUTPUT
+ (void)title;
+#else
+ perror(title);
+#endif
+}
+
+int openCardFD(const char * card){
+ int fd;
+ char path[PATH_SIZE] = "/dev/dri/";
+
+ strncat(path, card, PATH_SIZE-strlen(path)-1);
+ fd= open(path,O_RDONLY);
+
+ if(fd < 0)
+ errorDebug("open");
+
+ return fd;
+}
+
+void closeCardFD(int fd){
+ if(close(fd))
+ errorDebug("close");
+}
+
+int gpuUsage(int fd, float *data, unsigned time, unsigned frequency, int(*accessRegistry)(int fd, unsigned *data)){
+#define REGISTRY_ADDRESS 0x8010 // http://support.amd.com/TechDocs/46142.pdf#page=246
+#define REGISTRY_MASK 1<<31
+#define ONE_SECOND 1000000
+ const unsigned int sleep = ONE_SECOND/frequency;
+ unsigned int remaining, activeCount = 0, totalCount = 0, buffer;
+ int error;
+ for(remaining = time; (remaining > 0) && (remaining <= time); remaining -= (sleep - usleep(sleep)), totalCount++){
+ buffer = REGISTRY_ADDRESS;
+ error = accessRegistry(fd, &buffer);
+
+ if(error)
+ return error;
+
+ if(REGISTRY_MASK & buffer)
+ activeCount++;
+ }
+
+ if(totalCount == 0)
+ return -1;
+
+ *data = (100.0f * activeCount) / totalCount;
+
+#ifndef QT_NO_DEBUG_OUTPUT
+ printf("%u active moments out of %u (%3.2f%%) in %umS (Sampling at %uHz)\n", activeCount, totalCount, *data, time/1000, frequency);
+#endif
+
+ return 0;
+}
+
+/******************** RADEON ********************/
+#include <drm/radeon_drm.h> // http://lxr.free-electrons.com/source/include/uapi/drm/radeon_drm.h#L993
+
+int radeonGetValue(int fd, void *data, uint32_t command){
+ int error;
+ struct drm_radeon_info buffer;
+ CLEAN(buffer);
+ buffer.request = command;
+ buffer.value = (uint64_t)data;
+
+ error = ioctl(fd, DRM_IOCTL_RADEON_INFO, &buffer);
+ if(error)
+ errorDebug("ioctl radeon");
+
+ return error;
+}
+
+int radeonTemperature(int fd, int *data){
+ return radeonGetValue(fd, data, RADEON_INFO_CURRENT_GPU_TEMP); // http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L555
+}
+
+int radeonCoreClock(int fd, unsigned *data){
+ return radeonGetValue(fd, data, RADEON_INFO_CURRENT_GPU_SCLK); // http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L562
+}
+
+int radeonMaxCoreClock(int fd, unsigned *data){
+ return radeonGetValue(fd, data, RADEON_INFO_MAX_SCLK); // http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L511
+}
+
+int radeonMemoryClock(int fd, unsigned *data){
+ return radeonGetValue(fd, data, RADEON_INFO_CURRENT_GPU_MCLK); // http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L569
+}
+
+int radeonVramUsage(int fd, unsigned long *data){
+ return radeonGetValue(fd, data, RADEON_INFO_VRAM_USAGE); // http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L529
+}
+
+int radeonGttUsage(int fd, unsigned long *data){
+ return radeonGetValue(fd, data, RADEON_INFO_GTT_USAGE); // http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L534
+}
+
+int radeonReadRegistry(int fd, unsigned *data){
+ return radeonGetValue(fd, data, RADEON_INFO_READ_REG); // http://lxr.free-electrons.com/source/drivers/gpu/drm/radeon/radeon_kms.c#L576
+}
+
+int radeonGpuUsage(int fd, float *data, unsigned time, unsigned frequency){
+ return gpuUsage(fd, data, time, frequency, radeonReadRegistry);
+}
+
+
+/******************** AMDGPU ********************/
+#include <drm/amdgpu_drm.h> // http://lxr.free-electrons.com/source/include/uapi/drm/amdgpu_drm.h#L441
+
+int amdgpuVramSize(int fd, unsigned long *data){
+ int error;
+ struct drm_amdgpu_info_vram_gtt info;
+ struct drm_amdgpu_info buffer;
+ CLEAN(buffer);
+ buffer.query = AMDGPU_INFO_VRAM_GTT; // http://lxr.free-electrons.com/source/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c#L404
+ buffer.return_pointer = (uint64_t)&info;
+ buffer.return_size = sizeof(info);
+
+ error = ioctl(fd, DRM_IOCTL_AMDGPU_INFO, &buffer);
+ *data = info.vram_size;
+
+ if(error)
+ errorDebug("ioctl amdgpu");
+
+ return error;
+}
+
+int amdgpuGetValue(int fd, void *data, uint32_t command){
+ int error;
+ struct drm_amdgpu_info buffer;
+ CLEAN(buffer);
+ buffer.query = command;
+ buffer.return_pointer = (uint64_t)data;
+ buffer.return_size = sizeof(unsigned long);
+
+ error = ioctl(fd, DRM_IOCTL_AMDGPU_INFO, &buffer);
+ if(error)
+ errorDebug("ioctl amdgpu");
+
+ return error;
+}
+
+int amdgpuVramUsage(int fd, unsigned long *data){
+ return amdgpuGetValue(fd, data, AMDGPU_INFO_VRAM_USAGE); // http://lxr.free-electrons.com/source/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c#L381
+}
+
+int amdgpuGttUsage(int fd, unsigned long *data){
+ return amdgpuGetValue(fd, data, AMDGPU_INFO_GTT_USAGE); // http://lxr.free-electrons.com/source/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c#L387
+}
+
+int amdgpuReadRegistry(int fd, unsigned *data){
+ return amdgpuGetValue(fd, data, AMDGPU_INFO_READ_MMR_REG); // http://lxr.free-electrons.com/source/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c#L416
+}
+
+int amdgpuGpuUsage(int fd, float *data, unsigned time, unsigned frequency){
+ return gpuUsage(fd, data, time, frequency, amdgpuReadRegistry);
+}
+
+#endif
diff --git a/radeon-profile/radeon_ioctl.h b/radeon-profile/radeon_ioctl.h
new file mode 100644
index 0000000..0a7735c
--- /dev/null
+++ b/radeon-profile/radeon_ioctl.h
@@ -0,0 +1,116 @@
+#ifndef RADEON_IOCTL_H
+#define RADEON_IOCTL_H
+
+
+
+/**
+ * @brief openCardFD Open the file descriptor needed for ioctls
+ * @param card Name of the card to be opened (e.g. card0).
+ * @warning You can find the list of available cards by running 'ls /dev/dri/'
+ * @return File descriptor >=0 on success, error value <0 on failure
+ */
+int openCardFD(const char * card);
+
+
+/**
+ * @brief closeCardFD Close a file descriptor
+ * @param fd The file descriptor to close
+ */
+void closeCardFD(int fd);
+
+
+/**
+ * @brief radeonTemperature Get GPU temperature [RADEON driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, in °mC (milliCelsius)
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonTemperature(int fd, int *data);
+
+
+/**
+ * @brief radeonCoreClock Get GPU current clock (sclk) [RADEON driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, in MHz
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonCoreClock(int fd, unsigned *data);
+
+
+/**
+ * @brief radeonMaxCoreClock Get GPU maximum clock [RADEON driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, in KHz
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonMaxCoreClock(int fd, unsigned *data);
+
+
+/**
+ * @brief radeonGpuUsage Get how busy the GPU is [RADEON driver]
+ * @brief amdgpuGpuUsage Get how busy the GPU is [AMDGPU driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, as percentage of time (o%=idle, 100%=full)
+ * @param time How much time to consider, in μS (microSeconds)
+ * @warning This function blocks the application for the whole time indicated in 'time'
+ * @param frequency How frequently to check if the GPU is busy during the time, in Hz
+ * @warning A frequency > 100 Hz is suggested (A low sampling frequency reduces precision)
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonGpuUsage(int fd, float *data, unsigned time, unsigned frequency);
+int amdgpuGpuUsage(int fd, float *data, unsigned time, unsigned frequency);
+
+
+/**
+ * @brief radeonMemoryClock Get VRAM memory current clock (mclk) [RADEON driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, in MHz
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonMemoryClock(int fd, unsigned *data);
+
+
+/**
+ * @brief radeonVramUsage Get VRAM memory current usage [RADEON driver]
+ * @brief amdgpuVramUsage Get VRAM memory current usage [AMDGPU driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, in bytes
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonVramUsage(int fd, unsigned long *data);
+int amdgpuVramUsage(int fd, unsigned long *data);
+
+
+/**
+ * @brief amdgpuVramSize Get VRAM memory size [AMDGPU driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, in bytes
+ * @return 0 on success, error value !=0 on failure
+ */
+int amdgpuVramSize(int fd, unsigned long *data);
+
+
+/**
+ * @brief radeonGttUsage Get GTT memory current usage [RADEON driver]
+ * @brief amdgpuGttUsage Get GTT memory current usage [AMDGPU driver]
+ * @param fd File descriptor to use
+ * @param data On success is filled with the value, in bytes
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonGttUsage(int fd, unsigned long *data);
+int amdgpuGttUsage(int fd, unsigned long *data);
+
+
+/**
+ * @brief radeonReadRegistry Read the content of a GPU register [RADEON driver]
+ * @brief amdgpuReadRegistry Read the content of a GPU register [AMDGPU driver]
+ * @param fd File descriptor to use
+ * @param data When called must contain the registry address. On success is filled with the content of the register.
+ * @return 0 on success, error value !=0 on failure
+ */
+int radeonReadRegistry(int fd, unsigned *data);
+int amdgpuReadRegistry(int fd, unsigned *data);
+
+
+
+#endif
diff --git a/radeon-profile/radeon_profile.cpp b/radeon-profile/radeon_profile.cpp
index 46e102c..8db463a 100644
--- a/radeon-profile/radeon_profile.cpp
+++ b/radeon-profile/radeon_profile.cpp
@@ -35,6 +35,7 @@ radeon_profile::radeon_profile(QStringList a,QWidget *parent) :
rangeX = 180;
ticksCounter = 0;
statsTickCounter = 0;
+ savedState = nullptr;
ui->setupUi(this);
timer = new QTimer(this);
@@ -94,6 +95,7 @@ radeon_profile::radeon_profile(QStringList a,QWidget *parent) :
connectSignals();
showWindow();
+ qDebug() << "Initialization completed";
}
radeon_profile::~radeon_profile()
diff --git a/radeon-profile/radeon_profile.h b/radeon-profile/radeon_profile.h
index 120891c..23bd961 100644
--- a/radeon-profile/radeon_profile.h
+++ b/radeon-profile/radeon_profile.h
@@ -173,7 +173,7 @@ private:
QMap<QString, unsigned int> pmStats;
unsigned int rangeX, ticksCounter, statsTickCounter;
QButtonGroup pwmGroup;
- currentStateInfo *savedState = nullptr;
+ currentStateInfo *savedState;
Ui::radeon_profile *ui;
void setupGraphs();
diff --git a/radeon-profile/dxorg.cpp b/radeon-profile/dxorg.cpp
index b359314..8be6988 100644
--- a/radeon-profile/dxorg.cpp
+++ b/radeon-profile/dxorg.cpp
@@ -342,18 +342,22 @@ float dXorg::getTemperature() {
}
globalStuff::powerMethod dXorg::getPowerMethod() {
- if (QFile::exists(filePaths.dpmStateFilePath))
+ if (QFile::exists(filePaths.dpmStateFilePath)){
+ qDebug() << "Found" << filePaths.dpmStateFilePath << ", using DPM";
return globalStuff::DPM;
+ }
QFile powerMethodFile(filePaths.powerMethodFilePath);
if (powerMethodFile.open(QIODevice::ReadOnly)) {
QString s = powerMethodFile.readLine(20);
- if (s.contains("dpm",Qt::CaseInsensitive))
+ if (s.contains("dpm",Qt::CaseInsensitive)){
+ qDebug() << "Found" << filePaths.powerMethodFilePath << ", using DPM";
return globalStuff::DPM;
- else if (s.contains("profile",Qt::CaseInsensitive))
+ } else if (s.contains("profile",Qt::CaseInsensitive)){
+ qDebug() << "Found" << filePaths.powerMethodFilePath << ", using PROFILE";
return globalStuff::PROFILE;
- else
+ } else
return globalStuff::PM_UNKNOWN;
}
@@ -494,67 +498,54 @@ void dXorg::setNewValue(const QString &filePath, const QString &newValue) {
qWarning() << "Unable to open " << filePath << " to write " << newValue;
}
+/** Translate a power profile into its actual string */
+QString powerProfilesToString(globalStuff::powerProfiles profile){
+ switch (profile) {
+ case globalStuff::BATTERY: return dpm_battery;
+ case globalStuff::BALANCED: return dpm_balanced;
+ case globalStuff::PERFORMANCE: return dpm_performance;
+ case globalStuff::AUTO: return profile_auto;
+ case globalStuff::DEFAULT: return profile_default;
+ case globalStuff::HIGH: return profile_high;
+ case globalStuff::MID: return profile_mid;
+ case globalStuff::LOW: return profile_low;
+ default: return "ERROR";
+ }
+}
+
void dXorg::setPowerProfile(globalStuff::powerProfiles _newPowerProfile) {
- QString newValue;
- switch (_newPowerProfile) {
- case globalStuff::BATTERY:
- newValue = dpm_battery;
- break;
- case globalStuff::BALANCED:
- newValue = dpm_balanced;
- break;
- case globalStuff::PERFORMANCE:
- newValue = dpm_performance;
- break;
- case globalStuff::AUTO:
- newValue = profile_auto;
- break;
- case globalStuff::DEFAULT:
- newValue = profile_default;
- break;
- case globalStuff::HIGH:
- newValue = profile_high;
- break;
- case globalStuff::MID:
- newValue = profile_mid;
- break;
- case globalStuff::LOW:
- newValue = profile_low;
- break;
- default: break;
+ if(Q_UNLIKELY(currentPowerMethod == globalStuff::PM_UNKNOWN)){
+ qCritical() << "Asked to set power profile but no power method available";
+ return;
}
+ QString newValue = powerProfilesToString(_newPowerProfile),
+ path = Q_LIKELY(currentPowerMethod==globalStuff::DPM) ? filePaths.dpmStateFilePath : filePaths.profilePath;
+
if (daemonConnected()) {
QString command; // SIGNAL_SET_VALUE + SEPARATOR + VALUE + SEPARATOR + PATH + SEPARATOR
command.append(DAEMON_SIGNAL_SET_VALUE).append(SEPARATOR); // Set value flag
command.append(newValue).append(SEPARATOR); // Power profile to be set
- command.append(filePaths.dpmStateFilePath).append(SEPARATOR); // The path where the power profile should be written in
+ command.append(path).append(SEPARATOR); // The path where the power profile should be written in
qDebug() << "Sending daemon power profile signal: " << command;
dcomm->sendCommand(command);
- } else {
- // enum is int, so first three values are dpm, rest are profile
- if (_newPowerProfile <= globalStuff::PERFORMANCE)
- setNewValue(filePaths.dpmStateFilePath,newValue);
- else
- setNewValue(filePaths.profilePath,newValue);
+ } else
+ setNewValue(path, newValue);
+}
+
+/** Translate a forced power level into its actual string */
+QString forcePowerLevelsToString(globalStuff::forcePowerLevels level){
+ switch(level){
+ case globalStuff::F_AUTO: return dpm_auto;
+ case globalStuff::F_LOW: return dpm_low;
+ case globalStuff::F_HIGH: return dpm_high;
+ default: return "ERROR";
}
}
void dXorg::setForcePowerLevel(globalStuff::forcePowerLevels _newForcePowerLevel) {
- QString newValue;
- switch (_newForcePowerLevel) {
- case globalStuff::F_AUTO:
- newValue = dpm_auto;
- break;
- case globalStuff::F_HIGH:
- newValue = dpm_high;
- break;
- case globalStuff::F_LOW:
- newValue = dpm_low;
- default:
- break;
- }
+ QString newValue = forcePowerLevelsToString(_newForcePowerLevel);
if (daemonConnected()) {
QString command; // SIGNAL_SET_VALUE + SEPARATOR + VALUE + SEPARATOR + PATH + SEPARATOR
@@ -674,16 +665,17 @@ globalStuff::driverFeatures dXorg::figureOutDriverFeatures() {
features.pm = currentPowerMethod;
+ if(daemonConnected() && (currentPowerMethod != globalStuff::PM_UNKNOWN)){
+ qDebug() << "Daemon will be used to change profile";
+ features.canChangeProfile = true;
+ }
+
switch (currentPowerMethod) {
case globalStuff::DPM: {
- if (daemonConnected())
+ QFile f(filePaths.dpmStateFilePath);
+ if (f.open(QIODevice::WriteOnly)){
features.canChangeProfile = true;
- else {
- QFile f(filePaths.dpmStateFilePath);
- if (f.open(QIODevice::WriteOnly)){
- features.canChangeProfile = true;
- f.close();
- }
+ f.close();
}
break;
}
diff --git a/radeon-profile/globalStuff.h b/radeon-profile/globalStuff.h
index 4a63f6b..e1ce43c 100644
--- a/radeon-profile/globalStuff.h
+++ b/radeon-profile/globalStuff.h
@@ -72,7 +72,7 @@ public:
}
static QStringList createProfileCombo() {
- return QStringList() << profile_auto << profile_default << profile_high << profile_mid << profile_low;
+ return QStringList() << profile_auto << profile_default << profile_low << profile_mid << profile_high;
}
enum powerProfiles {
diff --git a/radeon-profile/gpu.cpp b/radeon-profile/gpu.cpp
index cb70859..0fddb9d 100644
--- a/radeon-profile/gpu.cpp
+++ b/radeon-profile/gpu.cpp
@@ -697,7 +697,8 @@ QList<QTreeWidgetItem *> gpu::getCardConnectors() const {
properties[propertyIndex]);
if(propertyInfo == NULL) {
qDebug() << screenIndex << '/' << outputInfo->name << ": propertyInfo is NULL";
- } else if(propertyInfo->num_values > 0) { // A range or a list of alternatives is present
+ } else {
+ if(propertyInfo->num_values > 0) { // A range or a list of alternatives is present
// Proceed to print the range or the list alternatives
propertyValue += (propertyInfo->range) ? " (Range: " : " (Supported: ";
@@ -722,6 +723,7 @@ QList<QTreeWidgetItem *> gpu::getCardConnectors() const {
}
propertyValue += ')';
+ }
// Property alternatives completed: deallocate propertyInfo
free(propertyInfo);
diff --git a/radeon-profile/uiEvents.cpp b/radeon-profile/uiEvents.cpp
index 6d19ef7..be7df1d 100644
--- a/radeon-profile/uiEvents.cpp
+++ b/radeon-profile/uiEvents.cpp
@@ -324,18 +324,8 @@ void radeon_profile::on_chProfile_clicked()
QString selection = QInputDialog::getItem(this, tr("Select new power profile"), tr("Profile selection"), globalStuff::createProfileCombo(), 0, false, &ok);
- if (ok) {
- if (selection == profile_default)
- device.setPowerProfile(globalStuff::DEFAULT);
- else if (selection == profile_auto)
- device.setPowerProfile(globalStuff::AUTO);
- else if (selection == profile_high)
- device.setPowerProfile(globalStuff::HIGH);
- else if (selection == profile_mid)
- device.setPowerProfile(globalStuff::MID);
- else if (selection == profile_low)
- device.setPowerProfile(globalStuff::LOW);
- }
+ if (ok)
+ ui->combo_pProfile->setCurrentIndex(ui->combo_pProfile->findText(selection));
}
void radeon_profile::on_btn_reconfigureDaemon_clicked()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment