├── VERSION ├── po ├── LINGUAS ├── POTFILES.in ├── adriconf.pot ├── zh_CN.po ├── hr.po ├── en.po ├── lv.po └── pt_BR.po ├── drilogo.jpg ├── .gitignore ├── flatpak ├── br.com.jeanhertel.adriconf.png ├── br.com.jeanhertel.adriconf.screenshot-0.png ├── br.com.jeanhertel.adriconf.screenshot-1.png ├── br.com.jeanhertel.adriconf.desktop ├── br.com.jeanhertel.adriconf.json └── br.com.jeanhertel.adriconf.appdata.xml ├── adriconf ├── version.h.in ├── Translation │ ├── GetTextTranslator.cpp │ ├── TranslatorInterface.h │ └── GetTextTranslator.h ├── adriconf.gresource.xml ├── ValueObject │ ├── DriverOptionType.h │ ├── DriverConfiguration.cpp │ ├── DriverConfiguration.h │ ├── EGLDisplayInterface.h │ ├── ComboBoxColumn.h │ ├── ApplicationOption.cpp │ ├── DRMDeviceInterface.h │ ├── GBMDevice.h │ ├── ApplicationOption.h │ ├── DRMDevice.h │ ├── Section.h │ ├── GBMDevice.cpp │ ├── Section.cpp │ ├── Device.h │ ├── DRMDevice.cpp │ ├── EGLDisplayWrapper.h │ ├── Device.cpp │ ├── Application.h │ ├── DriverOption.h │ ├── GPUInfo.h │ ├── Application.cpp │ ├── EGLDisplayWrapper.cpp │ ├── GPUInfo.cpp │ └── DriverOption.cpp ├── Logging │ ├── LoggerLevel.h │ ├── Logger.h │ ├── LoggerInterface.h │ └── Logger.cpp ├── Utils │ ├── GBMDeviceFactoryInterface.h │ ├── Writer.h │ ├── WriterInterface.h │ ├── DRMDeviceFactory.h │ ├── PCIDatabaseQueryInterface.h │ ├── DisplayServerQueryInterface.h │ ├── EGLDisplayFactoryInterface.h │ ├── GBMDeviceFactory.h │ ├── DRMDeviceFactoryInterface.h │ ├── PCIDatabaseQuery.h │ ├── DRMDeviceFactory.cpp │ ├── ParserInterface.h │ ├── PCIDatabaseQuery.cpp │ ├── EGLDisplayFactory.h │ ├── GBMDeviceFactory.cpp │ ├── WaylandQuery.h │ ├── XorgQuery.h │ ├── ConfigurationLoaderInterface.h │ ├── Parser.h │ ├── DRIQuery.h │ ├── Writer.cpp │ ├── ConfigurationLoader.h │ ├── ConfigurationResolverInterface.h │ ├── WaylandQuery.cpp │ ├── EGLDisplayFactory.cpp │ ├── ConfigurationResolver.h │ ├── XorgQuery.cpp │ ├── DRIQuery.cpp │ ├── ConfigurationLoader.cpp │ └── Parser.cpp ├── GUI.h ├── CMakeLists.txt └── main.cpp ├── AUTHORS ├── tests ├── Translation │ └── TranslatorMock.h ├── Logging │ └── LoggerMock.h ├── Utils │ └── ParserMock.h ├── DriverConfigurationTest.cpp ├── ApplicationOptionTest.cpp ├── SectionTest.cpp ├── CMakeLists.txt ├── DeviceTest.cpp ├── GPUInfoTest.cpp ├── ApplicationTest.cpp └── DriverOptionTest.cpp ├── CMakeLists.txt.in ├── RELEASING.md ├── Jenkinsfile ├── CONTRIBUTING.md ├── README.md └── CMakeLists.txt /VERSION: -------------------------------------------------------------------------------- 1 | 1.6.1 -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | en 2 | hr 3 | it 4 | lv 5 | pt_BR 6 | zh_CN 7 | -------------------------------------------------------------------------------- /drilogo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlHertel/adriconf/HEAD/drilogo.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .flatpak-builder/ 3 | cmake-build-debug/ 4 | cmake-build-release/ 5 | resources.c 6 | -------------------------------------------------------------------------------- /flatpak/br.com.jeanhertel.adriconf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlHertel/adriconf/HEAD/flatpak/br.com.jeanhertel.adriconf.png -------------------------------------------------------------------------------- /flatpak/br.com.jeanhertel.adriconf.screenshot-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlHertel/adriconf/HEAD/flatpak/br.com.jeanhertel.adriconf.screenshot-0.png -------------------------------------------------------------------------------- /flatpak/br.com.jeanhertel.adriconf.screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlHertel/adriconf/HEAD/flatpak/br.com.jeanhertel.adriconf.screenshot-1.png -------------------------------------------------------------------------------- /adriconf/version.h.in: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #define GIT_COMMIT_HASH "@GIT_COMMIT_HASH@" 5 | #define BUILD_VERSION_NUMBER "@BUILD_VERSION_NUMBER@" 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /adriconf/Translation/GetTextTranslator.cpp: -------------------------------------------------------------------------------- 1 | #include "GetTextTranslator.h" 2 | 3 | #include 4 | 5 | const char * GetTextTranslator::trns(const char *text) { 6 | return gettext(text); 7 | } 8 | -------------------------------------------------------------------------------- /adriconf/adriconf.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DriConf.glade 5 | 6 | 7 | -------------------------------------------------------------------------------- /adriconf/ValueObject/DriverOptionType.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_DRIVEROPTIONTYPE_H 2 | #define ADRICONF_DRIVEROPTIONTYPE_H 3 | 4 | enum class DriverOptionType { 5 | UNKNOW, 6 | 7 | BOOL, 8 | FAKE_BOOL, 9 | ENUM, 10 | INT 11 | }; 12 | #endif //ADRICONF_DRIVEROPTIONTYPE_H 13 | -------------------------------------------------------------------------------- /adriconf/Translation/TranslatorInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_TRANSLATORINTERFACE_H 2 | #define ADRICONF_TRANSLATORINTERFACE_H 3 | 4 | #include 5 | 6 | class TranslatorInterface { 7 | public: 8 | virtual const char *trns(const char *text) = 0; 9 | }; 10 | 11 | #endif //ADRICONF_TRANSLATORINTERFACE_H -------------------------------------------------------------------------------- /adriconf/Translation/GetTextTranslator.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_TRANSLATOR_H 2 | #define ADRICONF_TRANSLATOR_H 3 | 4 | #include "TranslatorInterface.h" 5 | 6 | class GetTextTranslator : public TranslatorInterface { 7 | public: 8 | const char * trns(const char *text) override; 9 | }; 10 | 11 | 12 | #endif //ADRICONF_TRANSLATOR_H 13 | -------------------------------------------------------------------------------- /adriconf/ValueObject/DriverConfiguration.cpp: -------------------------------------------------------------------------------- 1 | #include "DriverConfiguration.h" 2 | 3 | const int &DriverConfiguration::getScreen() const { 4 | return screen; 5 | } 6 | 7 | void DriverConfiguration::setScreen(int screen) { 8 | DriverConfiguration::screen = screen; 9 | } 10 | 11 | DriverConfiguration::DriverConfiguration() : screen(0) {} 12 | -------------------------------------------------------------------------------- /flatpak/br.com.jeanhertel.adriconf.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=adriconf 3 | GenericName=Advanced DRI Configurator 4 | Comment=A GUI tool used to configure open source graphics drivers 5 | Version=1.1 6 | Exec=adriconf 7 | Type=Application 8 | Terminal=false 9 | Icon=br.com.jeanhertel.adriconf 10 | Categories=Settings;HardwareSettings;GNOME;GTK 11 | -------------------------------------------------------------------------------- /adriconf/Logging/LoggerLevel.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by jean on 17/08/19. 3 | // 4 | 5 | #ifndef ADRICONF_LOGGERLEVEL_H 6 | #define ADRICONF_LOGGERLEVEL_H 7 | 8 | #include 9 | 10 | enum class LoggerLevel: std::int8_t { 11 | DEBUG = 1, 12 | INFO = 2, 13 | WARNING = 4, 14 | ERROR = 8 15 | }; 16 | 17 | 18 | #endif //ADRICONF_LOGGERLEVEL_H 19 | -------------------------------------------------------------------------------- /adriconf/Utils/GBMDeviceFactoryInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_GBMDEVICEFACTORYINTERFACE_H 2 | #define ADRICONF_GBMDEVICEFACTORYINTERFACE_H 3 | 4 | #include "../ValueObject/GBMDevice.h" 5 | 6 | class GBMDeviceFactoryInterface { 7 | public: 8 | virtual GBMDevice generateDeviceFromPath(const char *path) = 0; 9 | }; 10 | 11 | #endif //ADRICONF_GBMDEVICEFACTORYINTERFACE_H 12 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Adriconf is written and maintained by Jean Hertel. 2 | 3 | Other authors and contributors include, but are not limited to: 4 | 5 | Albano Battistella 6 | Balló György 7 | Christoph Haag 8 | Gert Wollny 9 | Harald H. 10 | Hugo Locurcio 11 | Nicolai Hähnle 12 | Rémi Verschelde 13 | Rob Clark 14 | Veluri Mithun 15 | Linards Liepins 16 | Dingzhong Chen 17 | Leandro Stanger 18 | -------------------------------------------------------------------------------- /tests/Translation/TranslatorMock.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_TRANSLATORMOCK_H 2 | #define ADRICONF_TRANSLATORMOCK_H 3 | 4 | #include "gmock/gmock.h" 5 | #include "../../adriconf/Translation/TranslatorInterface.h" 6 | 7 | class TranslatorMock : public TranslatorInterface { 8 | public: 9 | MOCK_METHOD(const char *, trns, (const char *text), (override)); 10 | }; 11 | 12 | #endif //ADRICONF_TRANSLATORMOCK_H -------------------------------------------------------------------------------- /adriconf/ValueObject/DriverConfiguration.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_DRIVERCONFIGURATION_H 2 | #define DRICONF3_DRIVERCONFIGURATION_H 3 | 4 | #include "GPUInfo.h" 5 | 6 | class DriverConfiguration : public GPUInfo { 7 | private: 8 | int screen; 9 | 10 | public: 11 | DriverConfiguration(); 12 | 13 | const int &getScreen() const; 14 | 15 | void setScreen(int screen); 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /adriconf/Utils/Writer.h: -------------------------------------------------------------------------------- 1 | #ifndef SIMECONF_WRITER_H 2 | #define SIMECONF_WRITER_H 3 | 4 | #include 5 | #include 6 | #include "../ValueObject/Device.h" 7 | #include "WriterInterface.h" 8 | 9 | class Writer : public WriterInterface { 10 | public: 11 | ~Writer() override = default; 12 | 13 | Glib::ustring generateRawXml(const std::list &devices) override; 14 | }; 15 | 16 | #endif -------------------------------------------------------------------------------- /adriconf/Utils/WriterInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_WRITERINTERFACE_H 2 | #define ADRICONF_WRITERINTERFACE_H 3 | 4 | #include 5 | #include 6 | #include "../ValueObject/Device.h" 7 | 8 | class WriterInterface { 9 | public: 10 | virtual ~WriterInterface() = default; 11 | virtual Glib::ustring generateRawXml(const std::list &devices) = 0; 12 | }; 13 | 14 | #endif //ADRICONF_WRITERINTERFACE_H -------------------------------------------------------------------------------- /adriconf/ValueObject/EGLDisplayInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_EGLDISPLAYINTERFACE_H 2 | #define ADRICONF_EGLDISPLAYINTERFACE_H 3 | 4 | #include 5 | 6 | class EGLDisplayInterface { 7 | public: 8 | virtual const char *getDriverName() = 0; 9 | 10 | virtual const char *getDriverOptions() = 0; 11 | 12 | virtual Glib::ustring getExtensions() const = 0; 13 | }; 14 | 15 | #endif //ADRICONF_EGLDISPLAYINTERFACE_H -------------------------------------------------------------------------------- /CMakeLists.txt.in: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | 3 | project(googletest-download NONE) 4 | 5 | include(ExternalProject) 6 | ExternalProject_Add(googletest 7 | GIT_REPOSITORY https://github.com/google/googletest.git 8 | GIT_TAG master 9 | SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" 10 | BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" 11 | CONFIGURE_COMMAND "" 12 | BUILD_COMMAND "" 13 | INSTALL_COMMAND "" 14 | TEST_COMMAND "" 15 | ) -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | adriconf/DriConf.glade 2 | adriconf/Translation/GetTextTranslator.cpp 3 | adriconf/main.cpp 4 | adriconf/GUI.cpp 5 | adriconf/Utils/ConfigurationLoader.cpp 6 | adriconf/Utils/ConfigurationResolver.cpp 7 | adriconf/Utils/DRIQuery.cpp 8 | adriconf/Utils/EGLDisplayFactory.cpp 9 | adriconf/Utils/GBMDeviceFactory.cpp 10 | adriconf/Utils/Parser.cpp 11 | adriconf/Utils/WaylandQuery.cpp 12 | adriconf/Utils/XorgQuery.cpp 13 | adriconf/ValueObject/EGLDisplayWrapper.cpp 14 | -------------------------------------------------------------------------------- /adriconf/Utils/DRMDeviceFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_DRMDEVICEFACTORY_H 2 | #define ADRICONF_DRMDEVICEFACTORY_H 3 | 4 | #include "DRMDeviceFactoryInterface.h" 5 | #include "../ValueObject/DRMDeviceInterface.h" 6 | 7 | #include 8 | #include 9 | 10 | class DRMDeviceFactory : public DRMDeviceFactoryInterface { 11 | public: 12 | std::vector> getDevices() override; 13 | }; 14 | 15 | 16 | #endif //ADRICONF_DRMDEVICEFACTORY_H 17 | -------------------------------------------------------------------------------- /adriconf/ValueObject/ComboBoxColumn.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_COMBOBOXCOLUMN_H 2 | #define ADRICONF_COMBOBOXCOLUMN_H 3 | 4 | #include 5 | 6 | class ComboBoxColumn : public Gtk::TreeModel::ColumnRecord { 7 | public: 8 | 9 | ComboBoxColumn() { 10 | add(optionName); 11 | add(optionValue); 12 | } 13 | 14 | Gtk::TreeModelColumn optionName; 15 | Gtk::TreeModelColumn optionValue; 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /adriconf/Utils/PCIDatabaseQueryInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_PCIDATABASEQUERYINTERFACE_H 2 | #define ADRICONF_PCIDATABASEQUERYINTERFACE_H 3 | 4 | #include 5 | 6 | class PCIDatabaseQueryInterface { 7 | public: 8 | virtual ~PCIDatabaseQueryInterface() = default; 9 | 10 | virtual Glib::ustring queryVendorName(uint16_t vendorId) = 0; 11 | virtual Glib::ustring queryDeviceName(uint16_t vendorId, uint16_t deviceId) = 0; 12 | }; 13 | 14 | #endif //ADRICONF_PCIDATABASEQUERYINTERFACE_H -------------------------------------------------------------------------------- /adriconf/ValueObject/ApplicationOption.cpp: -------------------------------------------------------------------------------- 1 | #include "ApplicationOption.h" 2 | 3 | const Glib::ustring &ApplicationOption::getName() const { 4 | return name; 5 | } 6 | 7 | void ApplicationOption::setName(Glib::ustring name) { 8 | ApplicationOption::name = std::move(name); 9 | } 10 | 11 | const Glib::ustring &ApplicationOption::getValue() const { 12 | return value; 13 | } 14 | 15 | void ApplicationOption::setValue(Glib::ustring value) { 16 | ApplicationOption::value = std::move(value); 17 | } 18 | -------------------------------------------------------------------------------- /adriconf/ValueObject/DRMDeviceInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_DRMDEVICEINTERFACE_H 2 | #define ADRICONF_DRMDEVICEINTERFACE_H 3 | 4 | #include 5 | #include 6 | 7 | class DRMDeviceInterface { 8 | public: 9 | virtual Glib::ustring getFormattedPCIId() = 0; 10 | 11 | virtual uint16_t getVendorPCIId() = 0; 12 | 13 | virtual uint16_t getDevicePCIId() = 0; 14 | 15 | virtual const char *getDeviceRenderNodeName() = 0; 16 | }; 17 | 18 | 19 | #endif //ADRICONF_DRMDEVICEINTERFACE_H 20 | -------------------------------------------------------------------------------- /adriconf/Utils/DisplayServerQueryInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_DISPLAYSERVERQUERYINTERFACE_H 2 | #define ADRICONF_DISPLAYSERVERQUERYINTERFACE_H 3 | 4 | #include 5 | #include "../ValueObject/DriverConfiguration.h" 6 | #include 7 | 8 | class DisplayServerQueryInterface { 9 | public: 10 | virtual std::list queryDriverConfigurationOptions(const Glib::ustring &locale) = 0; 11 | virtual bool checkNecessaryExtensions() = 0; 12 | }; 13 | 14 | #endif //ADRICONF_DISPLAYSERVERQUERYINTERFACE_H -------------------------------------------------------------------------------- /adriconf/ValueObject/GBMDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_GBMDEVICE_H 2 | #define ADRICONF_GBMDEVICE_H 3 | 4 | #include 5 | 6 | class GBMDevice { 7 | private: 8 | int rawFileDescriptor; 9 | struct gbm_device *rawGBMDevice; 10 | 11 | public: 12 | GBMDevice(); 13 | 14 | virtual ~GBMDevice(); 15 | 16 | void setRawFileDescriptor(int fileDescriptor); 17 | 18 | void setRawGBMDevice(struct gbm_device *device); 19 | 20 | struct gbm_device *getRawGBMDevice() const; 21 | }; 22 | 23 | #endif //ADRICONF_GBMDEVICE_H -------------------------------------------------------------------------------- /tests/Logging/LoggerMock.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_LOGGERMOCK_H 2 | #define ADRICONF_LOGGERMOCK_H 3 | 4 | #include "gmock/gmock.h" 5 | #include "../../adriconf/Logging/LoggerInterface.h" 6 | 7 | class LoggerMock : public LoggerInterface { 8 | public: 9 | MOCK_METHOD(void, debug, (Glib::ustring), (override)); 10 | MOCK_METHOD(void, info, (Glib::ustring), (override)); 11 | MOCK_METHOD(void, warning, (Glib::ustring), (override)); 12 | MOCK_METHOD(void, error, (Glib::ustring), (override)); 13 | }; 14 | 15 | #endif //ADRICONF_LOGGERMOCK_H -------------------------------------------------------------------------------- /adriconf/Utils/EGLDisplayFactoryInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_EGLDISPLAYFACTORYINTERFACE_H 2 | #define ADRICONF_EGLDISPLAYFACTORYINTERFACE_H 3 | 4 | #include "../ValueObject/EGLDisplayInterface.h" 5 | #include "../ValueObject/GBMDevice.h" 6 | #include 7 | 8 | class EGLDisplayFactoryInterface { 9 | public: 10 | virtual std::shared_ptr createDisplayFromGBM(const GBMDevice &device) = 0; 11 | virtual std::shared_ptr createDefaultDisplay() = 0; 12 | }; 13 | 14 | #endif //ADRICONF_EGLDISPLAYFACTORYINTERFACE_H -------------------------------------------------------------------------------- /adriconf/Utils/GBMDeviceFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_GBMDEVICEFACTORY_H 2 | #define ADRICONF_GBMDEVICEFACTORY_H 3 | 4 | #include "GBMDeviceFactoryInterface.h" 5 | #include "../Translation/TranslatorInterface.h" 6 | 7 | class GBMDeviceFactory : public GBMDeviceFactoryInterface { 8 | private: 9 | TranslatorInterface *translator; 10 | public: 11 | explicit GBMDeviceFactory(TranslatorInterface *translator) : translator(translator) {} 12 | 13 | GBMDevice generateDeviceFromPath(const char *path) override; 14 | }; 15 | 16 | #endif //ADRICONF_GBMDEVICEFACTORY_H -------------------------------------------------------------------------------- /adriconf/Utils/DRMDeviceFactoryInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_DRMDEVICEFACTORYINTERFACE_H 2 | #define ADRICONF_DRMDEVICEFACTORYINTERFACE_H 3 | 4 | #include "../ValueObject/DRMDeviceInterface.h" 5 | 6 | #include 7 | #include 8 | 9 | /* MESA HAS THIS HARD-CODED TO 32 SO WE MUST HARD-CODE IT ALSO */ 10 | #define ADRICONF_MESA_MAX_DRM_DEVICES 32 11 | 12 | class DRMDeviceFactoryInterface { 13 | public: 14 | virtual std::vector> getDevices() = 0; 15 | }; 16 | 17 | 18 | #endif //ADRICONF_DRMDEVICEFACTORYINTERFACE_H 19 | -------------------------------------------------------------------------------- /adriconf/Logging/Logger.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_LOGGER_H 2 | #define ADRICONF_LOGGER_H 3 | 4 | #include "LoggerInterface.h" 5 | #include "LoggerLevel.h" 6 | 7 | class Logger : public LoggerInterface { 8 | private: 9 | LoggerLevel level; 10 | 11 | public: 12 | virtual ~Logger(){}; 13 | 14 | Logger(); 15 | 16 | void debug(Glib::ustring msg) override; 17 | void info(Glib::ustring msg) override; 18 | void warning(Glib::ustring msg) override; 19 | void error(Glib::ustring msg) override; 20 | 21 | void setLevel(LoggerLevel level); 22 | }; 23 | 24 | #endif //ADRICONF_LOGGER_H -------------------------------------------------------------------------------- /adriconf/ValueObject/ApplicationOption.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_APPLICATIONOPTION_H 2 | #define ADRICONF_APPLICATIONOPTION_H 3 | 4 | #include 5 | #include 6 | 7 | class ApplicationOption { 8 | private: 9 | Glib::ustring name; 10 | Glib::ustring value; 11 | 12 | public: 13 | const Glib::ustring &getName() const; 14 | 15 | void setName(Glib::ustring name); 16 | 17 | const Glib::ustring &getValue() const; 18 | 19 | void setValue(Glib::ustring value); 20 | }; 21 | 22 | typedef std::shared_ptr ApplicationOption_ptr; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /adriconf/ValueObject/DRMDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_DRMDEVICE_H 2 | #define ADRICONF_DRMDEVICE_H 3 | 4 | #include "DRMDeviceInterface.h" 5 | #include 6 | 7 | class DRMDevice : public DRMDeviceInterface { 8 | private: 9 | drmDevicePtr rawDevice; 10 | 11 | public: 12 | explicit DRMDevice(drmDevicePtr rawDevice); 13 | 14 | virtual ~DRMDevice(); 15 | 16 | Glib::ustring getFormattedPCIId() override; 17 | 18 | uint16_t getVendorPCIId() override; 19 | 20 | uint16_t getDevicePCIId() override; 21 | 22 | const char *getDeviceRenderNodeName() override; 23 | }; 24 | 25 | 26 | #endif //ADRICONF_DRMDEVICE_H 27 | -------------------------------------------------------------------------------- /adriconf/Utils/PCIDatabaseQuery.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_PCIDATABASEQUERY_H 2 | #define ADRICONF_PCIDATABASEQUERY_H 3 | 4 | #include 5 | #include "PCIDatabaseQueryInterface.h" 6 | 7 | extern "C" { 8 | #include 9 | } 10 | 11 | class PCIDatabaseQuery : public PCIDatabaseQueryInterface { 12 | private: 13 | struct pci_access *pci; 14 | 15 | public: 16 | PCIDatabaseQuery(); 17 | 18 | ~PCIDatabaseQuery() override; 19 | 20 | Glib::ustring queryVendorName(uint16_t vendorId) override; 21 | Glib::ustring queryDeviceName(uint16_t vendorId, uint16_t deviceId) override; 22 | }; 23 | 24 | 25 | #endif //ADRICONF_PCIDATABASEQUERY_H 26 | -------------------------------------------------------------------------------- /adriconf/ValueObject/Section.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_SECTION_H 2 | #define DRICONF3_SECTION_H 3 | 4 | #include 5 | #include 6 | #include "DriverOption.h" 7 | 8 | class Section { 9 | private: 10 | Glib::ustring description; 11 | std::list options; 12 | 13 | public: 14 | Section(); 15 | 16 | const Glib::ustring &getDescription() const; 17 | 18 | const std::list &getOptions() const; 19 | 20 | Section *setDescription(Glib::ustring description); 21 | 22 | Section *addOption(DriverOption option); 23 | 24 | /* Sort the options of this section */ 25 | void sortOptions(); 26 | }; 27 | 28 | #endif -------------------------------------------------------------------------------- /adriconf/Utils/DRMDeviceFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "DRMDeviceFactory.h" 2 | #include "../ValueObject/DRMDevice.h" 3 | 4 | #include 5 | 6 | std::vector> DRMDeviceFactory::getDevices() { 7 | std::vector> devices; 8 | drmDevicePtr enumeratedDevices[ADRICONF_MESA_MAX_DRM_DEVICES]; 9 | int deviceCount = drmGetDevices2(0, enumeratedDevices, ADRICONF_MESA_MAX_DRM_DEVICES); 10 | for (int i = 0; i < deviceCount; i++) { 11 | auto device = std::make_shared(enumeratedDevices[i]); 12 | 13 | devices.emplace_back(device); 14 | } 15 | 16 | return devices; 17 | } 18 | -------------------------------------------------------------------------------- /tests/Utils/ParserMock.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_PARSERMOCK_H 2 | #define ADRICONF_PARSERMOCK_H 3 | 4 | #include "gmock/gmock.h" 5 | #include "../../adriconf/Utils/ParserInterface.h" 6 | 7 | class ParserMock : public ParserInterface { 8 | public: 9 | MOCK_METHOD2(parseAvailableConfiguration, std::list
( 10 | const Glib::ustring &xml, 11 | const Glib::ustring ¤tLocale)); 12 | 13 | MOCK_METHOD2(parseSectionOptions, DriverOption(xmlpp::Node * option, 14 | const Glib::ustring ¤tLocale)); 15 | 16 | MOCK_METHOD1(parseDevices, std::list(Glib::ustring & xml)); 17 | 18 | MOCK_METHOD1(parseApplication, Application_ptr(xmlpp::Node * application)); 19 | }; 20 | 21 | #endif //ADRICONF_PARSERMOCK_H 22 | -------------------------------------------------------------------------------- /adriconf/ValueObject/GBMDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "GBMDevice.h" 2 | 3 | #include 4 | 5 | GBMDevice::~GBMDevice() { 6 | if (this->rawGBMDevice != nullptr) { 7 | gbm_device_destroy(this->rawGBMDevice); 8 | } 9 | 10 | if (this->rawFileDescriptor != 0) { 11 | close(this->rawFileDescriptor); 12 | } 13 | } 14 | 15 | GBMDevice::GBMDevice() : rawFileDescriptor(0), rawGBMDevice(nullptr) {} 16 | 17 | void GBMDevice::setRawFileDescriptor(int fileDescriptor) { 18 | this->rawFileDescriptor = fileDescriptor; 19 | } 20 | 21 | void GBMDevice::setRawGBMDevice(struct gbm_device *device) { 22 | this->rawGBMDevice = device; 23 | } 24 | 25 | struct gbm_device *GBMDevice::getRawGBMDevice() const { 26 | return this->rawGBMDevice; 27 | } 28 | 29 | -------------------------------------------------------------------------------- /adriconf/ValueObject/Section.cpp: -------------------------------------------------------------------------------- 1 | #include "Section.h" 2 | 3 | Section::Section() : options() {} 4 | 5 | const Glib::ustring &Section::getDescription() const { 6 | return this->description; 7 | } 8 | 9 | const std::list &Section::getOptions() const { 10 | return this->options; 11 | } 12 | 13 | Section *Section::setDescription(Glib::ustring description) { 14 | this->description = std::move(description); 15 | 16 | return this; 17 | } 18 | 19 | Section *Section::addOption(DriverOption option) { 20 | this->options.push_back(option); 21 | 22 | return this; 23 | } 24 | 25 | void Section::sortOptions() { 26 | this->options.sort([](const DriverOption &a, const DriverOption &b) { 27 | return a.getSortValue() < b.getSortValue(); 28 | }); 29 | } 30 | -------------------------------------------------------------------------------- /adriconf/Logging/LoggerInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_LOGGERINTERFACE_H 2 | #define ADRICONF_LOGGERINTERFACE_H 3 | 4 | #include 5 | 6 | class LoggerInterface { 7 | public: 8 | 9 | virtual ~LoggerInterface(){} 10 | 11 | /** 12 | * Logs a debug message 13 | * @param msg 14 | */ 15 | virtual void debug(Glib::ustring msg) = 0; 16 | 17 | /** 18 | * Logs a info message 19 | * @param msg 20 | */ 21 | virtual void info(Glib::ustring msg) = 0; 22 | 23 | /** 24 | * Logs a warning message 25 | * @param msg 26 | */ 27 | virtual void warning(Glib::ustring msg) = 0; 28 | 29 | /** 30 | * Logs an error message 31 | * @param msg 32 | */ 33 | virtual void error(Glib::ustring msg) = 0; 34 | }; 35 | 36 | #endif //ADRICONF_LOGGERINTERFACE_H -------------------------------------------------------------------------------- /adriconf/Utils/ParserInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_PARSERINTERFACE_H 2 | #define ADRICONF_PARSERINTERFACE_H 3 | 4 | #include 5 | 6 | #include "../ValueObject/DriverOption.h" 7 | #include "../ValueObject/Device.h" 8 | #include "../ValueObject/Section.h" 9 | 10 | class ParserInterface { 11 | public: 12 | virtual ~ParserInterface() {} 13 | 14 | virtual std::list
15 | parseAvailableConfiguration(const Glib::ustring &xml, const Glib::ustring ¤tLocale) = 0; 16 | 17 | virtual DriverOption parseSectionOptions(xmlpp::Node *option, const Glib::ustring ¤tLocale) = 0; 18 | 19 | virtual std::list parseDevices(Glib::ustring &xml) = 0; 20 | 21 | virtual Application_ptr parseApplication(xmlpp::Node *application) = 0; 22 | }; 23 | 24 | 25 | #endif //ADRICONF_PARSERINTERFACE_H 26 | -------------------------------------------------------------------------------- /adriconf/Utils/PCIDatabaseQuery.cpp: -------------------------------------------------------------------------------- 1 | #include "PCIDatabaseQuery.h" 2 | 3 | PCIDatabaseQuery::PCIDatabaseQuery() { 4 | this->pci = pci_alloc(); 5 | pci_init(this->pci); 6 | } 7 | 8 | PCIDatabaseQuery::~PCIDatabaseQuery() { 9 | pci_cleanup(this->pci); 10 | } 11 | 12 | Glib::ustring PCIDatabaseQuery::queryVendorName(uint16_t vendorId) { 13 | char buffer[1024], *lookepUpName; 14 | 15 | lookepUpName = pci_lookup_name(this->pci, buffer, sizeof(buffer), PCI_LOOKUP_VENDOR, vendorId); 16 | 17 | return Glib::ustring(lookepUpName); 18 | } 19 | 20 | Glib::ustring PCIDatabaseQuery::queryDeviceName(uint16_t vendorId, uint16_t deviceId) { 21 | char buffer[1024], *lookepUpName; 22 | 23 | lookepUpName = pci_lookup_name(this->pci, buffer, sizeof(buffer), PCI_LOOKUP_DEVICE, vendorId, deviceId); 24 | 25 | return Glib::ustring(lookepUpName); 26 | } 27 | -------------------------------------------------------------------------------- /adriconf/Logging/Logger.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Logger.h" 3 | 4 | Logger::Logger() : level(LoggerLevel::INFO) {} 5 | 6 | void Logger::debug(Glib::ustring msg) { 7 | if (this->level <= LoggerLevel::DEBUG) { 8 | std::cout << "DEBUG: " << msg << std::endl; 9 | } 10 | } 11 | 12 | void Logger::info(Glib::ustring msg) { 13 | if (this->level <= LoggerLevel::INFO) { 14 | std::cout << "INFO: " << msg << std::endl; 15 | } 16 | } 17 | 18 | void Logger::warning(Glib::ustring msg) { 19 | if (this->level <= LoggerLevel::WARNING) { 20 | std::cout << "WARNING: " << msg << std::endl; 21 | } 22 | } 23 | 24 | void Logger::error(Glib::ustring msg) { 25 | if (this->level <= LoggerLevel::ERROR) { 26 | std::cerr << "ERROR: " << msg << std::endl; 27 | } 28 | } 29 | 30 | void Logger::setLevel(LoggerLevel level) { 31 | Logger::level = level; 32 | } 33 | -------------------------------------------------------------------------------- /adriconf/Utils/EGLDisplayFactory.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_EGLDISPLAYFACTORY_H 2 | #define ADRICONF_EGLDISPLAYFACTORY_H 3 | 4 | #include "EGLDisplayFactoryInterface.h" 5 | #include "../Translation/TranslatorInterface.h" 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | class EGLDisplayFactory : public EGLDisplayFactoryInterface { 13 | private: 14 | std::function getPlatformDisplay; 15 | TranslatorInterface *translator; 16 | 17 | public: 18 | explicit EGLDisplayFactory(TranslatorInterface *translator); 19 | 20 | virtual ~EGLDisplayFactory() = default; 21 | 22 | std::shared_ptr createDisplayFromGBM(const GBMDevice &device) override; 23 | std::shared_ptr createDefaultDisplay() override; 24 | }; 25 | 26 | 27 | #endif //ADRICONF_EGLDISPLAYFACTORY_H 28 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | ## Doing a release 2 | 3 | To do a release follow those steps: 4 | 5 | 1. Update the [VERSION](VERSION) file with the newest number. 6 | 2. Update the flatpak release notes in the 7 | flatpak xml [file](flatpak/br.com.jeanhertel.adriconf.appdata.xml). 8 | 3. Update the flatpak json version [file](flatpak/br.com.jeanhertel.adriconf.json). 9 | 4. Do a Github release/tagging of the code. 10 | You can copy-paste the release notes you wrote in the flatpak file to Github. 11 | **Any code available on MASTER branch should be released.** 12 | 5. Now go to adriconf Flathub [repository][1] and update the release notes 13 | and json files to use the release you just made on Github. 14 | 6. Commit the changes and wait for Flathub bot to build the new version. 15 | 16 | After doing a release Flathub usually takes some hours to publish the version. 17 | 18 | [1]: https://github.com/flathub/br.com.jeanhertel.adriconf -------------------------------------------------------------------------------- /tests/DriverConfigurationTest.cpp: -------------------------------------------------------------------------------- 1 | #include "../adriconf/ValueObject/DriverConfiguration.h" 2 | #include "gtest/gtest.h" 3 | 4 | class DriverConfigurationTest : public ::testing::Test 5 | { 6 | public: 7 | std::shared_ptr testApp; 8 | 9 | DriverConfigurationTest() { 10 | testApp = std::make_shared(); 11 | } 12 | }; 13 | 14 | TEST_F (DriverConfigurationTest, defaultValuesTes) { 15 | int screenNumber = testApp->getScreen(); 16 | 17 | EXPECT_EQ(0, screenNumber); 18 | } 19 | 20 | TEST_F (DriverConfigurationTest, screenNumberTest) { 21 | testApp->setScreen(2); 22 | 23 | EXPECT_EQ(2, testApp->getScreen()); 24 | 25 | //duplicate case 26 | testApp->setScreen(2); 27 | EXPECT_EQ(2, testApp->getScreen()); 28 | 29 | //screen number change case 30 | testApp->setScreen(1); 31 | EXPECT_EQ(1, testApp->getScreen()); 32 | } 33 | -------------------------------------------------------------------------------- /adriconf/Utils/GBMDeviceFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "GBMDeviceFactory.h" 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | GBMDevice GBMDeviceFactory::generateDeviceFromPath(const char *path) { 8 | int fileDescriptor = open(path, O_RDWR | O_CLOEXEC); 9 | if (fileDescriptor <= 0) { 10 | throw std::runtime_error( 11 | Glib::ustring::compose(this->translator->trns("Failed to open device %1"), path) 12 | ); 13 | } 14 | 15 | struct gbm_device *gbm = gbm_create_device(fileDescriptor); 16 | if (gbm == nullptr) { 17 | throw std::runtime_error( 18 | Glib::ustring::compose(this->translator->trns("Failed to create GBM device for %1"), path) 19 | ); 20 | } 21 | 22 | GBMDevice device; 23 | device.setRawFileDescriptor(fileDescriptor); 24 | device.setRawGBMDevice(gbm); 25 | 26 | return device; 27 | } 28 | -------------------------------------------------------------------------------- /adriconf/ValueObject/Device.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_DEVICE_H 2 | #define DRICONF3_DEVICE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "Application.h" 8 | 9 | class Device { 10 | private: 11 | Glib::ustring driver; 12 | int screen; 13 | std::list applications; 14 | 15 | public: 16 | const Glib::ustring &getDriver() const; 17 | 18 | void setDriver(Glib::ustring driver); 19 | 20 | const int &getScreen() const; 21 | 22 | void setScreen(int screen); 23 | 24 | std::list &getApplications(); 25 | 26 | const std::list &getApplications() const; 27 | 28 | void addApplication(Application_ptr application); 29 | 30 | Application_ptr findApplication(const Glib::ustring &executable) const; 31 | 32 | void sortApplications(); 33 | 34 | Device(); 35 | }; 36 | 37 | typedef std::shared_ptr Device_ptr; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /adriconf/Utils/WaylandQuery.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_WAYLANDQUERY_H 2 | #define ADRICONF_WAYLANDQUERY_H 3 | 4 | #include "DisplayServerQueryInterface.h" 5 | #include "EGLDisplayFactoryInterface.h" 6 | #include "../Logging/LoggerInterface.h" 7 | #include "../Translation/TranslatorInterface.h" 8 | #include "ParserInterface.h" 9 | 10 | class WaylandQuery : public DisplayServerQueryInterface { 11 | private: 12 | LoggerInterface *logger; 13 | TranslatorInterface *translator; 14 | ParserInterface *parser; 15 | EGLDisplayFactoryInterface *eglDisplayFactory; 16 | 17 | public: 18 | WaylandQuery( 19 | LoggerInterface *logger, 20 | TranslatorInterface *translator, 21 | ParserInterface *parse, 22 | EGLDisplayFactoryInterface *eglDisplayFactory 23 | ); 24 | 25 | std::list queryDriverConfigurationOptions(const Glib::ustring &locale) override; 26 | 27 | bool checkNecessaryExtensions() override; 28 | }; 29 | 30 | #endif //ADRICONF_WAYLANDQUERY_H -------------------------------------------------------------------------------- /adriconf/Utils/XorgQuery.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_XORGQUERY_H 2 | #define ADRICONF_XORGQUERY_H 3 | 4 | #include "DisplayServerQueryInterface.h" 5 | #include "../Logging/LoggerInterface.h" 6 | #include "../Translation/TranslatorInterface.h" 7 | #include "ParserInterface.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | class XorgQuery : public DisplayServerQueryInterface { 14 | private: 15 | LoggerInterface *logger; 16 | TranslatorInterface *translator; 17 | ParserInterface *parser; 18 | 19 | std::function getScreenDriverName; 20 | std::function getDriverOptions; 21 | 22 | public: 23 | XorgQuery(LoggerInterface *logger, TranslatorInterface *translator, ParserInterface *parser); 24 | 25 | std::list queryDriverConfigurationOptions(const Glib::ustring &locale) override; 26 | 27 | bool checkNecessaryExtensions() override; 28 | }; 29 | 30 | 31 | #endif //ADRICONF_XORGQUERY_H 32 | -------------------------------------------------------------------------------- /adriconf/Utils/ConfigurationLoaderInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_CONFIGURATIONLOADERINTERFACE_H 2 | #define ADRICONF_CONFIGURATIONLOADERINTERFACE_H 3 | 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "../ValueObject/DriverConfiguration.h" 10 | #include "../ValueObject/Device.h" 11 | #include "../ValueObject/GPUInfo.h" 12 | #include "DRIQuery.h" 13 | 14 | class ConfigurationLoaderInterface { 15 | 16 | public: 17 | virtual std::list loadDriverSpecificConfiguration(const Glib::ustring &locale) = 0; 18 | 19 | virtual std::map loadAvailableGPUs(const Glib::ustring &locale) = 0; 20 | 21 | virtual std::list loadSystemWideConfiguration() = 0; 22 | 23 | virtual std::list loadUserDefinedConfiguration() = 0; 24 | 25 | virtual Glib::ustring getOldSystemWideConfigurationPath() = 0; 26 | 27 | virtual boost::filesystem::path getSystemWideConfigurationPath() = 0; 28 | 29 | virtual ~ConfigurationLoaderInterface() {} 30 | }; 31 | 32 | 33 | #endif //ADRICONF_CONFIGURATIONLOADERINTERFACE_H 34 | -------------------------------------------------------------------------------- /adriconf/Utils/Parser.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_PARSER_H 2 | #define DRICONF3_PARSER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "../ValueObject/Section.h" 10 | #include "../ValueObject/Device.h" 11 | #include "../Logging/LoggerInterface.h" 12 | #include "ParserInterface.h" 13 | #include "../Translation/TranslatorInterface.h" 14 | 15 | class Parser : public ParserInterface { 16 | private: 17 | LoggerInterface *logger; 18 | TranslatorInterface *translator; 19 | 20 | public: 21 | Parser(LoggerInterface *logger, TranslatorInterface *translator) : logger(logger), translator(translator) {} 22 | 23 | ~Parser() override = default; 24 | 25 | std::list
26 | parseAvailableConfiguration(const Glib::ustring &xml, const Glib::ustring ¤tLocale) override; 27 | 28 | DriverOption parseSectionOptions(xmlpp::Node *option, const Glib::ustring ¤tLocale) override; 29 | 30 | std::list parseDevices(Glib::ustring &xml) override; 31 | 32 | Application_ptr parseApplication(xmlpp::Node *application) override; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /adriconf/ValueObject/DRMDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "DRMDevice.h" 2 | 3 | #include 4 | 5 | DRMDevice::DRMDevice(drmDevicePtr rawDevice) : rawDevice(rawDevice) {} 6 | 7 | DRMDevice::~DRMDevice() { 8 | drmFreeDevice(&(this->rawDevice)); 9 | } 10 | 11 | Glib::ustring DRMDevice::getFormattedPCIId() { 12 | return Glib::ustring::compose( 13 | "pci-%1_%2_%3_%4", 14 | Glib::ustring::format(std::setfill(L'0'), std::setw(4), std::hex, 15 | this->rawDevice->businfo.pci->domain), 16 | Glib::ustring::format(std::setfill(L'0'), std::setw(2), std::hex, 17 | this->rawDevice->businfo.pci->bus), 18 | Glib::ustring::format(std::setfill(L'0'), std::setw(2), std::hex, 19 | this->rawDevice->businfo.pci->dev), 20 | this->rawDevice->businfo.pci->func 21 | ); 22 | } 23 | 24 | uint16_t DRMDevice::getVendorPCIId() { 25 | return this->rawDevice->deviceinfo.pci->vendor_id; 26 | } 27 | 28 | uint16_t DRMDevice::getDevicePCIId() { 29 | return this->rawDevice->deviceinfo.pci->device_id; 30 | } 31 | 32 | const char *DRMDevice::getDeviceRenderNodeName() { 33 | return this->rawDevice->nodes[DRM_NODE_RENDER]; 34 | } 35 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | agent any 3 | stages { 4 | stage('Build') { 5 | steps { 6 | echo 'Running build stage' 7 | sh 'mkdir build-dir' 8 | dir('build-dir'){ 9 | sh 'cmake ..' 10 | sh 'cmake --build . --target adriconf' 11 | sh 'cmake --build . --target runUnitTests' 12 | sh 'make translations' 13 | } 14 | } 15 | } 16 | stage('Test') { 17 | steps { 18 | echo 'Running test stage' 19 | dir('build-dir/tests') { 20 | sh './runUnitTests --gtest_output=xml:gtestresults.xml' 21 | sh 'awk \'{ if ($1 == ""; else print $0;}\' gtestresults.xml > gtestresults-skipped.xml' 22 | sh 'mv gtestresults.xml gtestresults.off' 23 | } 24 | } 25 | } 26 | } 27 | post { 28 | always { 29 | archiveArtifacts 'build-dir/adriconf/adriconf,build-dir/tests/runUnitTests' 30 | junit 'build-dir/tests/gtestresults-skipped.xml' 31 | deleteDir() 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /adriconf/ValueObject/EGLDisplayWrapper.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_EGLDISPLAYWRAPPER_H 2 | #define ADRICONF_EGLDISPLAYWRAPPER_H 3 | 4 | #include "EGLDisplayInterface.h" 5 | #include "../Translation/TranslatorInterface.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | class EGLDisplayWrapper : public EGLDisplayInterface { 12 | private: 13 | EGLDisplay rawDisplay; 14 | EGLint minorVersion; 15 | EGLint majorVersion; 16 | Glib::ustring extensions; 17 | std::function queryDriverName; 18 | std::function queryDriverOptions; 19 | TranslatorInterface *translator; 20 | 21 | bool hasMesaQueryDriverExtension() const; 22 | 23 | public: 24 | explicit EGLDisplayWrapper(TranslatorInterface *translator); 25 | 26 | virtual ~EGLDisplayWrapper(); 27 | 28 | void setRawDisplay(EGLDisplay rawDisplay); 29 | 30 | void setMinorVersion(EGLint minorVersion); 31 | 32 | void setMajorVersion(EGLint majorVersion); 33 | 34 | void setExtensions(const Glib::ustring &extensions); 35 | 36 | Glib::ustring getExtensions() const override; 37 | 38 | const char *getDriverName() override; 39 | 40 | const char *getDriverOptions() override; 41 | }; 42 | 43 | #endif //ADRICONF_EGLDISPLAYWRAPPER_H -------------------------------------------------------------------------------- /adriconf/ValueObject/Device.cpp: -------------------------------------------------------------------------------- 1 | #include "Device.h" 2 | 3 | #include 4 | 5 | const Glib::ustring &Device::getDriver() const { 6 | return this->driver; 7 | } 8 | 9 | void Device::setDriver(Glib::ustring driver) { 10 | this->driver = std::move(driver); 11 | } 12 | 13 | const int &Device::getScreen() const { 14 | return this->screen; 15 | } 16 | 17 | void Device::setScreen(int screen) { 18 | this->screen = screen; 19 | } 20 | 21 | std::list &Device::getApplications() { 22 | return this->applications; 23 | } 24 | 25 | const std::list &Device::getApplications() const { 26 | return this->applications; 27 | } 28 | 29 | void Device::addApplication(Application_ptr application) { 30 | this->applications.emplace_back(application); 31 | } 32 | 33 | Device::Device() : driver(""), screen(-1), applications() {} 34 | 35 | Application_ptr Device::findApplication(const Glib::ustring &executable) const { 36 | for (auto app : this->applications) { 37 | if (app->getExecutable() == executable) { 38 | return app; 39 | } 40 | } 41 | 42 | return nullptr; 43 | } 44 | 45 | void Device::sortApplications() { 46 | this->applications.sort([](Application_ptr a, Application_ptr b) { 47 | return a->getName() < b->getName(); 48 | }); 49 | } -------------------------------------------------------------------------------- /tests/ApplicationOptionTest.cpp: -------------------------------------------------------------------------------- 1 | #include "../adriconf/ValueObject/ApplicationOption.h" 2 | #include "gtest/gtest.h" 3 | 4 | class ApplicationOptionTest : public ::testing::Test 5 | { 6 | public: 7 | ApplicationOption_ptr testApp; 8 | 9 | ApplicationOptionTest() { 10 | testApp = std::make_shared(); 11 | } 12 | }; 13 | 14 | TEST_F (ApplicationOptionTest, defaultValuesTest) { 15 | Glib::ustring name = testApp->getName(); 16 | Glib::ustring value = testApp->getValue(); 17 | 18 | EXPECT_EQ("", name); 19 | EXPECT_EQ("", value); 20 | } 21 | 22 | TEST_F (ApplicationOptionTest, nameTest) { 23 | testApp->setName("tcl_mode"); 24 | 25 | EXPECT_EQ("tcl_mode", testApp->getName()); 26 | 27 | //duplicate case 28 | testApp->setName("tcl_mode"); 29 | EXPECT_EQ("tcl_mode", testApp->getName()); 30 | 31 | //name change case 32 | testApp->setName("vblank-mode"); 33 | EXPECT_EQ("vblank-mode", testApp->getName()); 34 | } 35 | 36 | TEST_F (ApplicationOptionTest, valueTest) { 37 | testApp->setValue("0"); 38 | 39 | EXPECT_EQ("0", testApp->getValue()); 40 | 41 | //duplicate case 42 | testApp->setValue("0"); 43 | EXPECT_EQ("0", testApp->getValue()); 44 | 45 | //value change case 46 | testApp->setValue("3"); 47 | EXPECT_EQ("3", testApp->getValue()); 48 | } 49 | -------------------------------------------------------------------------------- /adriconf/ValueObject/Application.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_APPLICATION_H 2 | #define DRICONF3_APPLICATION_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "ApplicationOption.h" 8 | #include 9 | 10 | class Application { 11 | private: 12 | Glib::ustring name; 13 | Glib::ustring executable; 14 | std::list options; 15 | bool isUsingPrime; 16 | Glib::ustring primeDriverName; 17 | Glib::ustring devicePCIId; 18 | 19 | public: 20 | const Glib::ustring &getName() const; 21 | 22 | void setName(Glib::ustring name); 23 | 24 | const Glib::ustring &getExecutable() const; 25 | 26 | void setExecutable(Glib::ustring executable); 27 | 28 | std::list &getOptions(); 29 | 30 | std::map getOptionsAsMap(); 31 | 32 | void addOption(ApplicationOption_ptr option); 33 | 34 | void setOptions(std::list); 35 | 36 | bool getIsUsingPrime() const; 37 | 38 | void setIsUsingPrime(bool isUsingPrime); 39 | 40 | const Glib::ustring &getPrimeDriverName() const; 41 | 42 | void setPrimeDriverName(const Glib::ustring &primeDriverName); 43 | 44 | const Glib::ustring &getDevicePCIId() const; 45 | 46 | void setDevicePCIId(const Glib::ustring &devicePCIId); 47 | }; 48 | 49 | typedef std::shared_ptr Application_ptr; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /adriconf/ValueObject/DriverOption.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_OPTION_H 2 | #define DRICONF3_OPTION_H 3 | 4 | #include "DriverOptionType.h" 5 | #include 6 | #include 7 | 8 | class DriverOption { 9 | private: 10 | Glib::ustring name; 11 | Glib::ustring description; 12 | DriverOptionType type; 13 | Glib::ustring defaultValue; 14 | Glib::ustring validValues; 15 | std::list> enumValues; 16 | 17 | public: 18 | const Glib::ustring &getName() const; 19 | 20 | const Glib::ustring &getDescription() const; 21 | 22 | const DriverOptionType &getType() const; 23 | 24 | const Glib::ustring &getDefaultValue() const; 25 | 26 | const Glib::ustring &getValidValues() const; 27 | 28 | int getValidValueStart() const; 29 | 30 | int getValidValueEnd() const; 31 | 32 | int getSortValue() const; 33 | 34 | void updateFakeBool(); 35 | 36 | DriverOptionType stringToEnum(const Glib::ustring &type) const; 37 | 38 | std::list> getEnumValues() const; 39 | 40 | DriverOption *setName(Glib::ustring name); 41 | 42 | DriverOption *setDescription(Glib::ustring description); 43 | 44 | DriverOption *setType(DriverOptionType type); 45 | 46 | DriverOption *setDefaultValue(Glib::ustring defaultValue); 47 | 48 | DriverOption *setValidValues(Glib::ustring validValues); 49 | 50 | DriverOption *addEnumValue(Glib::ustring description, Glib::ustring value); 51 | }; 52 | 53 | #endif //DRICONF3_OPTION_H 54 | -------------------------------------------------------------------------------- /adriconf/Utils/DRIQuery.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_DRIQUERY_H 2 | #define DRICONF3_DRIQUERY_H 3 | 4 | #include "../ValueObject/DriverConfiguration.h" 5 | #include "Parser.h" 6 | #include "../ValueObject/GPUInfo.h" 7 | #include "../Logging/LoggerInterface.h" 8 | #include "PCIDatabaseQueryInterface.h" 9 | #include "GBMDeviceFactoryInterface.h" 10 | #include "EGLDisplayFactoryInterface.h" 11 | #include "DRMDeviceFactoryInterface.h" 12 | 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | typedef const char *glXGetScreenDriver_t(Display *dpy, int scrNum); 19 | 20 | typedef const char *glXGetDriverConfig_t(const char *driverName); 21 | 22 | typedef const char *glXQueryExtensionsString_t(Display *dpy, int screen); 23 | 24 | class DRIQuery { 25 | private: 26 | LoggerInterface *logger; 27 | TranslatorInterface *translator; 28 | ParserInterface *parser; 29 | PCIDatabaseQueryInterface *pciQuery; 30 | DRMDeviceFactoryInterface *drmDeviceFactory; 31 | GBMDeviceFactoryInterface *gbmDeviceFactory; 32 | EGLDisplayFactoryInterface *eglDisplayFactory; 33 | public: 34 | DRIQuery( 35 | LoggerInterface *logger, 36 | TranslatorInterface *translator, 37 | ParserInterface *parser, 38 | PCIDatabaseQueryInterface *pciQuery, 39 | DRMDeviceFactoryInterface *drmDeviceFactory, 40 | GBMDeviceFactoryInterface *gbmUtils, 41 | EGLDisplayFactoryInterface *eglWrapper 42 | ); 43 | 44 | std::map enumerateDRIDevices(const Glib::ustring &locale); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /adriconf/ValueObject/GPUInfo.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_GPUINFO_H 2 | #define ADRICONF_GPUINFO_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "Section.h" 9 | #include "Application.h" 10 | 11 | class GPUInfo { 12 | private: 13 | Glib::ustring pciId; 14 | Glib::ustring driverName; 15 | Glib::ustring deviceName; 16 | Glib::ustring vendorName; 17 | uint16_t vendorId; 18 | uint16_t deviceId; 19 | std::list
sections; 20 | 21 | public: 22 | const Glib::ustring &getPciId() const; 23 | 24 | void setPciId(const Glib::ustring &pciId); 25 | 26 | const Glib::ustring &getDriverName() const; 27 | 28 | void setDriverName(const Glib::ustring &driverName); 29 | 30 | const Glib::ustring &getDeviceName() const; 31 | 32 | void setDeviceName(const Glib::ustring &deviceName); 33 | 34 | const Glib::ustring &getVendorName() const; 35 | 36 | void setVendorName(const Glib::ustring &vendorName); 37 | 38 | uint16_t getVendorId() const; 39 | 40 | void setVendorId(uint16_t vendorId); 41 | 42 | uint16_t getDeviceId() const; 43 | 44 | void setDeviceId(uint16_t deviceId); 45 | 46 | bool operator==(const GPUInfo &rhs); 47 | 48 | const std::list
&getSections() const; 49 | 50 | void setSections(const std::list
§ions); 51 | 52 | std::map getOptionsMap() const; 53 | 54 | /* Sort the options inside each section to be more user-friendly */ 55 | void sortSectionOptions(); 56 | 57 | /* Generate a new application based on this driver-supported options */ 58 | Application_ptr generateApplication() const; 59 | }; 60 | 61 | typedef std::shared_ptr GPUInfo_ptr; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /adriconf/Utils/Writer.cpp: -------------------------------------------------------------------------------- 1 | #include "Writer.h" 2 | #include 3 | 4 | Glib::ustring Writer::generateRawXml(const std::list &devices) { 5 | Glib::ustring output("\n"); 6 | 7 | for (const auto &device : devices) { 8 | output.append(" getScreen())); 10 | output.append("\" driver=\""); 11 | output.append(device->getDriver()); 12 | output.append("\">\n"); 13 | 14 | for (const auto &app : device->getApplications()) { 15 | output.append(" getName().empty()) { 17 | output.append(" name=\""); 18 | /* TODO: Check if we need to make a special escaping here */ 19 | output.append(app->getName()); 20 | output.append("\""); 21 | } 22 | 23 | if (!app->getExecutable().empty()) { 24 | /* TODO: Check if we need to scape this too. */ 25 | output.append(" executable=\""); 26 | output.append(app->getExecutable()); 27 | output.append("\""); 28 | } 29 | 30 | output.append(">\n"); 31 | 32 | for (const auto &option : app->getOptions()) { 33 | output.append(" \n"); 44 | } 45 | 46 | output.append(""); 47 | 48 | return output; 49 | } -------------------------------------------------------------------------------- /adriconf/ValueObject/Application.cpp: -------------------------------------------------------------------------------- 1 | #include "Application.h" 2 | 3 | const Glib::ustring &Application::getName() const { 4 | return name; 5 | } 6 | 7 | void Application::setName(Glib::ustring name) { 8 | this->name = std::move(name); 9 | } 10 | 11 | const Glib::ustring &Application::getExecutable() const { 12 | return executable; 13 | } 14 | 15 | void Application::setExecutable(Glib::ustring executable) { 16 | this->executable = std::move(executable); 17 | } 18 | 19 | std::list &Application::getOptions() { 20 | return this->options; 21 | } 22 | 23 | void Application::addOption(ApplicationOption_ptr option) { 24 | this->options.emplace_back(option); 25 | } 26 | 27 | void Application::setOptions(std::list options) { 28 | this->options = std::move(options); 29 | } 30 | 31 | bool Application::getIsUsingPrime() const { 32 | return isUsingPrime; 33 | } 34 | 35 | void Application::setIsUsingPrime(bool isUsingPrime) { 36 | Application::isUsingPrime = isUsingPrime; 37 | } 38 | 39 | const Glib::ustring &Application::getPrimeDriverName() const { 40 | return primeDriverName; 41 | } 42 | 43 | void Application::setPrimeDriverName(const Glib::ustring &primeDriverName) { 44 | Application::primeDriverName = primeDriverName; 45 | } 46 | 47 | const Glib::ustring &Application::getDevicePCIId() const { 48 | return devicePCIId; 49 | } 50 | 51 | void Application::setDevicePCIId(const Glib::ustring &devicePCIId) { 52 | Application::devicePCIId = devicePCIId; 53 | } 54 | 55 | std::map Application::getOptionsAsMap() { 56 | std::map optionMap; 57 | 58 | for(auto & option : this->options) { 59 | optionMap[option->getName()] = option->getValue(); 60 | } 61 | 62 | return optionMap; 63 | } 64 | -------------------------------------------------------------------------------- /adriconf/Utils/ConfigurationLoader.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_CONFIGURATIONLOADER_H 2 | #define ADRICONF_CONFIGURATIONLOADER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "../ValueObject/DriverConfiguration.h" 10 | #include "../ValueObject/Device.h" 11 | #include "../ValueObject/GPUInfo.h" 12 | #include "DRIQuery.h" 13 | #include "ConfigurationLoaderInterface.h" 14 | #include "ConfigurationResolverInterface.h" 15 | #include "DisplayServerQueryInterface.h" 16 | 17 | class ConfigurationLoader : public ConfigurationLoaderInterface { 18 | private: 19 | Glib::ustring readSystemWideXML(); 20 | 21 | Glib::ustring readUserDefinedXML(); 22 | 23 | DRIQuery driQuery; 24 | DisplayServerQueryInterface *displayQuery; 25 | LoggerInterface *logger; 26 | TranslatorInterface *translator; 27 | ParserInterface *parser; 28 | ConfigurationResolverInterface *resolver; 29 | 30 | public: 31 | std::list loadDriverSpecificConfiguration(const Glib::ustring &locale) override; 32 | 33 | std::list loadSystemWideConfiguration() override; 34 | 35 | std::list loadUserDefinedConfiguration() override; 36 | 37 | std::map loadAvailableGPUs(const Glib::ustring &locale) override; 38 | 39 | Glib::ustring getOldSystemWideConfigurationPath() override; 40 | 41 | boost::filesystem::path getSystemWideConfigurationPath() override; 42 | 43 | ConfigurationLoader( 44 | const DRIQuery &driQuery, 45 | DisplayServerQueryInterface *displayQuery, 46 | LoggerInterface *logger, 47 | TranslatorInterface *translator, 48 | ParserInterface *parser, 49 | ConfigurationResolverInterface *resolver 50 | ); 51 | 52 | virtual ~ConfigurationLoader() {}; 53 | }; 54 | 55 | #endif -------------------------------------------------------------------------------- /adriconf/ValueObject/EGLDisplayWrapper.cpp: -------------------------------------------------------------------------------- 1 | #include "EGLDisplayWrapper.h" 2 | #include 3 | 4 | EGLDisplayWrapper::EGLDisplayWrapper(TranslatorInterface *translator) 5 | : rawDisplay(), minorVersion(0), majorVersion(0), extensions(), translator(translator) { 6 | this->queryDriverName = (const char *(*)(EGLDisplay)) eglGetProcAddress("eglGetDisplayDriverName"); 7 | this->queryDriverOptions = (const char *(*)(EGLDisplay)) eglGetProcAddress("eglGetDisplayDriverConfig"); 8 | } 9 | 10 | EGLDisplayWrapper::~EGLDisplayWrapper() { 11 | eglTerminate(this->rawDisplay); 12 | } 13 | 14 | void EGLDisplayWrapper::setRawDisplay(EGLDisplay display) { 15 | this->rawDisplay = display; 16 | } 17 | 18 | void EGLDisplayWrapper::setMinorVersion(EGLint minor) { 19 | this->minorVersion = minor; 20 | } 21 | 22 | void EGLDisplayWrapper::setMajorVersion(EGLint major) { 23 | this->majorVersion = major; 24 | } 25 | 26 | void EGLDisplayWrapper::setExtensions(const Glib::ustring &exts) { 27 | this->extensions = exts; 28 | } 29 | 30 | bool EGLDisplayWrapper::hasMesaQueryDriverExtension() const { 31 | std::size_t found = this->extensions.find("EGL_MESA_query_driver"); 32 | return found != std::string::npos; 33 | } 34 | 35 | const char *EGLDisplayWrapper::getDriverName() { 36 | if (!this->hasMesaQueryDriverExtension()) { 37 | throw std::runtime_error(this->translator->trns("Display is missing EGL_MESA_query_driver extension")); 38 | } 39 | 40 | return this->queryDriverName(this->rawDisplay); 41 | } 42 | 43 | const char *EGLDisplayWrapper::getDriverOptions() { 44 | if (!this->hasMesaQueryDriverExtension()) { 45 | throw std::runtime_error(this->translator->trns("Display is missing EGL_MESA_query_driver extension")); 46 | } 47 | 48 | return this->queryDriverOptions(this->rawDisplay); 49 | } 50 | 51 | Glib::ustring EGLDisplayWrapper::getExtensions() const { 52 | return this->extensions; 53 | } 54 | 55 | -------------------------------------------------------------------------------- /adriconf/Utils/ConfigurationResolverInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_CONFIGURATIONRESOLVERINTERFACE_H 2 | #define ADRICONF_CONFIGURATIONRESOLVERINTERFACE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "../ValueObject/Device.h" 9 | #include "../ValueObject/DriverConfiguration.h" 10 | 11 | class ConfigurationResolverInterface { 12 | public: 13 | virtual ~ConfigurationResolverInterface() = default; 14 | 15 | virtual std::list resolveOptionsForSave( 16 | const std::list &, 17 | const std::list &, 18 | const std::list &, 19 | std::map & 20 | ) = 0; 21 | 22 | virtual void filterDriverUnsupportedOptions( 23 | const std::list &, 24 | std::list &, 25 | std::map & 26 | ) = 0; 27 | 28 | virtual void mergeOptionsForDisplay( 29 | const std::list &, 30 | const std::list &, 31 | std::list &, 32 | std::map & 33 | ) = 0; 34 | 35 | virtual void updatePrimeApplications(std::list &, const std::map &) = 0; 36 | 37 | virtual void addMissingDriverOptions(Application_ptr app, std::map driverOptions) = 0; 38 | 39 | virtual void addMissingApplications(const Device_ptr &sourceDevice, Device_ptr &targetDevice) = 0; 40 | 41 | virtual void removeInvalidDrivers(const std::list &availableDrivers, 42 | std::list &userDefinedDevices) = 0; 43 | 44 | virtual void mergeConfigurationOnTopOf(std::list &source, const std::list &addOnTop) = 0; 45 | }; 46 | 47 | 48 | #endif //ADRICONF_CONFIGURATIONRESOLVERINTERFACE_H -------------------------------------------------------------------------------- /adriconf/Utils/WaylandQuery.cpp: -------------------------------------------------------------------------------- 1 | #include "WaylandQuery.h" 2 | 3 | WaylandQuery::WaylandQuery( 4 | LoggerInterface *logger, 5 | TranslatorInterface *translator, 6 | ParserInterface *parser, 7 | EGLDisplayFactoryInterface *eglDisplayFactory 8 | ) : logger(logger), translator(translator), parser(parser), eglDisplayFactory(eglDisplayFactory) {} 9 | 10 | std::list WaylandQuery::queryDriverConfigurationOptions(const Glib::ustring &locale) { 11 | std::list configs; 12 | 13 | // Wayland doesn't has the concept of screens, so we have a single configuration object 14 | DriverConfiguration config; 15 | config.setScreen(0); 16 | 17 | auto display = this->eglDisplayFactory->createDefaultDisplay(); 18 | 19 | config.setDriverName(display->getDriverName()); 20 | const char *driverOptions = display->getDriverOptions(); 21 | if (driverOptions == nullptr) { 22 | this->logger->error( 23 | Glib::ustring::compose( 24 | this->translator->trns("Unable to extract configuration for driver %1"), 25 | config.getDriverName() 26 | ) 27 | ); 28 | 29 | return configs; 30 | } 31 | 32 | Glib::ustring options(driverOptions); 33 | if (options.empty()) { 34 | this->logger->error( 35 | Glib::ustring::compose( 36 | this->translator->trns("Unable to extract configuration for driver %1"), 37 | config.getDriverName() 38 | ) 39 | ); 40 | 41 | return configs; 42 | } 43 | 44 | auto parsedSections = this->parser->parseAvailableConfiguration(options, locale); 45 | config.setSections(parsedSections); 46 | configs.emplace_back(config); 47 | 48 | return configs; 49 | } 50 | 51 | bool WaylandQuery::checkNecessaryExtensions() { 52 | auto display = this->eglDisplayFactory->createDefaultDisplay(); 53 | 54 | auto extensions = display->getExtensions(); 55 | if (extensions.find("EGL_MESA_query_driver") == std::string::npos) { 56 | this->logger->error( 57 | this->translator->trns("Driver doesn't support extension \"EGL_MESA_query_driver\"") 58 | ); 59 | } 60 | 61 | return true; 62 | } 63 | -------------------------------------------------------------------------------- /adriconf/Utils/EGLDisplayFactory.cpp: -------------------------------------------------------------------------------- 1 | #include "EGLDisplayFactory.h" 2 | #include "../ValueObject/EGLDisplayWrapper.h" 3 | #include 4 | #include 5 | 6 | EGLDisplayFactory::EGLDisplayFactory(TranslatorInterface *translator) : translator(translator) { 7 | this->getPlatformDisplay = (EGLDisplay (*)(EGLenum, void *, const EGLint *)) eglGetProcAddress( 8 | "eglGetPlatformDisplayEXT"); 9 | } 10 | 11 | std::shared_ptr EGLDisplayFactory::createDisplayFromGBM(const GBMDevice &device) { 12 | EGLDisplay display = this->getPlatformDisplay(EGL_PLATFORM_GBM_MESA, device.getRawGBMDevice(), nullptr); 13 | if (display == EGL_NO_DISPLAY) { 14 | throw std::runtime_error(this->translator->trns("Failed to create EGL display")); 15 | } 16 | 17 | EGLint major = 0, minor = 0; 18 | EGLBoolean initialized = eglInitialize(display, &major, &minor); 19 | if (initialized == EGL_FALSE) { 20 | throw std::runtime_error(this->translator->trns("Failed to initialize EGL display")); 21 | } 22 | 23 | const char *extensions = eglQueryString(display, EGL_EXTENSIONS); 24 | std::string extStr(extensions); 25 | 26 | auto wrapper = std::make_shared(this->translator); 27 | wrapper->setRawDisplay(display); 28 | wrapper->setMajorVersion(major); 29 | wrapper->setMinorVersion(minor); 30 | wrapper->setExtensions(extStr); 31 | 32 | return wrapper; 33 | } 34 | 35 | std::shared_ptr EGLDisplayFactory::createDefaultDisplay() { 36 | EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); 37 | if (display == EGL_NO_DISPLAY) { 38 | throw std::runtime_error(this->translator->trns("Failed to create EGL display")); 39 | } 40 | 41 | EGLint major = 0, minor = 0; 42 | EGLBoolean initialized = eglInitialize(display, &major, &minor); 43 | if (initialized == EGL_FALSE) { 44 | throw std::runtime_error(this->translator->trns("Failed to initialize EGL display")); 45 | } 46 | 47 | const char *extensions = eglQueryString(display, EGL_EXTENSIONS); 48 | std::string extStr(extensions); 49 | 50 | auto wrapper = std::make_shared(this->translator); 51 | wrapper->setRawDisplay(display); 52 | wrapper->setMajorVersion(major); 53 | wrapper->setMinorVersion(minor); 54 | wrapper->setExtensions(extStr); 55 | 56 | return wrapper; 57 | } 58 | -------------------------------------------------------------------------------- /tests/SectionTest.cpp: -------------------------------------------------------------------------------- 1 | #include "../adriconf/ValueObject/Section.h" 2 | #include "gtest/gtest.h" 3 | 4 | class SectionTest : public ::testing::Test 5 | { 6 | public: 7 | Section *testApp; 8 | 9 | SectionTest() { 10 | testApp = new Section(); 11 | } 12 | }; 13 | 14 | TEST_F (SectionTest, defaultsTest) { 15 | EXPECT_EQ(0, testApp->getOptions().size()); 16 | EXPECT_EQ("", testApp->getDescription()); 17 | } 18 | 19 | TEST_F (SectionTest, descriptionTest) { 20 | testApp->setDescription("Awesome driver!"); 21 | EXPECT_EQ("Awesome driver!", testApp->getDescription()); 22 | 23 | //duplicate case 24 | testApp->setDescription("Awesome driver!"); 25 | EXPECT_EQ("Awesome driver!", testApp->getDescription()); 26 | 27 | //change case 28 | testApp->setDescription("Super driver"); 29 | EXPECT_EQ("Super driver", testApp->getDescription()); 30 | } 31 | 32 | TEST_F (SectionTest, optionTest) { 33 | DriverOption option0; 34 | option0.setName("opt0"); 35 | testApp = testApp->addOption(option0); 36 | 37 | EXPECT_EQ("opt0", testApp->getOptions().front().getName()); 38 | 39 | DriverOption option1; 40 | option1.setName("opt1"); 41 | testApp = testApp->addOption(option1); 42 | 43 | EXPECT_EQ("opt0", testApp->getOptions().front().getName()); 44 | EXPECT_EQ("opt1", testApp->getOptions().back().getName()); 45 | } 46 | 47 | TEST_F (SectionTest, sortDriverOptionsTest) { 48 | DriverOption option0; 49 | option0.setType(DriverOptionType::ENUM); //2 50 | testApp = testApp->addOption(option0); 51 | 52 | DriverOption option1; 53 | option1.setName("opt1"); //4 54 | testApp = testApp->addOption(option1); 55 | 56 | DriverOption option2; 57 | option2.setType(DriverOptionType::BOOL); //1 58 | testApp = testApp->addOption(option2); 59 | 60 | DriverOption option3; 61 | option3.setType(DriverOptionType::INT); //3 62 | testApp = testApp->addOption(option3); 63 | 64 | testApp->sortOptions(); 65 | 66 | std::list options = testApp->getOptions(); 67 | EXPECT_EQ(DriverOptionType::BOOL, options.front().getType()); 68 | options.pop_front(); 69 | EXPECT_EQ(DriverOptionType::ENUM, options.front().getType()); 70 | options.pop_front(); 71 | EXPECT_EQ(DriverOptionType::INT, options.front().getType()); 72 | options.pop_front(); 73 | EXPECT_EQ("opt1", options.front().getName()); 74 | options.pop_front(); 75 | } 76 | -------------------------------------------------------------------------------- /adriconf/GUI.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRICONF_GUI_H 2 | #define ADRICONF_GUI_H 3 | 4 | #include 5 | #include 6 | #include "ValueObject/Device.h" 7 | #include "ValueObject/DriverConfiguration.h" 8 | #include "Utils/ConfigurationLoaderInterface.h" 9 | #include "ValueObject/ComboBoxColumn.h" 10 | #include "Utils/ConfigurationResolverInterface.h" 11 | #include "Utils/WriterInterface.h" 12 | 13 | class GUI { 14 | private: 15 | LoggerInterface *logger; 16 | TranslatorInterface *translator; 17 | ConfigurationLoaderInterface *configurationLoader; 18 | ConfigurationResolverInterface *resolver; 19 | WriterInterface *writer; 20 | 21 | /* GUI-Related */ 22 | Gtk::Window *pWindow; 23 | Gtk::AboutDialog aboutDialog; 24 | Gtk::MenuItem *pMenuAddApplication; 25 | Gtk::MenuItem *pMenuRemoveApplication; 26 | ComboBoxColumn comboColumns; 27 | 28 | /* State-related */ 29 | std::list systemWideConfiguration; 30 | std::list driverConfiguration; 31 | std::list userDefinedConfiguration; 32 | std::map availableGPUs; 33 | bool isPrimeSetup; 34 | Application_ptr currentApp; 35 | DriverConfiguration *currentDriver; 36 | std::map currentComboBoxes; 37 | std::map currentSpinButtons; 38 | 39 | /* Helpers */ 40 | Glib::RefPtr gladeBuilder; 41 | Glib::ustring locale; 42 | 43 | void setupLocale(); 44 | 45 | void drawApplicationSelectionMenu(); 46 | 47 | void drawApplicationOptions(); 48 | 49 | void setupAboutDialog(); 50 | 51 | public: 52 | GUI( 53 | LoggerInterface *logger, 54 | TranslatorInterface *translator, 55 | ConfigurationLoaderInterface *configurationLoader, 56 | ConfigurationResolverInterface *resolver, 57 | WriterInterface *writer 58 | ); 59 | 60 | virtual ~GUI(); 61 | 62 | Gtk::Window *getWindowPointer(); 63 | 64 | /* Signal Handlers */ 65 | void onQuitPressed(); 66 | 67 | void onSavePressed(); 68 | 69 | void onApplicationSelected(const Glib::ustring &, const Glib::ustring &); 70 | 71 | void onCheckboxChanged(Glib::ustring); 72 | 73 | void onFakeCheckBoxChanged(Glib::ustring); 74 | 75 | void onComboboxChanged(Glib::ustring); 76 | 77 | void onNumberEntryChanged(Glib::ustring); 78 | 79 | void onRemoveApplicationPressed(); 80 | 81 | void onAddApplicationPressed(); 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Check if we are running from inside main config 2 | if (NOT TOP_CMAKE_WAS_CALLED) 3 | message(FATAL_ERROR " 4 | You did not 'cmake' the top CMakeLists.txt file. Use the one in the top dir. 5 | It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") 6 | endif () 7 | 8 | set(SOURCE_TESTS 9 | ${CMAKE_SOURCE_DIR}/tests/ConfigurationResolverTest.cpp 10 | ${CMAKE_SOURCE_DIR}/tests/DeviceTest.cpp 11 | ${CMAKE_SOURCE_DIR}/tests/ApplicationTest.cpp 12 | ${CMAKE_SOURCE_DIR}/tests/ApplicationOptionTest.cpp 13 | ${CMAKE_SOURCE_DIR}/tests/DriverConfigurationTest.cpp 14 | ${CMAKE_SOURCE_DIR}/tests/DriverOptionTest.cpp 15 | ${CMAKE_SOURCE_DIR}/tests/SectionTest.cpp 16 | ${CMAKE_SOURCE_DIR}/tests/GPUInfoTest.cpp 17 | 18 | ${CMAKE_SOURCE_DIR}/tests/Logging/LoggerMock.h 19 | ${CMAKE_SOURCE_DIR}/tests/Utils/ParserMock.h 20 | ${CMAKE_SOURCE_DIR}/tests/Translation/TranslatorMock.h 21 | ) 22 | 23 | enable_testing() 24 | 25 | add_executable(runUnitTests EXCLUDE_FROM_ALL ${SHARED_SOURCE_FILES} ${SOURCE_TESTS}) 26 | target_link_libraries(runUnitTests gtest_main gmock) 27 | 28 | target_link_libraries(runUnitTests ${GTKMM_LIBRARIES}) 29 | target_include_directories(runUnitTests PUBLIC ${GTKMM_INCLUDE_DIRS}) 30 | 31 | target_link_libraries(runUnitTests ${Boost_LOCALE_LIBRARIES}) 32 | target_link_libraries(runUnitTests ${Boost_FILESYSTEM_LIBRARIES}) 33 | target_link_libraries(runUnitTests ${Boost_SYSTEM_LIBRARIES}) 34 | target_include_directories(runUnitTests PUBLIC ${Boost_INCLUDE_DIRS}) 35 | 36 | target_link_libraries(runUnitTests ${LibXML++_LIBRARIES}) 37 | target_include_directories(runUnitTests PUBLIC ${LibXML++_INCLUDE_DIRS}) 38 | 39 | target_link_libraries(runUnitTests ${X11_LIBRARIES}) 40 | target_include_directories(runUnitTests PUBLIC ${X11_INCLUDE_DIRS}) 41 | 42 | target_link_libraries(runUnitTests ${DRM_LIBRARIES}) 43 | target_include_directories(runUnitTests PUBLIC ${DRM_INCLUDE_DIRS}) 44 | 45 | target_link_libraries(runUnitTests ${GBM_LIBRARIES}) 46 | target_include_directories(runUnitTests PUBLIC ${GBM_INCLUDE_DIRS}) 47 | 48 | target_link_libraries(runUnitTests ${PCILIB_LIBRARIES}) 49 | target_include_directories(runUnitTests PUBLIC ${PCILIB_INCLUDE_DIRS}) 50 | 51 | target_link_libraries(runUnitTests ${OPENGL_gl_LIBRARY}) 52 | if (OpenGL_GLX_FOUND) 53 | target_link_libraries(runUnitTests ${OPENGL_glx_LIBRARY}) 54 | endif () 55 | 56 | target_link_libraries(runUnitTests ${EGL_LIBRARIES}) 57 | target_include_directories(runUnitTests PUBLIC ${EGL_INCLUDE_DIRS}) 58 | 59 | target_compile_options(runUnitTests PRIVATE -Wall -Wextra -pedantic) -------------------------------------------------------------------------------- /adriconf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Check if we are running from inside main config 2 | if (NOT TOP_CMAKE_WAS_CALLED) 3 | message(FATAL_ERROR " 4 | You did not 'cmake' the top CMakeLists.txt file. Use the one in the top dir. 5 | It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") 6 | endif () 7 | 8 | # Define the executable itself 9 | add_executable(adriconf 10 | ${CMAKE_SOURCE_DIR}/adriconf/main.cpp 11 | ${SHARED_SOURCE_FILES} 12 | ${CMAKE_SOURCE_DIR}/adriconf/resources.c 13 | ${CMAKE_SOURCE_DIR}/adriconf/Logging/Logger.cpp 14 | ${CMAKE_SOURCE_DIR}/adriconf/Logging/Logger.h 15 | ${CMAKE_SOURCE_DIR}/adriconf/Translation/GetTextTranslator.cpp 16 | ${CMAKE_SOURCE_DIR}/adriconf/Translation/GetTextTranslator.h 17 | ) 18 | 19 | target_link_libraries(adriconf ${GTKMM_LIBRARIES}) 20 | target_include_directories(adriconf PUBLIC ${GTKMM_INCLUDE_DIRS}) 21 | 22 | target_link_libraries(adriconf ${Boost_LOCALE_LIBRARIES}) 23 | target_link_libraries(adriconf ${Boost_FILESYSTEM_LIBRARIES}) 24 | target_link_libraries(adriconf ${Boost_SYSTEM_LIBRARIES}) 25 | target_include_directories(adriconf PUBLIC ${Boost_INCLUDE_DIRS}) 26 | 27 | target_link_libraries(adriconf ${LibXML++_LIBRARIES}) 28 | target_include_directories(adriconf PUBLIC ${LibXML++_INCLUDE_DIRS}) 29 | 30 | target_link_libraries(adriconf ${X11_LIBRARIES}) 31 | target_include_directories(adriconf PUBLIC ${X11_INCLUDE_DIRS}) 32 | 33 | target_link_libraries(adriconf ${DRM_LIBRARIES}) 34 | target_include_directories(adriconf PUBLIC ${DRM_INCLUDE_DIRS}) 35 | 36 | target_link_libraries(adriconf ${GBM_LIBRARIES}) 37 | target_include_directories(adriconf PUBLIC ${GBM_INCLUDE_DIRS}) 38 | 39 | target_link_libraries(adriconf ${PCILIB_LIBRARIES}) 40 | target_include_directories(adriconf PUBLIC ${PCILIB_INCLUDE_DIRS}) 41 | 42 | target_link_libraries(adriconf ${OPENGL_gl_LIBRARY}) 43 | if (OpenGL_GLX_FOUND) 44 | target_link_libraries(adriconf ${OPENGL_glx_LIBRARY}) 45 | endif () 46 | 47 | target_link_libraries(adriconf ${EGL_LIBRARIES}) 48 | target_include_directories(adriconf PUBLIC ${EGL_INCLUDE_DIRS}) 49 | 50 | target_compile_options(adriconf PRIVATE -Wall -Wextra -pedantic) 51 | 52 | add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/adriconf/resources.c 53 | COMMAND glib-compile-resources ${CMAKE_SOURCE_DIR}/adriconf/adriconf.gresource.xml --target=resources.c --generate-source 54 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/adriconf 55 | DEPENDS ${CMAKE_SOURCE_DIR}/adriconf/DriConf.glade 56 | COMMENT "Generate resources" 57 | ) 58 | 59 | set_source_files_properties(${CMAKE_SOURCE_DIR}/adriconf/resources.c PROPERTIES 60 | GENERATED TRUE 61 | ) 62 | 63 | install(TARGETS adriconf DESTINATION bin) -------------------------------------------------------------------------------- /adriconf/ValueObject/GPUInfo.cpp: -------------------------------------------------------------------------------- 1 | #include "GPUInfo.h" 2 | 3 | const Glib::ustring &GPUInfo::getPciId() const { 4 | return pciId; 5 | } 6 | 7 | void GPUInfo::setPciId(const Glib::ustring &pciId) { 8 | GPUInfo::pciId = pciId; 9 | } 10 | 11 | const Glib::ustring &GPUInfo::getDriverName() const { 12 | return driverName; 13 | } 14 | 15 | void GPUInfo::setDriverName(const Glib::ustring &driverName) { 16 | GPUInfo::driverName = driverName; 17 | } 18 | 19 | const Glib::ustring &GPUInfo::getDeviceName() const { 20 | return deviceName; 21 | } 22 | 23 | void GPUInfo::setDeviceName(const Glib::ustring &deviceName) { 24 | GPUInfo::deviceName = deviceName; 25 | } 26 | 27 | const Glib::ustring &GPUInfo::getVendorName() const { 28 | return vendorName; 29 | } 30 | 31 | void GPUInfo::setVendorName(const Glib::ustring &vendorName) { 32 | GPUInfo::vendorName = vendorName; 33 | } 34 | 35 | uint16_t GPUInfo::getVendorId() const { 36 | return vendorId; 37 | } 38 | 39 | void GPUInfo::setVendorId(uint16_t vendorId) { 40 | GPUInfo::vendorId = vendorId; 41 | } 42 | 43 | uint16_t GPUInfo::getDeviceId() const { 44 | return deviceId; 45 | } 46 | 47 | void GPUInfo::setDeviceId(uint16_t deviceId) { 48 | GPUInfo::deviceId = deviceId; 49 | } 50 | 51 | const std::list
&GPUInfo::getSections() const { 52 | return sections; 53 | } 54 | 55 | void GPUInfo::setSections(const std::list
§ions) { 56 | this->sections = sections; 57 | } 58 | 59 | bool GPUInfo::operator==(const GPUInfo &rhs) { 60 | return this->getDeviceId() == rhs.getDeviceId() && this->getVendorId() == rhs.getVendorId(); 61 | } 62 | 63 | std::map GPUInfo::getOptionsMap() const { 64 | std::map optionMap; 65 | 66 | for (const auto §ion : this->sections) { 67 | for (const auto &option : section.getOptions()) { 68 | optionMap[option.getName()] = option.getDefaultValue(); 69 | } 70 | } 71 | 72 | return optionMap; 73 | } 74 | 75 | void GPUInfo::sortSectionOptions() { 76 | for (auto §ion : this->sections) { 77 | section.sortOptions(); 78 | } 79 | } 80 | 81 | Application_ptr GPUInfo::generateApplication() const { 82 | Application_ptr app = std::make_shared(); 83 | std::list options; 84 | 85 | for (const auto §ion : this->sections) { 86 | for (const auto &option : section.getOptions()) { 87 | auto driverOpt = std::make_shared(); 88 | driverOpt->setName(option.getName()); 89 | driverOpt->setValue(option.getDefaultValue()); 90 | 91 | options.emplace_back(driverOpt); 92 | } 93 | } 94 | 95 | app->setOptions(options); 96 | 97 | return app; 98 | } -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to adriconf 2 | 3 | Our project is always open to new contributions. 4 | Be it a code change, a bug report on even an idea, get in touch with us and we 5 | can try to help. 6 | 7 | ## Reporting issues 8 | 9 | Reporting issues is a good way to contribute to the project. We always 10 | appreciate a well-written, thorough bug reports. 11 | 12 | Prior to raising a new issue, check out our issue list to determine whether it 13 | already include the problem you are facing. 14 | 15 | A good bug report shouldn't leave others needing to chase you up for more 16 | information. Please try to be as detailed as possible. 17 | The following questions might help us better understand the issue: 18 | 19 | - What were you trying to achieve? 20 | - What brand and models of GPUs you have? 21 | - How many monitors you have? 22 | - Are you running X11? Maybe Wayland? 23 | - Are you using the latest mesa version? 24 | - Is your distribution and adriconf updated? 25 | - What are the expected results? 26 | - What are the received results? 27 | - What are the steps to reproduce the issue? 28 | 29 | ## Enabling debug mode 30 | 31 | Since version 1.5 we support different log levels, which gives a lot more output 32 | and helps in finding issues. 33 | The log levels are the following: 34 | 35 | - ERROR: Only display errors 36 | - WARNING: Display errors and warnings 37 | - INFO: Will display general messages, as well as WARNING and ERROR. Is the 38 | default mode. 39 | - DEBUG: Is the most verbose mode. Will output all possible messages. 40 | 41 | To enable it you can run the application with the environment variable 42 | `VERBOSITY` to the desired level. Example: `VERBOSITY=DEBUG ./adriconf` 43 | 44 | ## Submitting Patches 45 | 46 | To submit a patch, we kindly ask you to use the Pull Request functionality. 47 | Fork the repository, make your changes and then create the Pull Request. 48 | 49 | Your Pull Request will only be accepted if the units tests are passing, so test 50 | your changes before submitting it. 51 | 52 | ## Review Proccess 53 | 54 | When you submit a Pull Request the code will be checked against some criteria. 55 | 56 | - The code should try to follow the same code style of other code. 57 | - The code should not introduce new bugs. 58 | - Whenever possible, the code should also have a unit test. 59 | - Current unit tests are passing. 60 | - The code is compiling and working with a recent Linux distribution. 61 | 62 | ## Release Proccess 63 | 64 | New releases are made sporadically, usually every 3 to 4 months. 65 | Releases can also be made in case of a high number of users affected by an 66 | issue like some specific linux distribution not working anymore, or the 67 | last release has broken something. 68 | 69 | To view instructions on how to release check our [RELEASING](RELEASING.md). -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # This project has moved 2 | This project has moved to Free desktop gitlab repositories. 3 | You can see the code [here](https://gitlab.freedesktop.org/mesa/adriconf/). 4 | 5 | This repository won't be updated anymore. 6 | 7 | # Advanced DRI Configurator 8 | 9 | adriconf (**A**dvanced **DRI** **CONF**igurator) is a GUI tool used to configure 10 | open source graphics drivers. It works by setting options and writing them to 11 | the standard `drirc` file used by the Mesa drivers. 12 | 13 | ## Features 14 | 15 | The main features of the tool are: 16 | 17 | - Automatic removal of invalid and unsupported options. 18 | - Options whose value is identical to the system-wide value or the driver's 19 | default value will be ignored. 20 | - System-wide application options with redundant options will be 21 | removed automatically. 22 | 23 | ## Building 24 | 25 | To build from source you can use the following commands: 26 | 27 | git clone https://github.com/jlHertel/adriconf.git 28 | cd adriconf 29 | mkdir build-dir 30 | cd build-dir 31 | cmake .. 32 | make 33 | sudo make install 34 | 35 | ## Translating 36 | 37 | To add a new language or to improve a existing one, you can edit the po files 38 | located under po/ dir. 39 | To add a new translation use the following command (for example for German): 40 | 41 | msginit -i adriconf.pot -o de.po --locale=de 42 | 43 | To update an existing translation from the pot file you can use the folowing: 44 | 45 | mv de.po de.po~ 46 | msgmerge -o de.po de.po~ adriconf.pot 47 | 48 | To update the pot file itself you can run the following: 49 | 50 | intltool-update --pot --gettext-package=adriconf 51 | 52 | Please note that many text shown in the application are from mesa directly, 53 | mainly the option descriptions. Therefore if you see any missing translation 54 | you will need to add it to the [mesa](https://www.mesa3d.org/) project itself. 55 | 56 | ## Author 57 | 58 | This tool is written and maintained by Jean Lorenz Hertel. 59 | To see a full list of contributors check the [AUTHORS](AUTHORS) file included in the source 60 | code. 61 | 62 | ## Contributing 63 | 64 | Check our [CONTRIBUTING](CONTRIBUTING.md) file for further details on how to contribute. 65 | 66 | ## License 67 | 68 | Copyright (C) 2018 Jean Lorenz Hertel 69 | 70 | This program is free software: you can redistribute it and/or modify 71 | it under the terms of the GNU General Public License as published by 72 | the Free Software Foundation, either version 3 of the License, or 73 | (at your option) any later version. 74 | 75 | This program is distributed in the hope that it will be useful, 76 | but WITHOUT ANY WARRANTY; without even the implied warranty of 77 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 78 | GNU General Public License for more details. 79 | 80 | You should have received a copy of the GNU General Public License 81 | along with this program. If not, see . 82 | -------------------------------------------------------------------------------- /adriconf/Utils/ConfigurationResolver.h: -------------------------------------------------------------------------------- 1 | #ifndef DRICONF3_CONFIGURATIONRESOLVER_H 2 | #define DRICONF3_CONFIGURATIONRESOLVER_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "../ValueObject/Device.h" 10 | #include "../ValueObject/DriverConfiguration.h" 11 | #include "../ValueObject/GPUInfo.h" 12 | #include "../Logging/LoggerInterface.h" 13 | #include "ConfigurationResolverInterface.h" 14 | #include "../Translation/TranslatorInterface.h" 15 | 16 | class ConfigurationResolver : public ConfigurationResolverInterface { 17 | private: 18 | LoggerInterface *logger; 19 | TranslatorInterface *translator; 20 | 21 | public: 22 | ~ConfigurationResolver() override = default; 23 | 24 | ConfigurationResolver(LoggerInterface *logger, TranslatorInterface *translator); 25 | 26 | /** 27 | * Takes all the options set and filter out the options already defined system-wide 28 | * Filters also the options that have the value equal to driver-default 29 | * @param systemWideOptions 30 | * @param driverAvailableOptions 31 | * @param userDefinedOptions 32 | * @param availableGPUs 33 | * @return A lista of new devices ready to be written to disk 34 | */ 35 | std::list resolveOptionsForSave( 36 | const std::list &, 37 | const std::list &, 38 | const std::list &, 39 | std::map & 40 | ) override; 41 | 42 | /** 43 | * Removes any option that is not supported by this driver 44 | * This function will directly change the userDefinedOptions list passed as argument 45 | * @param driverAvailableOptions 46 | * @param userDefinedOptions 47 | * @param availableGPUs 48 | */ 49 | void filterDriverUnsupportedOptions( 50 | const std::list &, 51 | std::list &, 52 | std::map & 53 | ) override; 54 | 55 | /** 56 | * Merge all the options defined in system-wide config together with the user-defined ones 57 | * This function will directly change the userDefinedOptions list passed as argument 58 | * @param systemWideOptions 59 | * @param driverAvailableOptions 60 | * @param userDefinedOptions 61 | * @param availableGPUs 62 | */ 63 | void mergeOptionsForDisplay( 64 | const std::list &, 65 | const std::list &, 66 | std::list &, 67 | std::map & 68 | ) override; 69 | 70 | /** 71 | * For each application check if it has a device_id defined and update its driver name accordingly 72 | */ 73 | void updatePrimeApplications(std::list &, const std::map &) override; 74 | 75 | void addMissingDriverOptions(Application_ptr app, std::map driverOptions) override; 76 | 77 | void addMissingApplications(const Device_ptr &sourceDevice, Device_ptr &targetDevice) override; 78 | 79 | void removeInvalidDrivers(const std::list &availableDrivers, 80 | std::list &userDefinedDevices) override; 81 | 82 | void mergeConfigurationOnTopOf(std::list &source, const std::list &addOnTop) override; 83 | }; 84 | 85 | #endif -------------------------------------------------------------------------------- /adriconf/Utils/XorgQuery.cpp: -------------------------------------------------------------------------------- 1 | #include "XorgQuery.h" 2 | 3 | XorgQuery::XorgQuery(LoggerInterface *logger, TranslatorInterface *translator, ParserInterface *parser) : 4 | logger(logger), translator(translator), parser(parser) { 5 | getScreenDriverName = (const char *(*)(Display *, int)) glXGetProcAddress((const GLubyte *) "glXGetScreenDriver"); 6 | getDriverOptions = (const char *(*)(const char *)) glXGetProcAddress((const GLubyte *) "glXGetDriverConfig"); 7 | } 8 | 9 | std::list XorgQuery::queryDriverConfigurationOptions(const Glib::ustring &locale) { 10 | std::list configs; 11 | 12 | Display *display; 13 | 14 | if (!(display = XOpenDisplay(nullptr))) { 15 | this->logger->error(this->translator->trns("Couldn't open X display")); 16 | return configs; 17 | } 18 | 19 | int screenCount = ScreenCount (display); 20 | 21 | for (int i = 0; i < screenCount; i++) { 22 | DriverConfiguration config; 23 | config.setScreen(i); 24 | 25 | /* Call glXGetClientString to load vendor libs on glvnd enabled systems */ 26 | glXGetClientString(display, GLX_EXTENSIONS); 27 | 28 | auto driverName = this->getScreenDriverName(display, i); 29 | if (driverName == nullptr) { 30 | this->logger->error(Glib::ustring::compose( 31 | this->translator->trns("Unable to extract driver name for screen %1"), i 32 | )); 33 | continue; 34 | } 35 | config.setDriverName(driverName); 36 | 37 | auto driverOptions = this->getDriverOptions(driverName); 38 | // If for some reason mesa is unable to query the options we simply skip this gpu 39 | if (driverOptions == nullptr) { 40 | this->logger->error( 41 | Glib::ustring::compose( 42 | this->translator->trns("Unable to extract configuration for driver %1"), 43 | config.getDriverName() 44 | ) 45 | ); 46 | 47 | continue; 48 | } 49 | 50 | Glib::ustring options(driverOptions); 51 | if (options.empty()) { 52 | this->logger->error( 53 | Glib::ustring::compose( 54 | this->translator->trns("Unable to extract configuration for driver %1"), 55 | config.getDriverName() 56 | ) 57 | ); 58 | 59 | continue; 60 | } 61 | 62 | auto parsedSections = this->parser->parseAvailableConfiguration(options, locale); 63 | config.setSections(parsedSections); 64 | 65 | configs.emplace_back(config); 66 | } 67 | 68 | return configs; 69 | } 70 | 71 | bool XorgQuery::checkNecessaryExtensions() { 72 | /* There is no reliable way to check if X11 supports the necessary extensions 73 | * so we just check if this is a open-source driver 74 | */ 75 | Display *display; 76 | 77 | if (!(display = XOpenDisplay(nullptr))) { 78 | this->logger->error(this->translator->trns("Couldn't open X display")); 79 | return false; 80 | } 81 | const char *glXextensions = glXGetClientString(display, GLX_EXTENSIONS); 82 | std::string possibleExts(glXextensions); 83 | if (possibleExts.find("GLX_MESA_query_renderer") == std::string::npos) { 84 | this->logger->error( 85 | this->translator->trns( 86 | "Missing GLX_MESA_query_renderer extension. Probably this is a closed-source driver." 87 | ) 88 | ); 89 | XCloseDisplay(display); 90 | return false; 91 | } 92 | 93 | XCloseDisplay(display); 94 | 95 | return true; 96 | } -------------------------------------------------------------------------------- /tests/DeviceTest.cpp: -------------------------------------------------------------------------------- 1 | #include "../adriconf/ValueObject/Device.h" 2 | #include "gtest/gtest.h" 3 | 4 | class DeviceTest : public ::testing::Test { 5 | public : 6 | Device_ptr d; 7 | 8 | DeviceTest() { 9 | d = std::make_shared(); 10 | } 11 | }; 12 | 13 | TEST_F (DeviceTest, defaultValues) { 14 | Glib::ustring driverName = d->getDriver(); 15 | const int screen = d->getScreen(); 16 | std::list appList = d->getApplications(); 17 | 18 | EXPECT_EQ("", driverName); 19 | EXPECT_EQ(-1, screen); 20 | EXPECT_EQ(0, appList.size()); 21 | } 22 | 23 | TEST_F (DeviceTest, driver) { 24 | d->setDriver("i915"); 25 | 26 | EXPECT_EQ("i915", d->getDriver()); 27 | } 28 | 29 | TEST_F (DeviceTest, driverChange) { 30 | d->setDriver("i915"); 31 | d->setDriver("i915-new"); 32 | 33 | EXPECT_EQ("i915-new", d->getDriver()); 34 | 35 | //duplicate driver case 36 | d->setDriver("i915-new"); 37 | EXPECT_EQ("i915-new", d->getDriver()); 38 | } 39 | 40 | TEST_F (DeviceTest, screen) { 41 | d->setScreen(5); 42 | 43 | EXPECT_EQ(5, d->getScreen()); 44 | } 45 | 46 | TEST_F (DeviceTest, screenChange) { 47 | d->setScreen(2); 48 | d->setScreen(3); 49 | 50 | EXPECT_EQ(3, d->getScreen()); 51 | 52 | //duplicate screen case 53 | d->setScreen(3); 54 | EXPECT_EQ(3, d->getScreen()); 55 | } 56 | 57 | class DeviceApplicationTest : public ::testing::Test { 58 | public: 59 | Device_ptr d; 60 | 61 | DeviceApplicationTest() { 62 | d = std::make_shared(); 63 | Application_ptr testApp1 = std::make_shared(); 64 | testApp1->setName("app1"); 65 | testApp1->setExecutable("app1-executable"); 66 | d->addApplication(testApp1); 67 | } 68 | }; 69 | 70 | TEST_F (DeviceApplicationTest, addApplicationTest) { 71 | //if this is not true then there is no need to test below cases 72 | ASSERT_EQ(1, d->getApplications().size()); 73 | 74 | EXPECT_EQ("app1", d->getApplications().front()->getName()); 75 | EXPECT_EQ("app1-executable", d->getApplications().front()->getExecutable()); 76 | 77 | Application_ptr testApp2 = std::make_shared(); 78 | testApp2->setName("app2"); 79 | testApp2->setExecutable("app2-executable"); 80 | d->addApplication(testApp2); 81 | 82 | ASSERT_EQ(2, d->getApplications().size()); 83 | 84 | EXPECT_EQ("app2", d->getApplications().back()->getName()); 85 | EXPECT_EQ("app2-executable", d->getApplications().back()->getExecutable()); 86 | } 87 | 88 | TEST_F (DeviceApplicationTest, findApplicationTest) { 89 | ASSERT_EQ(1, d->getApplications().size()); 90 | 91 | EXPECT_EQ("app1-executable", d->findApplication("app1-executable")->getExecutable()); 92 | EXPECT_EQ("app1", d->findApplication("app1-executable")->getName()); 93 | } 94 | 95 | /* 96 | * First add app1(added by constructor), app3, app2 to Device_ptr then check 97 | * the order by poping the values from back of Application_ptr list. 98 | * 99 | * The sorted order should be app1, app2, app3 100 | * */ 101 | TEST_F (DeviceApplicationTest, sortApplicationTest) { 102 | ASSERT_EQ(1, d->getApplications().size()); 103 | 104 | Application_ptr testApp2 = std::make_shared(); 105 | testApp2->setName("app3"); 106 | testApp2->setExecutable("app3-executable"); 107 | d->addApplication(testApp2); 108 | 109 | Application_ptr testApp3 = std::make_shared(); 110 | testApp3->setName("app2"); 111 | testApp3->setExecutable("app2-executable"); 112 | d->addApplication(testApp3); 113 | 114 | d->sortApplications(); 115 | 116 | std::list appList = d->getApplications(); 117 | 118 | EXPECT_EQ("app3", appList.back()->getName()); 119 | appList.pop_back(); 120 | 121 | EXPECT_EQ("app2", appList.back()->getName()); 122 | appList.pop_back(); 123 | 124 | EXPECT_EQ("app1", appList.back()->getName()); 125 | } 126 | -------------------------------------------------------------------------------- /adriconf/ValueObject/DriverOption.cpp: -------------------------------------------------------------------------------- 1 | #include "DriverOption.h" 2 | 3 | #include 4 | 5 | 6 | const Glib::ustring &DriverOption::getName() const { 7 | return this->name; 8 | } 9 | 10 | const Glib::ustring &DriverOption::getDescription() const { 11 | return this->description; 12 | } 13 | 14 | const DriverOptionType &DriverOption::getType() const { 15 | return this->type; 16 | } 17 | 18 | void DriverOption::updateFakeBool() { 19 | if (this->type == DriverOptionType::ENUM 20 | && this->validValues == "0:1" 21 | && this->enumValues.empty()) { 22 | this->type = DriverOptionType::FAKE_BOOL; 23 | } 24 | } 25 | 26 | DriverOptionType DriverOption::stringToEnum(const Glib::ustring &type) const { 27 | if (type == "bool") { 28 | return DriverOptionType::BOOL; 29 | } 30 | 31 | if (type == "int") { 32 | return DriverOptionType::INT; 33 | } 34 | 35 | if (type == "enum") { 36 | return DriverOptionType::ENUM; 37 | } 38 | 39 | return DriverOptionType::UNKNOW; 40 | } 41 | 42 | const Glib::ustring &DriverOption::getDefaultValue() const { 43 | return this->defaultValue; 44 | } 45 | 46 | const Glib::ustring &DriverOption::getValidValues() const { 47 | return this->validValues; 48 | } 49 | 50 | std::list> 51 | DriverOption::getEnumValues() const { 52 | return this->enumValues; 53 | } 54 | 55 | 56 | DriverOption *DriverOption::setName(Glib::ustring name) { 57 | this->name = std::move(name); 58 | 59 | return this; 60 | } 61 | 62 | DriverOption *DriverOption::setDescription(Glib::ustring description) { 63 | this->description = std::move(description); 64 | 65 | return this; 66 | } 67 | 68 | DriverOption *DriverOption::setType(DriverOptionType type) { 69 | this->type = type; 70 | 71 | return this; 72 | } 73 | 74 | DriverOption *DriverOption::setDefaultValue(Glib::ustring defaultValue) { 75 | this->defaultValue = std::move(defaultValue); 76 | 77 | return this; 78 | } 79 | 80 | DriverOption *DriverOption::setValidValues(Glib::ustring validValues) { 81 | this->validValues = std::move(validValues); 82 | 83 | return this; 84 | } 85 | 86 | DriverOption *DriverOption::addEnumValue( 87 | Glib::ustring description, Glib::ustring value 88 | ) { 89 | this->enumValues.emplace_back(description, value); 90 | 91 | return this; 92 | } 93 | 94 | int DriverOption::getValidValueStart() const { 95 | if (this->validValues.empty()) { 96 | return -1; 97 | } 98 | 99 | auto splitPos = this->validValues.find_first_of(':'); 100 | if (splitPos > this->validValues.length() || splitPos <= 0) { 101 | return -1; 102 | } 103 | 104 | // The first part up to the new line 105 | auto firstPart = this->validValues.substr(0, splitPos); 106 | 107 | return std::stoi(firstPart); 108 | } 109 | 110 | int DriverOption::getValidValueEnd() const { 111 | if (this->validValues.empty()) { 112 | return 10000; 113 | } 114 | 115 | auto splitPos = this->validValues.find_first_of(':'); 116 | if (splitPos == std::string::npos || splitPos >= this->validValues.length() - 1) { 117 | return 10000; 118 | } 119 | 120 | // The part after the new line 121 | auto secondPart = this->validValues.substr(splitPos + 1, 122 | this->validValues.length() - 123 | splitPos); 124 | 125 | return std::stoi(secondPart); 126 | } 127 | 128 | int DriverOption::getSortValue() const { 129 | switch (this->type) { 130 | case DriverOptionType::BOOL: 131 | case DriverOptionType::FAKE_BOOL: 132 | return 1; 133 | 134 | case DriverOptionType::ENUM: 135 | return 2; 136 | 137 | case DriverOptionType::INT: 138 | return 3; 139 | 140 | default: 141 | return 4; 142 | } 143 | } 144 | 145 | -------------------------------------------------------------------------------- /adriconf/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "GUI.h" 6 | #include "Utils/DRIQuery.h" 7 | #include "Utils/ConfigurationLoader.h" 8 | #include "Utils/ConfigurationResolver.h" 9 | #include "Logging/Logger.h" 10 | #include "Logging/LoggerInterface.h" 11 | #include "Utils/Writer.h" 12 | #include "Utils/PCIDatabaseQuery.h" 13 | #include "Utils/DRMDeviceFactory.h" 14 | #include "Utils/GBMDeviceFactory.h" 15 | #include "Utils/EGLDisplayFactory.h" 16 | #include "Translation/GetTextTranslator.h" 17 | #include "Utils/WaylandQuery.h" 18 | #include "Utils/XorgQuery.h" 19 | 20 | int main(int argc, char *argv[]) { 21 | char *verbosity = std::getenv("VERBOSITY"); 22 | auto logger = std::make_shared(); 23 | logger->setLevel(LoggerLevel::INFO); 24 | auto translator = std::make_shared(); 25 | 26 | if (verbosity != nullptr) { 27 | Glib::ustring verbosityStr(verbosity); 28 | if (verbosityStr == "DEBUG") { 29 | logger->setLevel(LoggerLevel::DEBUG); 30 | } 31 | 32 | if (verbosityStr == "INFO") { 33 | logger->setLevel(LoggerLevel::INFO); 34 | } 35 | 36 | if (verbosityStr == "WARNING") { 37 | logger->setLevel(LoggerLevel::WARNING); 38 | } 39 | 40 | if (verbosityStr == "ERROR") { 41 | logger->setLevel(LoggerLevel::ERROR); 42 | } 43 | } 44 | 45 | try { 46 | logger->debug(translator->trns("Creating the GTK application object")); 47 | 48 | /* Start the GUI work */ 49 | auto app = Gtk::Application::create(argc, argv, "br.com.jeanhertel.adriconf"); 50 | 51 | char *waylandDisplay = std::getenv("WAYLAND_DISPLAY"); 52 | bool isWayland = waylandDisplay != nullptr; 53 | 54 | Parser parser(logger.get(), translator.get()); 55 | PCIDatabaseQuery pciQuery; 56 | GBMDeviceFactory gbmDeviceFactory(translator.get()); 57 | DRMDeviceFactory drmDeviceFactory; 58 | EGLDisplayFactory eglDisplayFactory(translator.get()); 59 | DRIQuery check(logger.get(), translator.get(), &parser, &pciQuery, &drmDeviceFactory, &gbmDeviceFactory, 60 | &eglDisplayFactory); 61 | std::shared_ptr displayQuery; 62 | if (isWayland) { 63 | logger->info(translator->trns("adriconf running on Wayland")); 64 | displayQuery = std::make_shared(logger.get(), translator.get(), &parser, &eglDisplayFactory); 65 | } else { 66 | logger->info(translator->trns("adriconf running on X11")); 67 | displayQuery = std::make_shared(logger.get(), translator.get(), &parser); 68 | } 69 | 70 | logger->debug(translator->trns("Checking if the system is supported")); 71 | if (!displayQuery->checkNecessaryExtensions()) { 72 | return 1; 73 | } 74 | 75 | Writer writer; 76 | ConfigurationResolver resolver(logger.get(), translator.get()); 77 | ConfigurationLoader loader(check,displayQuery.get(), logger.get(), translator.get(), &parser, &resolver); 78 | GUI gui(logger.get(), translator.get(), &loader, &resolver, &writer); 79 | 80 | /* No need to worry about the window pointer as the gui object owns it */ 81 | Gtk::Window *pWindow = gui.getWindowPointer(); 82 | 83 | return app->run(*pWindow); 84 | } 85 | catch (const Glib::FileError &ex) { 86 | logger->error(Glib::ustring::compose("FileError: %1", ex.what())); 87 | return 1; 88 | } 89 | catch (const Glib::MarkupError &ex) { 90 | logger->error(Glib::ustring::compose("MarkupError: %1", ex.what())); 91 | return 1; 92 | } 93 | catch (const Gtk::BuilderError &ex) { 94 | logger->error(Glib::ustring::compose("BuilderError: %1", ex.what())); 95 | return 1; 96 | } 97 | catch (const std::exception &ex) { 98 | logger->error(Glib::ustring::compose("Generic Error: %1", ex.what())); 99 | return 1; 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /tests/GPUInfoTest.cpp: -------------------------------------------------------------------------------- 1 | #include "../adriconf/ValueObject/GPUInfo.h" 2 | #include "gtest/gtest.h" 3 | 4 | class GPUInfoTest : public ::testing::Test 5 | { 6 | public: 7 | GPUInfo_ptr testApp; 8 | 9 | GPUInfoTest() { 10 | testApp = std::make_shared(); 11 | } 12 | }; 13 | 14 | TEST_F (GPUInfoTest, defaultsTest) { 15 | EXPECT_EQ("", testApp->getPciId()); 16 | EXPECT_EQ("", testApp->getDriverName()); 17 | EXPECT_EQ("", testApp->getDeviceName()); 18 | EXPECT_EQ("", testApp->getVendorName()); 19 | EXPECT_EQ(0, testApp->getVendorId()); 20 | EXPECT_EQ(0, testApp->getDeviceId()); 21 | EXPECT_TRUE(testApp->getSections().empty()); 22 | EXPECT_TRUE(testApp->getOptionsMap().empty()); 23 | } 24 | 25 | TEST_F (GPUInfoTest, pciIdTest) { 26 | testApp->setPciId("00101"); 27 | EXPECT_EQ("00101", testApp->getPciId()); 28 | 29 | //duplicate case 30 | testApp->setPciId("00101"); 31 | EXPECT_EQ("00101", testApp->getPciId()); 32 | 33 | //change case 34 | testApp->setPciId("00561651"); 35 | EXPECT_EQ("00561651", testApp->getPciId()); 36 | } 37 | 38 | TEST_F (GPUInfoTest, driverNameTest) { 39 | testApp->setDriverName("i965"); 40 | EXPECT_EQ("i965", testApp->getDriverName()); 41 | 42 | //duplicate case 43 | testApp->setDriverName("i965"); 44 | EXPECT_EQ("i965", testApp->getDriverName()); 45 | 46 | //change case 47 | testApp->setDriverName("nouveau"); 48 | EXPECT_EQ("nouveau", testApp->getDriverName()); 49 | } 50 | 51 | TEST_F (GPUInfoTest, deviceNameTest) { 52 | testApp->setDeviceName("device0"); 53 | EXPECT_EQ("device0", testApp->getDeviceName()); 54 | 55 | //duplicate case 56 | testApp->setDeviceName("device0"); 57 | EXPECT_EQ("device0", testApp->getDeviceName()); 58 | 59 | //change case 60 | testApp->setDeviceName("device1"); 61 | EXPECT_EQ("device1", testApp->getDeviceName()); 62 | } 63 | 64 | TEST_F (GPUInfoTest, VendorNameTest) { 65 | testApp->setVendorName("intel"); 66 | EXPECT_EQ("intel", testApp->getVendorName()); 67 | 68 | //duplicate case 69 | testApp->setVendorName("intel"); 70 | EXPECT_EQ("intel", testApp->getVendorName()); 71 | 72 | //change case 73 | testApp->setVendorName("AMD"); 74 | EXPECT_EQ("AMD", testApp->getVendorName()); 75 | } 76 | 77 | TEST_F (GPUInfoTest, VendorIdTest) { 78 | testApp->setVendorId(01456); 79 | EXPECT_EQ(01456, testApp->getVendorId()); 80 | 81 | //duplicate case 82 | testApp->setVendorId(01456); 83 | EXPECT_EQ(01456, testApp->getVendorId()); 84 | 85 | //change case 86 | testApp->setVendorId(000653); 87 | EXPECT_EQ(000653, testApp->getVendorId()); 88 | } 89 | 90 | TEST_F (GPUInfoTest, deviceIdTest) { 91 | testApp->setDeviceId(01456); 92 | EXPECT_EQ(01456, testApp->getDeviceId()); 93 | 94 | //duplicate case 95 | testApp->setDeviceId(01456); 96 | EXPECT_EQ(01456, testApp->getDeviceId()); 97 | 98 | //change case 99 | testApp->setDeviceId(000653); 100 | EXPECT_EQ(000653, testApp->getDeviceId()); 101 | } 102 | 103 | TEST_F (GPUInfoTest, equalsOperatorTest) { 104 | GPUInfo_ptr testApp1 = std::make_shared(); 105 | testApp->setDeviceId(0456); 106 | testApp->setVendorId(1567); 107 | 108 | testApp1->setDeviceId(8998); 109 | testApp1->setVendorId(2313); 110 | 111 | //both different case 112 | EXPECT_FALSE(testApp == testApp1); 113 | 114 | //only vendorId different case 115 | testApp1->setDeviceId(0456); 116 | EXPECT_FALSE(testApp == testApp1); 117 | 118 | //only deviceId different case 119 | testApp1->setDeviceId(8998); 120 | testApp1->setVendorId(1567); 121 | EXPECT_FALSE(testApp == testApp1); 122 | 123 | //both same case 124 | testApp1->setDeviceId(0456); 125 | testApp1->setVendorId(1567); 126 | EXPECT_FALSE(testApp == testApp1); 127 | } 128 | 129 | TEST_F (GPUInfoTest, sectionTest) { 130 | std::list
sections0; 131 | Section s; 132 | s.setDescription("bla bla.."); 133 | sections0.emplace_back(s); 134 | 135 | //(process:30123): GLib-CRITICAL **: 11:47:06.629: g_utf8_collate: assertion 'str1 != NULL' failed 136 | //might be due to the Section* which will be returned in L132 137 | //WARNNING after adding below line.. 138 | EXPECT_EQ("bla bla..", testApp->getSections().front().getDescription()); 139 | } 140 | 141 | TEST_F (GPUInfoTest, driverOptionsMapTest) { 142 | std::map optionMap; 143 | std::list
sections0; 144 | Section s; 145 | DriverOption drOpt; 146 | drOpt.setName("name0"); 147 | drOpt.setDefaultValue("007"); 148 | s.addOption(drOpt); 149 | sections0.emplace_back(s); 150 | 151 | testApp->setSections(sections0); 152 | optionMap["name0"] = "007"; 153 | 154 | EXPECT_EQ(optionMap, testApp->getOptionsMap()); 155 | } 156 | -------------------------------------------------------------------------------- /tests/ApplicationTest.cpp: -------------------------------------------------------------------------------- 1 | #include "../adriconf/ValueObject/Application.h" 2 | #include "gtest/gtest.h" 3 | 4 | class ApplicationTest : public ::testing::Test 5 | { 6 | public: 7 | Application_ptr testApp; 8 | 9 | ApplicationTest() { 10 | testApp = std::make_shared(); 11 | } 12 | }; 13 | 14 | TEST_F (ApplicationTest, defaultValuesTest) { 15 | Glib::ustring name = testApp->getName(); 16 | Glib::ustring executable = testApp->getExecutable(); 17 | std::list options = testApp->getOptions(); 18 | std::map optionsMap = testApp->getOptionsAsMap(); 19 | bool prime = testApp->getIsUsingPrime(); 20 | Glib::ustring primeName = testApp->getPrimeDriverName(); 21 | Glib::ustring pciId = testApp->getDevicePCIId(); 22 | 23 | 24 | EXPECT_EQ("", name); 25 | EXPECT_EQ("", executable); 26 | EXPECT_EQ(0, options.size()); 27 | EXPECT_EQ(0, optionsMap.size()); 28 | EXPECT_FALSE(prime); 29 | EXPECT_EQ("", primeName); 30 | EXPECT_EQ("", pciId); 31 | } 32 | 33 | TEST_F (ApplicationTest, nameTest) { 34 | testApp->setName("Watch Dogs"); 35 | Glib::ustring name = testApp->getName(); 36 | 37 | EXPECT_EQ("Watch Dogs", name); 38 | 39 | //duplicate case 40 | testApp->setName("Watch Dogs"); 41 | Glib::ustring name1 = testApp->getName(); 42 | 43 | EXPECT_EQ("Watch Dogs", name1); 44 | 45 | //name change case 46 | testApp->setName("FIFA 2018"); 47 | Glib::ustring name2 = testApp->getName(); 48 | EXPECT_EQ("FIFA 2018", name2); 49 | } 50 | 51 | TEST_F (ApplicationTest, executableTest) { 52 | testApp->setExecutable("Watch Dogs executable"); 53 | Glib::ustring executable = testApp->getExecutable(); 54 | 55 | EXPECT_EQ("Watch Dogs executable", executable); 56 | 57 | //duplicate case 58 | testApp->setExecutable("Watch Dogs executable"); 59 | Glib::ustring executable1 = testApp->getExecutable(); 60 | 61 | EXPECT_EQ("Watch Dogs executable", executable1); 62 | 63 | //Executable change case 64 | testApp->setExecutable("FIFA 2018 executable"); 65 | Glib::ustring executable2 = testApp->getExecutable(); 66 | EXPECT_EQ("FIFA 2018 executable", executable2); 67 | } 68 | 69 | TEST_F (ApplicationTest, optionsTest) { 70 | ApplicationOption_ptr optPtr = std::make_shared(); 71 | optPtr->setName("screen-width"); 72 | testApp->addOption(optPtr); 73 | 74 | ApplicationOption_ptr optPtr1 = std::make_shared(); 75 | optPtr1->setName("refresh-rate"); 76 | testApp->addOption(optPtr1); 77 | 78 | std::list options = testApp->getOptions(); 79 | ASSERT_EQ(2, options.size()); 80 | EXPECT_EQ("refresh-rate", options.back()->getName()); 81 | EXPECT_EQ("screen-width", options.front()->getName()); 82 | } 83 | 84 | TEST_F (ApplicationTest, optionsAsMapTest) { 85 | std::list options; 86 | ApplicationOption_ptr optPtr = std::make_shared(); 87 | optPtr->setName("fancy-option"); 88 | 89 | ApplicationOption_ptr optPtr1 = std::make_shared(); 90 | optPtr1->setName("locale-option"); 91 | 92 | options.emplace_back(optPtr); 93 | options.emplace_back(optPtr1); 94 | 95 | testApp->setOptions(options); 96 | 97 | std::map optMap = testApp->getOptionsAsMap(); 98 | 99 | ASSERT_EQ(2, options.size()); 100 | 101 | EXPECT_TRUE(optMap.find("fancy-option") != optMap.end()); 102 | EXPECT_TRUE(optMap.find("locale-option") != optMap.end()); 103 | } 104 | 105 | TEST_F (ApplicationTest, primeTest) { 106 | testApp->setIsUsingPrime(true); 107 | EXPECT_TRUE(testApp->getIsUsingPrime()); 108 | 109 | testApp->setIsUsingPrime(false); 110 | EXPECT_FALSE(testApp->getIsUsingPrime()); 111 | } 112 | 113 | TEST_F (ApplicationTest, primeDiverNameTest) { 114 | testApp->setPrimeDriverName("i965"); 115 | Glib::ustring name = testApp->getPrimeDriverName(); 116 | EXPECT_EQ("i965", name); 117 | 118 | //duplicate case 119 | testApp->setPrimeDriverName("i965"); 120 | Glib::ustring name1 = testApp->getPrimeDriverName(); 121 | EXPECT_EQ("i965", name1); 122 | 123 | testApp->setPrimeDriverName("nouveau"); 124 | Glib::ustring name2 = testApp->getPrimeDriverName(); 125 | EXPECT_EQ("nouveau", name2); 126 | } 127 | 128 | TEST_F (ApplicationTest, pciIdTest) { 129 | testApp->setDevicePCIId("pci-test-001"); 130 | Glib::ustring pciId = testApp->getDevicePCIId(); 131 | EXPECT_EQ("pci-test-001", pciId); 132 | 133 | //duplicate case 134 | testApp->setDevicePCIId("pci-test-001"); 135 | Glib::ustring pciId1 = testApp->getDevicePCIId(); 136 | EXPECT_EQ("pci-test-001", pciId1); 137 | 138 | testApp->setDevicePCIId("pci-test-changed"); 139 | Glib::ustring pciId2 = testApp->getDevicePCIId(); 140 | EXPECT_EQ("pci-test-changed", pciId2); 141 | } 142 | -------------------------------------------------------------------------------- /adriconf/Utils/DRIQuery.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include "DRIQuery.h" 7 | #include "PCIDatabaseQuery.h" 8 | 9 | #include 10 | 11 | DRIQuery::DRIQuery( 12 | LoggerInterface *logger, 13 | TranslatorInterface *translator, 14 | ParserInterface *parser, 15 | PCIDatabaseQueryInterface *pciQuery, 16 | DRMDeviceFactoryInterface *drmDeviceFactory, 17 | GBMDeviceFactoryInterface *gbmDeviceFactory, 18 | EGLDisplayFactoryInterface *eglWrapper 19 | ) : logger(logger), 20 | translator(translator), 21 | parser(parser), 22 | pciQuery(pciQuery), 23 | drmDeviceFactory(drmDeviceFactory), 24 | gbmDeviceFactory(gbmDeviceFactory), 25 | eglDisplayFactory(eglWrapper) {} 26 | 27 | std::map DRIQuery::enumerateDRIDevices(const Glib::ustring &locale) { 28 | this->logger->debug(this->translator->trns("Enumerating DRI Devices")); 29 | std::map gpus; 30 | 31 | auto drmDevices = this->drmDeviceFactory->getDevices(); 32 | this->logger->debug( 33 | Glib::ustring::compose(this->translator->trns("Found %1 devices"), drmDevices.size()) 34 | ); 35 | 36 | int i = 0; 37 | for (auto &device : drmDevices) { 38 | i++; 39 | try { 40 | GPUInfo_ptr gpu = std::make_shared(); 41 | 42 | gpu->setPciId(device->getFormattedPCIId()); 43 | this->logger->debug( 44 | Glib::ustring::compose( 45 | this->translator->trns("Processing GPU with PCI ID \"%1\""), 46 | gpu->getPciId() 47 | ) 48 | ); 49 | gpu->setVendorId(device->getVendorPCIId()); 50 | gpu->setDeviceId(device->getDevicePCIId()); 51 | 52 | gpu->setVendorName(this->pciQuery->queryVendorName(gpu->getVendorId())); 53 | gpu->setDeviceName(this->pciQuery->queryDeviceName(gpu->getVendorId(), gpu->getDeviceId())); 54 | 55 | this->logger->debug( 56 | Glib::ustring::compose( 57 | this->translator->trns("GPU has been detected as \"%1\" from \"%2\""), 58 | gpu->getDeviceName(), 59 | gpu->getVendorName() 60 | ) 61 | ); 62 | 63 | 64 | this->logger->debug( 65 | Glib::ustring::compose( 66 | this->translator->trns("Generating gbm device for path \"%1\""), 67 | device->getDeviceRenderNodeName() 68 | ) 69 | ); 70 | 71 | GBMDevice gbmDevice = this->gbmDeviceFactory->generateDeviceFromPath(device->getDeviceRenderNodeName()); 72 | 73 | this->logger->debug( 74 | Glib::ustring::compose( 75 | this->translator->trns("Generating EGL Display from GBM device for \"%1\""), 76 | device->getDeviceRenderNodeName() 77 | ) 78 | ); 79 | 80 | auto display = this->eglDisplayFactory->createDisplayFromGBM(gbmDevice); 81 | gpu->setDriverName(display->getDriverName()); 82 | this->logger->debug( 83 | Glib::ustring::compose( 84 | this->translator->trns("GPU \"%1\" has the driver \"%2\""), 85 | i, 86 | gpu->getDriverName() 87 | ) 88 | ); 89 | 90 | this->logger->debug(this->translator->trns("Loading driver options")); 91 | const char *driverOptions = display->getDriverOptions(); 92 | 93 | // If for some reason mesa is unable to query the options we simply skip this gpu 94 | if (driverOptions == nullptr) { 95 | this->logger->error( 96 | Glib::ustring::compose( 97 | this->translator->trns("Unable to extract configuration for driver %1"), 98 | gpu->getDriverName() 99 | ) 100 | ); 101 | 102 | continue; 103 | } 104 | 105 | Glib::ustring options(driverOptions); 106 | if (options.empty()) { 107 | this->logger->error( 108 | Glib::ustring::compose( 109 | this->translator->trns("Unable to extract configuration for driver %1"), 110 | gpu->getDriverName() 111 | ) 112 | ); 113 | 114 | continue; 115 | } 116 | 117 | auto parsedSections = this->parser->parseAvailableConfiguration(options, locale); 118 | gpu->setSections(parsedSections); 119 | 120 | gpus[gpu->getPciId()] = gpu; 121 | } catch (std::runtime_error &ex) { 122 | this->logger->error( 123 | Glib::ustring::compose( 124 | this->translator->trns("Skipping device %1 due to error: %2"), 125 | i, 126 | ex.what() 127 | ) 128 | ); 129 | } 130 | } 131 | 132 | return gpus; 133 | } -------------------------------------------------------------------------------- /tests/DriverOptionTest.cpp: -------------------------------------------------------------------------------- 1 | #include "../adriconf/ValueObject/DriverOption.h" 2 | #include "gtest/gtest.h" 3 | 4 | class DriverOptionTest : public ::testing::Test 5 | { 6 | public: 7 | DriverOption* testApp; 8 | DriverOption* testApp1; 9 | 10 | DriverOptionTest() { 11 | testApp = new DriverOption(); 12 | testApp1 = new DriverOption(); 13 | 14 | testApp1->setValidValues("01:007"); 15 | } 16 | }; 17 | 18 | TEST_F (DriverOptionTest, defaultsTest) { 19 | std::list> enumValues = testApp->getEnumValues(); 20 | 21 | EXPECT_EQ("", testApp->getName()); 22 | EXPECT_EQ("", testApp->getDescription()); 23 | EXPECT_EQ("", testApp->getDefaultValue()); 24 | EXPECT_EQ("", testApp->getValidValues()); 25 | EXPECT_EQ(-1, testApp->getValidValueStart()); 26 | EXPECT_EQ(10000, testApp->getValidValueEnd()); 27 | EXPECT_EQ(4, testApp->getSortValue()); 28 | EXPECT_TRUE(enumValues.empty()); 29 | } 30 | 31 | TEST_F (DriverOptionTest, nameTest) { 32 | testApp = testApp->setName("i965"); 33 | EXPECT_EQ("i965", testApp->getName()); 34 | 35 | //duplicate case 36 | testApp = testApp->setName("i965"); 37 | EXPECT_EQ("i965", testApp->getName()); 38 | 39 | //name change case 40 | testApp = testApp->setName("nouveau"); 41 | EXPECT_EQ("nouveau", testApp->getName()); 42 | } 43 | 44 | TEST_F (DriverOptionTest, descriptionTest) { 45 | testApp = testApp->setDescription("description0"); 46 | EXPECT_EQ("description0", testApp->getDescription()); 47 | 48 | //duplicate case 49 | testApp = testApp->setDescription("description0"); 50 | EXPECT_EQ("description0", testApp->getDescription()); 51 | 52 | //description change case 53 | testApp = testApp->setDescription("description1"); 54 | EXPECT_EQ("description1", testApp->getDescription()); 55 | } 56 | 57 | TEST_F (DriverOptionTest, typeTest) { 58 | testApp = testApp->setType(DriverOptionType::BOOL); 59 | EXPECT_EQ(DriverOptionType::BOOL, testApp->getType()); 60 | 61 | //duplicate case 62 | testApp = testApp->setType(DriverOptionType::BOOL); 63 | EXPECT_EQ(DriverOptionType::BOOL, testApp->getType()); 64 | 65 | //type change case 66 | testApp = testApp->setType(DriverOptionType::INT); 67 | EXPECT_EQ(DriverOptionType::INT, testApp->getType()); 68 | } 69 | 70 | TEST_F (DriverOptionTest, defaultValueTest) { 71 | testApp = testApp->setDefaultValue("0:0"); 72 | EXPECT_EQ("0:0", testApp->getDefaultValue()); 73 | 74 | //duplicate case 75 | testApp = testApp->setDefaultValue("0:0"); 76 | EXPECT_EQ("0:0", testApp->getDefaultValue()); 77 | 78 | //change case 79 | testApp = testApp->setDefaultValue("1:1"); 80 | EXPECT_EQ("1:1", testApp->getDefaultValue()); 81 | } 82 | 83 | TEST_F (DriverOptionTest, validValuesTest) { 84 | testApp = testApp->setValidValues("vv0:0"); 85 | EXPECT_EQ("vv0:0", testApp->getValidValues()); 86 | 87 | //duplicate case 88 | testApp = testApp->setValidValues("vv0:0"); 89 | EXPECT_EQ("vv0:0", testApp->getValidValues()); 90 | 91 | //change case 92 | testApp = testApp->setValidValues("vv1:1"); 93 | EXPECT_EQ("vv1:1", testApp->getValidValues()); 94 | } 95 | 96 | TEST_F (DriverOptionTest, enumValuesTest) { 97 | testApp = testApp->addEnumValue("desc0", "val0"); 98 | ASSERT_TRUE(testApp->getEnumValues().size() == 1); 99 | 100 | std::pair enumVal ("desc0", "val0"); 101 | EXPECT_TRUE(testApp->getEnumValues().front() == enumVal); 102 | 103 | //different enumValues case 104 | testApp = testApp->addEnumValue("desc1", "val1"); 105 | ASSERT_TRUE(testApp->getEnumValues().size() == 2); 106 | 107 | std::pair enumVal1 ("desc1", "val1"); 108 | EXPECT_TRUE(testApp->getEnumValues().front() == enumVal); 109 | EXPECT_TRUE(testApp->getEnumValues().back() == enumVal1); 110 | } 111 | 112 | TEST_F (DriverOptionTest, validValueStartTest) { 113 | EXPECT_EQ(1, testApp1->getValidValueStart()); 114 | 115 | //empty start-value case 116 | testApp1->setValidValues(":007"); 117 | EXPECT_EQ(-1, testApp1->getValidValueStart()); 118 | 119 | //both empty case 120 | testApp1->setValidValues(":"); 121 | EXPECT_EQ(-1, testApp1->getValidValueStart()); 122 | 123 | //empty end-value case 124 | testApp1->setValidValues("00000010:"); 125 | EXPECT_EQ(10, testApp1->getValidValueStart()); 126 | } 127 | 128 | TEST_F (DriverOptionTest, validValueEndTest) { 129 | EXPECT_EQ(7, testApp1->getValidValueEnd()); 130 | 131 | //empty start-value case 132 | testApp1->setValidValues(":00999"); 133 | EXPECT_EQ(999, testApp1->getValidValueEnd()); 134 | 135 | //both empty case 136 | testApp1->setValidValues(":"); 137 | EXPECT_EQ(10000, testApp1->getValidValueEnd()); 138 | 139 | //empty end-value case 140 | testApp1->setValidValues("00000010:"); 141 | EXPECT_EQ(10000, testApp1->getValidValueEnd()); 142 | } 143 | 144 | TEST_F (DriverOptionTest, sortValueTest) { 145 | testApp->setType(DriverOptionType::BOOL); 146 | EXPECT_EQ(1, testApp->getSortValue()); 147 | 148 | //duplicate case 149 | testApp->setType(DriverOptionType::BOOL); 150 | EXPECT_EQ(1, testApp->getSortValue()); 151 | 152 | testApp->setType(DriverOptionType::ENUM); 153 | EXPECT_EQ(2, testApp->getSortValue()); 154 | 155 | testApp->setType(DriverOptionType::INT); 156 | EXPECT_EQ(3, testApp->getSortValue()); 157 | } 158 | 159 | TEST_F (DriverOptionTest, updateFakeBoolTest) { 160 | testApp->setType(DriverOptionType::ENUM); 161 | testApp->setValidValues("0:1"); 162 | testApp->updateFakeBool(); 163 | EXPECT_EQ(DriverOptionType::FAKE_BOOL, testApp->getType()); 164 | 165 | testApp->setType(DriverOptionType::INT); 166 | testApp->setValidValues("12:99"); 167 | testApp->addEnumValue("d0", "v0"); 168 | testApp->updateFakeBool(); 169 | EXPECT_NE(DriverOptionType::FAKE_BOOL, testApp->getType()); 170 | } 171 | -------------------------------------------------------------------------------- /adriconf/Utils/ConfigurationLoader.cpp: -------------------------------------------------------------------------------- 1 | #include "ConfigurationLoader.h" 2 | #include "ConfigurationResolver.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | Glib::ustring ConfigurationLoader::readSystemWideXML() { 9 | this->logger->debug(this->translator->trns("Reading legacy system-wide XML")); 10 | Glib::ustring container; 11 | std::ostringstream buffer; 12 | Glib::ustring filePath(this->getOldSystemWideConfigurationPath()); 13 | 14 | this->logger->debug( 15 | Glib::ustring::compose( 16 | this->translator->trns("Legacy system-wide XML path: %1"), 17 | filePath 18 | ) 19 | ); 20 | std::ifstream input(filePath); 21 | 22 | if (!input.good()) { 23 | this->logger->debug(this->translator->trns("Legacy system-wide file doesn't exist")); 24 | return container; 25 | } 26 | 27 | buffer << input.rdbuf(); 28 | container = buffer.str(); 29 | 30 | return container; 31 | } 32 | 33 | Glib::ustring ConfigurationLoader::readUserDefinedXML() { 34 | this->logger->debug(this->translator->trns("Reading user defined XML")); 35 | Glib::ustring container; 36 | 37 | std::string userHome(std::getenv("HOME")); 38 | 39 | this->logger->debug( 40 | Glib::ustring::compose( 41 | this->translator->trns("User defined XML path: %1"), 42 | userHome + "/.drirc" 43 | ) 44 | ); 45 | std::ifstream input(userHome + "/.drirc"); 46 | 47 | if (!input.good()) { 48 | this->logger->debug(this->translator->trns("User defined XML doesn't exist")); 49 | return container; 50 | } 51 | 52 | std::ostringstream buffer; 53 | buffer << input.rdbuf(); 54 | 55 | container = buffer.str(); 56 | 57 | return container; 58 | } 59 | 60 | std::list ConfigurationLoader::loadDriverSpecificConfiguration(const Glib::ustring &locale) { 61 | return this->displayQuery->queryDriverConfigurationOptions(locale); 62 | } 63 | 64 | std::map ConfigurationLoader::loadAvailableGPUs(const Glib::ustring &locale) { 65 | return this->driQuery.enumerateDRIDevices(locale); 66 | } 67 | 68 | std::list ConfigurationLoader::loadSystemWideConfiguration() { 69 | this->logger->debug(this->translator->trns("Reading system-wide XML")); 70 | std::list systemWideDevices; 71 | 72 | std::vector configurationPaths; 73 | boost::filesystem::path configurationPath = this->getSystemWideConfigurationPath(); 74 | this->logger->debug( 75 | Glib::ustring::compose( 76 | this->translator->trns("System-wide XML path: %1"), 77 | configurationPath.c_str() 78 | ) 79 | ); 80 | if (boost::filesystem::exists(configurationPath)) { 81 | for (const auto &file : boost::filesystem::directory_iterator(configurationPath)) { 82 | if (!boost::filesystem::is_directory(file)) { 83 | configurationPaths.emplace_back(file.path().string()); 84 | } 85 | } 86 | 87 | std::sort(configurationPaths.begin(), configurationPaths.end()); 88 | 89 | for (auto &filename : configurationPaths) { 90 | this->logger->debug( 91 | Glib::ustring::compose( 92 | this->translator->trns("Found configuration on path: %1"), 93 | filename 94 | ) 95 | ); 96 | Glib::ustring container; 97 | std::ostringstream buffer; 98 | std::ifstream input(filename); 99 | if (!input.good()) { 100 | this->logger->debug( 101 | Glib::ustring::compose( 102 | this->translator->trns("Failed to load file: %1"), 103 | filename 104 | ) 105 | ); 106 | continue; 107 | } 108 | 109 | buffer << input.rdbuf(); 110 | container = buffer.str(); 111 | std::list justLoadedDevices = this->parser->parseDevices(container); 112 | 113 | this->resolver->mergeConfigurationOnTopOf(systemWideDevices, justLoadedDevices); 114 | } 115 | } else { 116 | this->logger->warning(this->translator->trns("System-wide configuration path doesn't exist!")); 117 | } 118 | 119 | Glib::ustring systemWideXML = this->readSystemWideXML(); 120 | if (!systemWideXML.empty()) { 121 | std::list justLoadedDevices = this->parser->parseDevices(systemWideXML); 122 | this->resolver->mergeConfigurationOnTopOf(systemWideDevices, justLoadedDevices); 123 | } 124 | 125 | /* In case no configuration is available system-wide we generate an empty one */ 126 | if (systemWideDevices.empty()) { 127 | Device_ptr fakeDevice = std::make_shared(); 128 | systemWideDevices.emplace_back(fakeDevice); 129 | } 130 | 131 | return systemWideDevices; 132 | } 133 | 134 | std::list ConfigurationLoader::loadUserDefinedConfiguration() { 135 | Glib::ustring userDefinedXML(this->readUserDefinedXML()); 136 | if (userDefinedXML.empty()) { 137 | this->logger->debug( 138 | this->translator->trns("User defined configuration is empty. Returning an empty object") 139 | ); 140 | std::list deviceList; 141 | return deviceList; 142 | } 143 | return this->parser->parseDevices(userDefinedXML); 144 | } 145 | 146 | Glib::ustring ConfigurationLoader::getOldSystemWideConfigurationPath() { 147 | Glib::ustring path(SYSCONFDIR "/drirc"); 148 | std::ifstream flatpakInfo("/.flatpak-info"); 149 | 150 | if (flatpakInfo.good()) { 151 | path = "/var/run/host" SYSCONFDIR "/drirc"; 152 | } 153 | 154 | return path; 155 | } 156 | 157 | boost::filesystem::path ConfigurationLoader::getSystemWideConfigurationPath() { 158 | std::ifstream flatpakInfo("/.flatpak-info"); 159 | 160 | if (flatpakInfo.good()) { 161 | return boost::filesystem::path("/var/run/host" DATADIR); 162 | } 163 | 164 | return boost::filesystem::path(DATADIR); 165 | } 166 | 167 | ConfigurationLoader::ConfigurationLoader( 168 | const DRIQuery &driQuery, 169 | DisplayServerQueryInterface *displayQuery, 170 | LoggerInterface *logger, 171 | TranslatorInterface *translator, 172 | ParserInterface *parser, 173 | ConfigurationResolverInterface *resolver 174 | ) 175 | : driQuery(driQuery), 176 | displayQuery(displayQuery), 177 | logger(logger), 178 | translator(translator), 179 | parser(parser), 180 | resolver(resolver) {} 181 | -------------------------------------------------------------------------------- /flatpak/br.com.jeanhertel.adriconf.json: -------------------------------------------------------------------------------- 1 | { 2 | "app-id": "br.com.jeanhertel.adriconf", 3 | "runtime": "org.freedesktop.Platform", 4 | "runtime-version": "19.08", 5 | "sdk": "org.freedesktop.Sdk", 6 | "command": "adriconf", 7 | "finish-args": [ 8 | "--socket=x11", 9 | "--socket=wayland", 10 | "--share=ipc", 11 | "--device=dri", 12 | "--filesystem=~/.drirc", 13 | "--filesystem=/etc/drirc:ro", 14 | "--filesystem=/usr/share/drirc.d/:ro" 15 | ], 16 | "cleanup": [ 17 | "/include", 18 | "/lib/pkgconfig", 19 | "*.a", 20 | "*.la" 21 | ], 22 | "modules": [ 23 | { 24 | "name": "boost", 25 | "buildsystem": "simple", 26 | "sources": [ 27 | { 28 | "type": "archive", 29 | "url": "https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.bz2", 30 | "sha256": "7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7" 31 | } 32 | ], 33 | "build-commands": [ 34 | "./bootstrap.sh", 35 | "./b2 install --prefix=/app --with-locale --with-filesystem -j $FLATPAK_BUILDER_N_JOBS define=\"BOOST_SYSTEM_NO_DEPRECATED\" -sNO_BZIP2=1 cxxflags=-fPIC cflags=-fPIC" 36 | ] 37 | }, 38 | { 39 | "name": "sigc++", 40 | "config-opts": [ 41 | "--disable-documentation" 42 | ], 43 | "cleanup": [ 44 | "/lib/sigc++-2.0" 45 | ], 46 | "sources": [ 47 | { 48 | "type": "archive", 49 | "url": "https://ftp.acc.umu.se/pub/GNOME/sources/libsigc++/2.10/libsigc++-2.10.0.tar.xz", 50 | "sha256": "f843d6346260bfcb4426259e314512b99e296e8ca241d771d21ac64f28298d81" 51 | } 52 | ] 53 | }, 54 | { 55 | "name": "cairomm", 56 | "config-opts": [ 57 | "--disable-documentation" 58 | ], 59 | "cleanup": [ 60 | "/lib/cairomm-1.0" 61 | ], 62 | "sources": [ 63 | { 64 | "type": "archive", 65 | "url": "https://ftp.acc.umu.se/pub/GNOME/sources/cairomm/1.12/cairomm-1.12.0.tar.xz", 66 | "sha256": "a54ada8394a86182525c0762e6f50db6b9212a2109280d13ec6a0b29bfd1afe6" 67 | } 68 | ] 69 | }, 70 | { 71 | "name": "glibmm", 72 | "config-opts": [ 73 | "--disable-documentation" 74 | ], 75 | "cleanup": [ 76 | "/lib/glibmm-2.4", 77 | "/lib/giomm-2.4" 78 | ], 79 | "sources": [ 80 | { 81 | "type": "archive", 82 | "url": "https://ftp.acc.umu.se/pub/GNOME/sources/glibmm/2.56/glibmm-2.56.0.tar.xz", 83 | "sha256": "6e74fcba0d245451c58fc8a196e9d103789bc510e1eee1a9b1e816c5209e79a9" 84 | } 85 | ] 86 | }, 87 | { 88 | "name": "pangomm", 89 | "config-opts": [ 90 | "--disable-documentation" 91 | ], 92 | "cleanup": [ 93 | "/lib/pangomm-1.4" 94 | ], 95 | "sources": [ 96 | { 97 | "type": "archive", 98 | "url": "https://ftp.acc.umu.se/pub/GNOME/sources/pangomm/2.40/pangomm-2.40.1.tar.xz", 99 | "sha256": "9762ee2a2d5781be6797448d4dd2383ce14907159b30bc12bf6b08e7227be3af" 100 | } 101 | ] 102 | }, 103 | { 104 | "name": "atkmm", 105 | "config-opts": [ 106 | "--disable-documentation" 107 | ], 108 | "cleanup": [ 109 | "/lib/atkmm-1.6" 110 | ], 111 | "sources": [ 112 | { 113 | "type": "archive", 114 | "url": "https://ftp.acc.umu.se/pub/GNOME/sources/atkmm/2.24/atkmm-2.24.2.tar.xz", 115 | "sha256": "ff95385759e2af23828d4056356f25376cfabc41e690ac1df055371537e458bd" 116 | } 117 | ] 118 | }, 119 | { 120 | "name": "gtkmm", 121 | "config-opts": [ 122 | "--disable-documentation" 123 | ], 124 | "cleanup": [ 125 | "/lib/gtkmm-3.0", 126 | "/lib/gdkmm-3.0" 127 | ], 128 | "sources": [ 129 | { 130 | "type": "archive", 131 | "url": "https://ftp.acc.umu.se/pub/GNOME/sources/gtkmm/3.22/gtkmm-3.22.2.tar.xz", 132 | "sha256": "91afd98a31519536f5f397c2d79696e3d53143b80b75778521ca7b48cb280090" 133 | } 134 | ] 135 | }, 136 | { 137 | "name": "libxml++-2.6", 138 | "config-opts": [ 139 | "--disable-documentation" 140 | ], 141 | "cleanup": [ 142 | "/lib/libxml++-2.6" 143 | ], 144 | "sources": [ 145 | { 146 | "type": "archive", 147 | "url": "https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/libxml++2.6/2.40.1-2/libxml++2.6_2.40.1.orig.tar.xz", 148 | "sha256": "4ad4abdd3258874f61c2e2a41d08e9930677976d303653cd1670d3e9f35463e9" 149 | } 150 | ] 151 | }, 152 | { 153 | "name": "libpci", 154 | "cleanup": [ 155 | "/sbin", 156 | "/man" 157 | ], 158 | "sources": [ 159 | { 160 | "type": "archive", 161 | "url": "https://www.kernel.org/pub/software/utils/pciutils/pciutils-3.6.2.tar.xz", 162 | "md5": "77963796d1be4f451b83e6da28ba4f82" 163 | } 164 | ], 165 | "no-autogen": true, 166 | "make-args": [ 167 | "SHARED=yes", 168 | "PREFIX=/app", 169 | "SHAREDIR=/app/share/hwdata" 170 | ], 171 | "make-install-args": [ 172 | "SHARED=yes", 173 | "PREFIX=/app", 174 | "SHAREDIR=/app/share/hwdata", 175 | "install-lib" 176 | ] 177 | }, 178 | { 179 | "name": "adriconf", 180 | "buildsystem": "cmake-ninja", 181 | "config-opts": ["-DENABLE_UNIT_TESTS=0"], 182 | "sources": [ 183 | { 184 | "type": "git", 185 | "url": "https://github.com/jlHertel/adriconf", 186 | "tag": "v1.6.1" 187 | }, 188 | { 189 | "type": "file", 190 | "path": "br.com.jeanhertel.adriconf.appdata.xml" 191 | } 192 | ], 193 | "build-commands": [ 194 | "install -Dm644 br.com.jeanhertel.adriconf.appdata.xml /app/share/appdata/br.com.jeanhertel.adriconf.appdata.xml", 195 | "install -Dm644 flatpak/br.com.jeanhertel.adriconf.desktop /app/share/applications/br.com.jeanhertel.adriconf.desktop", 196 | "install -Dm644 flatpak/br.com.jeanhertel.adriconf.png /app/share/icons/hicolor/256x256/apps/br.com.jeanhertel.adriconf.png" 197 | ] 198 | } 199 | ] 200 | } 201 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.8) 2 | project(adriconf) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | 6 | option(ENABLE_UNIT_TESTS "Enables building Unit tests" ON) 7 | set(TOP_CMAKE_WAS_CALLED TRUE) 8 | 9 | set(SYSCONFDIR "/etc" CACHE PATH "The path to read system-wide configuration. Equivalent to mesa SYSCONFDIR option") 10 | add_definitions(-DSYSCONFDIR="${SYSCONFDIR}") 11 | 12 | set(DATADIR "/usr/share/drirc.d" CACHE PATH "The path to read system-wide configurations. Equivalent to mesa DATADIR option") 13 | add_definitions(-DDATADIR="${DATADIR}") 14 | 15 | # Setup version string 16 | if(EXISTS "${CMAKE_SOURCE_DIR}/.git") 17 | execute_process( 18 | COMMAND git log -1 --format=%h 19 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 20 | OUTPUT_VARIABLE GIT_COMMIT_HASH 21 | OUTPUT_STRIP_TRAILING_WHITESPACE 22 | ) 23 | else() 24 | set(GIT_COMMIT_HASH "UNKNOWN") 25 | endif() 26 | 27 | file (STRINGS "VERSION" BUILD_VERSION_NUMBER) 28 | 29 | configure_file( 30 | ${CMAKE_SOURCE_DIR}/adriconf/version.h.in 31 | ${CMAKE_BINARY_DIR}/generated/version.h 32 | ) 33 | 34 | include_directories(${CMAKE_BINARY_DIR}/generated) 35 | 36 | find_package(PkgConfig REQUIRED) 37 | set(OpenGL_GL_PREFERENCE "GLVND") 38 | find_package(OpenGL REQUIRED) 39 | 40 | # GTKMM 41 | pkg_check_modules(GTKMM REQUIRED gtkmm-3.0) 42 | 43 | # BOOST 44 | find_package(Boost 1.60 REQUIRED COMPONENTS locale filesystem system) 45 | 46 | # LIBXML 47 | pkg_check_modules(LibXML++ libxml++-3.0) 48 | if (NOT LibXML++_FOUND) 49 | pkg_check_modules(LibXML++2 REQUIRED libxml++-2.6) 50 | set(LibXML++_INCLUDE_DIRS ${LibXML++2_INCLUDE_DIRS}) 51 | set(LibXML++_LIBRARIES ${LibXML++2_LIBRARIES}) 52 | endif () 53 | 54 | # X11 55 | pkg_check_modules(X11 REQUIRED x11) 56 | 57 | # LIBDRM 58 | pkg_check_modules(DRM REQUIRED libdrm) 59 | 60 | # GBM 61 | pkg_check_modules(GBM REQUIRED gbm) 62 | 63 | # LIBPCI 64 | pkg_check_modules(PCILIB REQUIRED libpci) 65 | 66 | # INTL 67 | find_package(Intl REQUIRED) 68 | find_package(Gettext REQUIRED) 69 | include_directories(${INTL_INCLUDE_DIRS}) 70 | link_directories(${INTL_LIBRARY_DIRS}) 71 | 72 | #EGL 73 | pkg_check_modules(EGL REQUIRED egl) 74 | 75 | #INTL INSTALL TRANSLATIONS 76 | GETTEXT_CREATE_TRANSLATIONS(po/adriconf.pot ALL po/en.po po/hr.po po/lv.po po/pt_BR.po po/zh_CN.po) 77 | 78 | set(SHARED_SOURCE_FILES 79 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Device.cpp 80 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Device.h 81 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverOption.cpp 82 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverOption.h 83 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Section.cpp 84 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Section.h 85 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverConfiguration.cpp 86 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverConfiguration.h 87 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GPUInfo.cpp 88 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GPUInfo.h 89 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Application.cpp 90 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Application.h 91 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/ApplicationOption.cpp 92 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/ApplicationOption.h 93 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/ComboBoxColumn.h 94 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverOptionType.h 95 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GBMDevice.cpp 96 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GBMDevice.h 97 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/EGLDisplayWrapper.cpp 98 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/EGLDisplayWrapper.h 99 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DRMDeviceInterface.h 100 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DRMDevice.h 101 | ${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DRMDevice.cpp 102 | 103 | ${CMAKE_SOURCE_DIR}/adriconf/Logging/LoggerInterface.h 104 | ${CMAKE_SOURCE_DIR}/adriconf/Logging/LoggerLevel.h 105 | 106 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/ParserInterface.h 107 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationResolverInterface.h 108 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/DRIQuery.cpp 109 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/DRIQuery.h 110 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/WriterInterface.h 111 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationLoaderInterface.h 112 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/PCIDatabaseQuery.cpp 113 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/PCIDatabaseQuery.h 114 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/PCIDatabaseQueryInterface.h 115 | 116 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/Parser.h 117 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/Parser.cpp 118 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationResolver.cpp 119 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationResolver.h 120 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/Writer.cpp 121 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/Writer.h 122 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationLoader.cpp 123 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationLoader.h 124 | 125 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/GBMDeviceFactoryInterface.h 126 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/GBMDeviceFactory.cpp 127 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/GBMDeviceFactory.h 128 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/EGLDisplayFactoryInterface.h 129 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/EGLDisplayFactory.cpp 130 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/EGLDisplayFactory.h 131 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/DRMDeviceFactoryInterface.h 132 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/DRMDeviceFactory.cpp 133 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/DRMDeviceFactory.h 134 | ${CMAKE_SOURCE_DIR}/adriconf/Translation/TranslatorInterface.h 135 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/DisplayServerQueryInterface.h 136 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/WaylandQuery.cpp 137 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/WaylandQuery.h 138 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/XorgQuery.cpp 139 | ${CMAKE_SOURCE_DIR}/adriconf/Utils/XorgQuery.h 140 | 141 | ${CMAKE_SOURCE_DIR}/adriconf/GUI.cpp 142 | ${CMAKE_SOURCE_DIR}/adriconf/GUI.h 143 | ) 144 | 145 | # GTest and GMock setup 146 | if (ENABLE_UNIT_TESTS) 147 | configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) 148 | execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" . 149 | WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download" ) 150 | execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download" ) 151 | 152 | set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) 153 | 154 | add_subdirectory("${CMAKE_BINARY_DIR}/googletest-src" "${CMAKE_BINARY_DIR}/googletest-build") 155 | add_subdirectory(tests) 156 | endif() 157 | 158 | add_subdirectory(adriconf) 159 | 160 | -------------------------------------------------------------------------------- /po/adriconf.pot: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: 1.0.1\n" 10 | "Report-Msgid-Bugs-To: Jean Lorenz Hertel \n" 11 | "POT-Creation-Date: 2018-08-06 08:10-0300\n" 12 | "PO-Revision-Date: 2020-01-26 19:10-0300\n" 13 | "Last-Translator: Jean Lorenz Hertel \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: \n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: ../main.cpp:46 21 | msgid "Creating the GTK application object" 22 | msgstr "" 23 | 24 | #: ../main.cpp:63 25 | msgid "adriconf running on Wayland" 26 | msgstr "" 27 | 28 | #: ../main.cpp:66 29 | msgid "adriconf running on X11" 30 | msgstr "" 31 | 32 | #: ../main.cpp:70 33 | msgid "Checking if the system is supported" 34 | msgstr "" 35 | 36 | #: ../GUI.cpp:62 37 | msgid "Start building GTK gui" 38 | msgstr "" 39 | 40 | #: ../GUI.cpp:71 41 | msgid "Main window object is not in glade file!" 42 | msgstr "" 43 | 44 | #: ../GUI.cpp:96 45 | msgid "Add new" 46 | msgstr "" 47 | 48 | #: ../GUI.cpp:108 49 | msgid "Remove current Application" 50 | msgstr "" 51 | 52 | #: ../GUI.cpp:139 53 | msgid "Generating final XML for saving..." 54 | msgstr "" 55 | 56 | #: ../GUI.cpp:146 57 | msgid "Writing generated XML: %1" 58 | msgstr "" 59 | 60 | #: ../GUI.cpp:168 61 | msgid "Current language code is %1" 62 | msgstr "" 63 | 64 | #: ../GUI.cpp:211 65 | msgid "Driver %1 not found" 66 | msgstr "" 67 | 68 | #: ../GUI.cpp:278 69 | msgid "Application %1 not found" 70 | msgstr "" 71 | 72 | #: ../GUI.cpp:314 73 | msgid "Notebook object not found in glade file!" 74 | msgstr "" 75 | 76 | #: ../GUI.cpp:359 77 | msgid "Option %1 doesn't exist in application %2. Merge failed" 78 | msgstr "" 79 | 80 | #: ../GUI.cpp:491 81 | msgid "Use default GPU of screen" 82 | msgstr "" 83 | 84 | #: ../GUI.cpp:518 85 | msgid "Force Application to use GPU" 86 | msgstr "" 87 | 88 | #: ../GUI.cpp:533 89 | msgid "PRIME Settings" 90 | msgstr "" 91 | 92 | #: ../GUI.cpp:638 93 | msgid "An advanced DRI configurator tool." 94 | msgstr "" 95 | 96 | #: ../GUI.cpp:642 97 | msgid "Source Code" 98 | msgstr "" 99 | 100 | #: ../GUI.cpp:658 101 | msgid "Unexpected response code from about dialog: %1" 102 | msgstr "" 103 | 104 | #: ../GUI.cpp:678 105 | msgid "The default application cannot be removed." 106 | msgstr "" 107 | 108 | #: ../GUI.cpp:679 109 | msgid "The driver needs a default configuration." 110 | msgstr "" 111 | 112 | #: ../GUI.cpp:692 113 | msgid "Application removed successfully." 114 | msgstr "" 115 | 116 | #: ../GUI.cpp:693 117 | msgid "The application has been removed." 118 | msgstr "" 119 | 120 | #: ../GUI.cpp:708 121 | msgid "Add Application dialog is not in glade file!" 122 | msgstr "" 123 | 124 | #: ../GUI.cpp:714 125 | msgid "Add Application app name widget is not in glade file!" 126 | msgstr "" 127 | 128 | #: ../GUI.cpp:721 129 | msgid "Add Application app executable widget is not in glade file!" 130 | msgstr "" 131 | 132 | #: ../GUI.cpp:728 133 | msgid "Add Application app driver widget is not in glade file!" 134 | msgstr "" 135 | 136 | #: ../GUI.cpp:751 137 | msgid "Validation error" 138 | msgstr "" 139 | 140 | #: ../GUI.cpp:753 141 | msgid "You need to specify the application name, executable and driver." 142 | msgstr "" 143 | 144 | #: ../GUI.cpp:776 145 | msgid "Application successfully added." 146 | msgstr "" 147 | 148 | #: ../GUI.cpp:778 149 | msgid "The application was successfully added. Reloading default app options." 150 | msgstr "" 151 | 152 | #: ../ValueObject/EGLDisplayWrapper.cpp:37 153 | msgid "Display is missing EGL_MESA_query_driver extension" 154 | msgstr "" 155 | 156 | #: ../Utils/ConfigurationLoader.cpp:10 157 | msgid "Reading legacy system-wide XML" 158 | msgstr "" 159 | 160 | #: ../Utils/ConfigurationLoader.cpp:17 161 | msgid "Legacy system-wide XML path: %1" 162 | msgstr "" 163 | 164 | #: ../Utils/ConfigurationLoader.cpp:24 165 | msgid "Legacy system-wide file doesn't exist" 166 | msgstr "" 167 | 168 | #: ../Utils/ConfigurationLoader.cpp:35 169 | msgid "Reading user defined XML" 170 | msgstr "" 171 | 172 | #: ../Utils/ConfigurationLoader.cpp:42 173 | msgid "User defined XML path: %1" 174 | msgstr "" 175 | 176 | #: ../Utils/ConfigurationLoader.cpp:49 177 | msgid "User defined XML doesn't exist" 178 | msgstr "" 179 | 180 | #: ../Utils/ConfigurationLoader.cpp:70 181 | msgid "Reading system-wide XML" 182 | msgstr "" 183 | 184 | #: ../Utils/ConfigurationLoader.cpp:77 185 | msgid "System-wide XML path: %1" 186 | msgstr "" 187 | 188 | #: ../Utils/ConfigurationLoader.cpp:93 189 | msgid "Found configuration on path: %1" 190 | msgstr "" 191 | 192 | #: ../Utils/ConfigurationLoader.cpp:103 193 | msgid "Failed to load file: %1" 194 | msgstr "" 195 | 196 | #: ../Utils/ConfigurationLoader.cpp:117 197 | msgid "System-wide configuration path doesn't exist!" 198 | msgstr "" 199 | 200 | #: ../Utils/ConfigurationLoader.cpp:139 201 | msgid "User defined configuration is empty. Returning an empty object" 202 | msgstr "" 203 | 204 | #: ../Utils/ConfigurationResolver.cpp:213 205 | msgid "Driver '%1' doesn't support option '%2' on application '%3'. Option removed." 206 | msgstr "" 207 | 208 | #: ../Utils/ConfigurationResolver.cpp:380 209 | msgid "User-defined driver '%1' on screen '%2' doesn't have a driver loaded on system. Configuration removed." 210 | msgstr "" 211 | 212 | #: ../Utils/DRIQuery.cpp:28 213 | msgid "Enumerating DRI Devices" 214 | msgstr "" 215 | 216 | #: ../Utils/DRIQuery.cpp:33 217 | msgid "Found %1 devices" 218 | msgstr "" 219 | 220 | #: ../Utils/DRIQuery.cpp:45 221 | msgid "Processing GPU with PCI ID \"%1\"" 222 | msgstr "" 223 | 224 | #: ../Utils/DRIQuery.cpp:57 225 | msgid "GPU has been detected as \"%1\" from \"%2\"" 226 | msgstr "" 227 | 228 | #: ../Utils/DRIQuery.cpp:66 229 | msgid "Generating gbm device for path \"%1\"" 230 | msgstr "" 231 | 232 | #: ../Utils/DRIQuery.cpp:75 233 | msgid "Generating EGL Display from GBM device for \"%1\"" 234 | msgstr "" 235 | 236 | #: ../Utils/DRIQuery.cpp:84 237 | msgid "GPU \"%1\" has the driver \"%2\"" 238 | msgstr "" 239 | 240 | #: ../Utils/DRIQuery.cpp:90 241 | msgid "Loading driver options" 242 | msgstr "" 243 | 244 | #: ../Utils/DRIQuery.cpp:97 245 | msgid "Unable to extract configuration for driver %1" 246 | msgstr "" 247 | 248 | #: ../Utils/DRIQuery.cpp:124 249 | msgid "Skipping device %1 due to error: %2" 250 | msgstr "" 251 | 252 | #: ../Utils/EGLDisplayFactory.cpp:14 253 | msgid "Failed to create EGL display" 254 | msgstr "" 255 | 256 | #: ../Utils/EGLDisplayFactory.cpp:20 257 | msgid "Failed to initialize EGL display" 258 | msgstr "" 259 | 260 | #: ../Utils/GBMDeviceFactory.cpp:11 261 | msgid "Failed to open device %1" 262 | msgstr "" 263 | 264 | #: ../Utils/GBMDeviceFactory.cpp:18 265 | msgid "Failed to create GBM device for %1" 266 | msgstr "" 267 | 268 | #: ../Utils/Parser.cpp:6 269 | msgid "Parsing XML %1" 270 | msgstr "" 271 | 272 | #: ../Utils/Parser.cpp:128 273 | msgid "Parsing device for XML: %1" 274 | msgstr "" 275 | 276 | #: ../Utils/Parser.cpp:167 277 | msgid "Exception caught during device XML parsing: %1" 278 | msgstr "" 279 | 280 | #: ../Utils/WaylandQuery.cpp:57 281 | msgid "Driver doesn't support extension \"EGL_MESA_query_driver\"" 282 | msgstr "" 283 | 284 | #: ../Utils/XorgQuery.cpp:15 285 | msgid "Couldn't open X display" 286 | msgstr "" 287 | 288 | #: ../Utils/XorgQuery.cpp:31 289 | msgid "Unable to extract driver name for screen %1" 290 | msgstr "" 291 | 292 | #: ../Utils/XorgQuery.cpp:85 293 | msgid "Missing GLX_MESA_query_renderer extension. Probably this is a closed-source driver." 294 | msgstr "" 295 | 296 | #: ../DriConf.glade.h:1 297 | msgid "_File" 298 | msgstr "" 299 | 300 | #: ../DriConf.glade.h:2 301 | msgid "_Application" 302 | msgstr "" 303 | 304 | #: ../DriConf.glade.h:3 305 | msgid "_Help" 306 | msgstr "" 307 | 308 | #: ../DriConf.glade.h:4 309 | msgid "Cancel" 310 | msgstr "" 311 | 312 | #: ../DriConf.glade.h:5 313 | msgid "Application name:" 314 | msgstr "" 315 | 316 | #: ../DriConf.glade.h:6 317 | msgid "Application executable:" 318 | msgstr "" 319 | 320 | #: ../DriConf.glade.h:7 321 | msgid "Driver:" 322 | msgstr "" -------------------------------------------------------------------------------- /adriconf/Utils/Parser.cpp: -------------------------------------------------------------------------------- 1 | #include "Parser.h" 2 | #include 3 | 4 | std::list
5 | Parser::parseAvailableConfiguration(const Glib::ustring &xml, const Glib::ustring ¤tLocale) { 6 | this->logger->debug(Glib::ustring::compose(this->translator->trns("Parsing XML %1"), xml)); 7 | std::list
availableSections; 8 | try { 9 | xmlpp::DomParser parser; 10 | parser.set_throw_messages(true); 11 | parser.set_substitute_entities(true); 12 | parser.set_include_default_attributes(true); 13 | parser.parse_memory(xml); 14 | 15 | if (parser) { 16 | auto rootNode = parser.get_document()->get_root_node(); 17 | 18 | auto sections = rootNode->get_children("section"); 19 | for (auto section : sections) { 20 | Section confSection; 21 | 22 | 23 | auto descriptions = section->get_children("description"); 24 | Glib::ustring englishName; 25 | Glib::ustring localizedName; 26 | 27 | for (auto description : descriptions) { 28 | auto descriptionElement = dynamic_cast(description); 29 | Glib::ustring lang(descriptionElement->get_attribute("lang")->get_value()); 30 | Glib::ustring value(descriptionElement->get_attribute("text")->get_value()); 31 | 32 | if (lang == "en") { 33 | englishName = value; 34 | } 35 | 36 | if (lang == currentLocale) { 37 | localizedName = value; 38 | } 39 | } 40 | 41 | confSection.setDescription(localizedName.empty() ? englishName : localizedName); 42 | 43 | auto options = section->get_children("option"); 44 | 45 | for (auto option : options) { 46 | auto parsedOption = parseSectionOptions(option, currentLocale); 47 | 48 | confSection.addOption(parsedOption); 49 | } 50 | 51 | availableSections.push_back(confSection); 52 | } 53 | } 54 | 55 | } catch (const std::exception &ex) { 56 | this->logger->error(Glib::ustring::compose("LibXML exception caught: %1", ex.what())); 57 | this->logger->error(Glib::ustring::compose("XML Parsed: %1", xml)); 58 | } 59 | 60 | return availableSections; 61 | } 62 | 63 | DriverOption Parser::parseSectionOptions(xmlpp::Node *option, const Glib::ustring ¤tLocale) { 64 | DriverOption parsedOption; 65 | 66 | auto optionElement = dynamic_cast(option); 67 | 68 | parsedOption.setName(optionElement->get_attribute("name")->get_value()); 69 | Glib::ustring type = optionElement->get_attribute("type")->get_value(); 70 | parsedOption.setType(parsedOption.stringToEnum(type)); 71 | 72 | auto defaultValue = optionElement->get_attribute("default"); 73 | if (defaultValue != nullptr) { 74 | parsedOption.setDefaultValue(defaultValue->get_value()); 75 | } 76 | 77 | auto validValues = optionElement->get_attribute("valid"); 78 | if (validValues != nullptr) { 79 | parsedOption.setValidValues(validValues->get_value()); 80 | } 81 | 82 | auto descriptions = option->get_children("description"); 83 | 84 | xmlpp::Node *descriptionHolder = nullptr; 85 | Glib::ustring correctDescription; 86 | 87 | for (auto description : descriptions) { 88 | auto descriptionElement = dynamic_cast(description); 89 | Glib::ustring lang(descriptionElement->get_attribute("lang")->get_value()); 90 | Glib::ustring value(descriptionElement->get_attribute("text")->get_value()); 91 | 92 | if (lang == "en") { 93 | if (correctDescription.empty()) { 94 | correctDescription = value; 95 | descriptionHolder = description; 96 | } 97 | } 98 | 99 | if (lang == currentLocale) { 100 | correctDescription = value; 101 | descriptionHolder = description; 102 | } 103 | } 104 | 105 | parsedOption.setDescription(correctDescription); 106 | 107 | if (parsedOption.getType() == DriverOptionType::ENUM) { 108 | if (descriptionHolder != nullptr) { 109 | auto enumOptions = descriptionHolder->get_children("enum"); 110 | for (auto enumOption : enumOptions) { 111 | auto enumElement = dynamic_cast(enumOption); 112 | Glib::ustring value(enumElement->get_attribute("value")->get_value()); 113 | Glib::ustring text(enumElement->get_attribute("text")->get_value()); 114 | 115 | parsedOption.addEnumValue(text, value); 116 | } 117 | } 118 | } 119 | 120 | parsedOption.updateFakeBool(); 121 | 122 | return parsedOption; 123 | } 124 | 125 | std::list Parser::parseDevices(Glib::ustring &xml) { 126 | std::list deviceList; 127 | 128 | this->logger->debug(Glib::ustring::compose(this->translator->trns("Parsing device for XML: %1"), xml)); 129 | try { 130 | xmlpp::DomParser parser; 131 | parser.set_throw_messages(true); 132 | parser.set_substitute_entities(true); 133 | parser.set_include_default_attributes(true); 134 | parser.parse_memory(xml); 135 | 136 | if (parser) { 137 | auto rootNode = parser.get_document()->get_root_node(); 138 | 139 | auto devices = rootNode->get_children("device"); 140 | for (auto device : devices) { 141 | auto deviceConf = std::make_shared(); 142 | 143 | auto deviceElement = dynamic_cast(device); 144 | auto deviceScreen = deviceElement->get_attribute("screen"); 145 | if (deviceScreen != nullptr) { 146 | deviceConf->setScreen(std::stoi(deviceScreen->get_value())); 147 | } 148 | 149 | auto deviceDriver = deviceElement->get_attribute("driver"); 150 | if (deviceDriver != nullptr) { 151 | deviceConf->setDriver(deviceDriver->get_value()); 152 | } 153 | 154 | auto applications = device->get_children("application"); 155 | 156 | for (auto application : applications) { 157 | auto parsedApp = parseApplication(application); 158 | deviceConf->addApplication(parsedApp); 159 | } 160 | 161 | deviceList.emplace_back(deviceConf); 162 | } 163 | } 164 | } catch (const std::exception &ex) { 165 | this->logger->error( 166 | Glib::ustring::compose( 167 | this->translator->trns("Exception caught during device XML parsing: %1"), 168 | ex.what() 169 | ) 170 | ); 171 | } 172 | 173 | return deviceList; 174 | } 175 | 176 | Application_ptr Parser::parseApplication(xmlpp::Node *application) { 177 | auto app = std::make_shared(); 178 | 179 | auto applicationElement = dynamic_cast(application); 180 | 181 | auto applicationName = applicationElement->get_attribute("name"); 182 | if (applicationName != nullptr) { 183 | app->setName(applicationName->get_value()); 184 | } 185 | 186 | auto applicationExecutable = applicationElement->get_attribute("executable"); 187 | if (applicationExecutable != nullptr) { 188 | app->setExecutable(applicationExecutable->get_value()); 189 | } 190 | 191 | auto options = application->get_children("option"); 192 | 193 | for (auto option : options) { 194 | auto optionElement = dynamic_cast(option); 195 | auto optionName = optionElement->get_attribute("name"); 196 | auto optionValue = optionElement->get_attribute("value"); 197 | if (optionName != nullptr && optionValue != nullptr) { 198 | auto newOption = std::make_shared(); 199 | newOption->setName(optionName->get_value()); 200 | newOption->setValue(optionValue->get_value()); 201 | 202 | app->addOption(newOption); 203 | } 204 | } 205 | 206 | return app; 207 | } -------------------------------------------------------------------------------- /flatpak/br.com.jeanhertel.adriconf.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | br.com.jeanhertel.adriconf 5 | CC0-1.0 6 | LGPL-3.0+ AND GPL-3.0+ 7 | adriconf 8 | Advanced DRI configurator 9 | 10 |

adriconf (Advanced DRI CONFigurator) is a GUI tool used to configure open source graphics drivers. It works by setting options and writing them to the standard drirc file used by the Mesa drivers.

11 |

A GUI Tool used to configure OpenGL drivers. You can use it to optimize game settings or even workaround issues with them.

12 |
13 | 14 |

adriconf (Advanced DRI CONFigurator) é uma ferramenta visual utilizada para configurar os drivers gráficos open source. Ele funciona definindo e escrevendo opções para o arquivo padrão drirc utilizado pelos drivers Mesa.

15 |

Uma ferramenta visual utilizada para configurar drivers OpenGL. Você pode utilizá-lo para otimizar as configurações de jogos ou até mesmo corrigir problemas conhecidos.

16 |
17 | br.com.jeanhertel.adriconf.desktop 18 | 19 | 20 | Performance Window 21 | https://github.com/jlHertel/adriconf/blob/master/flatpak/br.com.jeanhertel.adriconf.screenshot-0.png?raw=true 22 | 23 | 24 | Debugging Window 25 | https://github.com/jlHertel/adriconf/blob/master/flatpak/br.com.jeanhertel.adriconf.screenshot-1.png?raw=true 26 | 27 | 28 | 29 | 30 | 31 |

This is a bug-fix release to address small issues with the latest release.

32 |
    33 |
  • Make EGL mandatory for building. @jlHertel
  • 34 |
  • Update translation files with latest text. @jlHertel
  • 35 |
  • Fix incorrect flag usage during GBM device creation. @jlHertel
  • 36 |
  • Always build Wayland support. @jlHertel
  • 37 |
38 |
39 |
40 | 41 | 42 |

This release has some bug-fixes but mostly is a rework in the code structure to better handle future changes

43 |
    44 |
  • Make sure we don't crash in case the new system-wide xml path is not available. @jlHertel
  • 45 |
  • Generate version in about dialog at compile time. @jlHertel
  • 46 |
  • Create EGL displays using GBM during gpu listing to avoid kernel driver names. @jlHertel
  • 47 |
  • Rework code for easy unit testing. @jlHertel
  • 48 |
  • Lower minimum desktop specification version for increased compatibility. @akien-mga
  • 49 |
  • Improve documentation around releasing new versions. @jlHertel
  • 50 |
51 |
52 |
53 | 54 | 55 |

This release is just a small bug-fix to disable building unit tests on flatpak builds.

56 |
57 |
58 | 59 | 60 |

This release is mostly bug-fixes and improvements to the general stability of the program. The source code has also been re-organized to make maintenance easier.

61 |
    62 |
  • Improve error handling for missing configurations and extensions. @jlHertel
  • 63 |
  • Restructure project to make it easier to maintain. @jlHertel
  • 64 |
  • Add support to read new MESA system-wide configuration path. @jlHertel
  • 65 |
  • Add initial Latvian translation. @Linards
  • 66 |
  • Add simplified Chinese translation. @wsxy162
  • 67 |
  • Improve unit tests. @jlHertel
  • 68 |
  • Add new debug option. @jlHertel
  • 69 |
70 |
71 |
72 | 73 | 74 |

This release finally brings the Wayland support along with some other fixes.

75 |
    76 |
  • Fix for AppStream validation @har9862
  • 77 |
  • Remove DEBIAN build instructions and any debian packaging related artifact as we now provide a flatpak package @jlHertel
  • 78 |
  • Remove glXQueryRendererIntegerMESA usage @velurimithun
  • 79 |
  • Update the translation files @velurimithun
  • 80 |
  • Allow to build with LibXML++ 3.0 @City-busz
  • 81 |
  • Add XWayland support to adriconf @velurimithun
  • 82 |
  • Don't bind the textdomain, so that we can properly get translations inside flatpak @jlHertel
  • 83 |
  • Add a AUTHORS and CONTRIBUTING file @jlHertel
  • 84 |
85 |
86 |
87 | 88 | 89 |

This is mostly a bug-fixing release.

90 |
    91 |
  • Make changes to packaging files @velurimithun
  • 92 |
  • Add pt_BR translation to flatpak data. Fixes #40
  • 93 |
  • Fixes incorrect image urls on flatpak metadata
  • 94 |
  • Fix uncaught exception when no user defined config file exists
  • 95 |
96 |
97 |
98 | 99 | 100 |

This release has the following improvements.

101 |
    102 |
  • Improve README and use the oficial GPL notice by @Calinou
  • 103 |
  • Fix minor issues with the debian package build
  • 104 |
  • Add an icon and desktop entry file by @velurimithun
  • 105 |
  • Add initial Flatpak support by @velurimithun
  • 106 |
107 |
108 |
109 | 110 | 111 |
    112 |
  • Add shorcuts for the common action in the menu (save, quit, new app, etc..)
  • 113 |
  • Properly link against GLVND-enabled systems
  • 114 |
  • Make GTKmm mandatory
  • 115 |
  • Make Boost.locale mandatory
  • 116 |
  • Explicitly declare dependencies of glib-compile-resources
  • 117 |
  • Add various test cases
  • 118 |
  • Properly handle closed-source drivers
  • 119 |
120 |
121 |
122 | 123 | 124 |

This is the first stable release.

125 |
126 |
127 | 128 | 129 |

First oficial release of the software.

130 |
    131 |
  • This is still an alpha version and crashes are expected!
  • 132 |
133 |
134 |
135 | 136 | 137 |
    138 |
  • Don't build units tests by default
  • 139 |
  • Fix installation of translations
  • 140 |
  • Added more unit tests
  • 141 |
  • Some cleanups to CMakeLists.txt to make it more readable
  • 142 |
143 |
144 |
145 |
146 | 147 | https://github.com/jlHertel/adriconf 148 | jean.hertel@hotmail.com 149 | Jean Hertel 150 |
-------------------------------------------------------------------------------- /po/zh_CN.po: -------------------------------------------------------------------------------- 1 | # Simplified Chinese translation of adriconf. 2 | # Copyright (C) 2019 adriconf'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the adriconf package. 4 | # Dingzhong Chen , 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: adriconf 1.0.1\n" 9 | "Report-Msgid-Bugs-To: Jean Lorenz Hertel \n" 10 | "POT-Creation-Date: 2018-08-06 08:10-0300\n" 11 | "PO-Revision-Date: 2019-09-08 02:02+0800\n" 12 | "Last-Translator: Dingzhong Chen \n" 13 | "Language-Team: \n" 14 | "Language: zh_CN\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 2.2.3\n" 19 | "Plural-Forms: nplurals=1; plural=0;\n" 20 | 21 | #: ../GUI.cpp:728 22 | msgid "Add Application app driver widget is not in glade file!" 23 | msgstr "“添加应用程序”应用驱动组件不在 glade 文件内!" 24 | 25 | #: ../GUI.cpp:721 26 | msgid "Add Application app executable widget is not in glade file!" 27 | msgstr "“添加应用程序”应用可执行文件组件不在 glade 文件内!" 28 | 29 | #: ../GUI.cpp:714 30 | msgid "Add Application app name widget is not in glade file!" 31 | msgstr "“添加应用程序”应用名组件不在 glade 文件内!" 32 | 33 | #: ../GUI.cpp:708 34 | msgid "Add Application dialog is not in glade file!" 35 | msgstr "“添加应用程序”对话框不在 glade 文件内!" 36 | 37 | #: ../GUI.cpp:96 38 | msgid "Add new" 39 | msgstr "新增" 40 | 41 | #: ../GUI.cpp:638 42 | msgid "An advanced DRI configurator tool." 43 | msgstr "高级 DRI 配置工具。" 44 | 45 | #: ../GUI.cpp:278 46 | msgid "Application %1 not found" 47 | msgstr "未找到应用程序 %1 " 48 | 49 | #: ../DriConf.glade.h:6 50 | msgid "Application executable:" 51 | msgstr "应用程序可执行文件:" 52 | 53 | #: ../DriConf.glade.h:5 54 | msgid "Application name:" 55 | msgstr "应用程序名称:" 56 | 57 | #: ../GUI.cpp:692 58 | msgid "Application removed successfully." 59 | msgstr "应用程序移除成功。" 60 | 61 | #: ../GUI.cpp:776 62 | msgid "Application successfully added." 63 | msgstr "应用程序已成功添加。" 64 | 65 | #: ../DriConf.glade.h:4 66 | msgid "Cancel" 67 | msgstr "取消" 68 | 69 | #: ../main.cpp:70 70 | msgid "Checking if the system is supported" 71 | msgstr "" 72 | 73 | #: ../Utils/XorgQuery.cpp:15 74 | msgid "Couldn't open X display" 75 | msgstr "无法打开 X 显示" 76 | 77 | #: ../main.cpp:46 78 | msgid "Creating the GTK application object" 79 | msgstr "" 80 | 81 | #: ../GUI.cpp:168 82 | msgid "Current language code is %1" 83 | msgstr "当前语言代码为 %1" 84 | 85 | #: ../ValueObject/EGLDisplayWrapper.cpp:37 86 | msgid "Display is missing EGL_MESA_query_driver extension" 87 | msgstr "" 88 | 89 | #: ../GUI.cpp:211 90 | msgid "Driver %1 not found" 91 | msgstr "未找到驱动 %1" 92 | 93 | #: ../Utils/ConfigurationResolver.cpp:213 94 | msgid "" 95 | "Driver '%1' doesn't support option '%2' on application '%3'. Option removed." 96 | msgstr "驱动“%1”不支持应用程序“%3”上的选项“%2”。选项已移除。" 97 | 98 | #: ../Utils/WaylandQuery.cpp:57 99 | msgid "Driver doesn't support extension \"EGL_MESA_query_driver\"" 100 | msgstr "" 101 | 102 | #: ../DriConf.glade.h:7 103 | msgid "Driver:" 104 | msgstr "驱动:" 105 | 106 | #: ../Utils/DRIQuery.cpp:28 107 | msgid "Enumerating DRI Devices" 108 | msgstr "" 109 | 110 | #: ../Utils/Parser.cpp:167 111 | msgid "Exception caught during device XML parsing: %1" 112 | msgstr "" 113 | 114 | #: ../Utils/EGLDisplayFactory.cpp:14 115 | msgid "Failed to create EGL display" 116 | msgstr "" 117 | 118 | #: ../Utils/GBMDeviceFactory.cpp:18 119 | msgid "Failed to create GBM device for %1" 120 | msgstr "" 121 | 122 | #: ../Utils/EGLDisplayFactory.cpp:20 123 | msgid "Failed to initialize EGL display" 124 | msgstr "" 125 | 126 | #: ../Utils/ConfigurationLoader.cpp:103 127 | msgid "Failed to load file: %1" 128 | msgstr "" 129 | 130 | #: ../Utils/GBMDeviceFactory.cpp:11 131 | msgid "Failed to open device %1" 132 | msgstr "" 133 | 134 | #: ../GUI.cpp:518 135 | msgid "Force Application to use GPU" 136 | msgstr "强制应用程序使用 GPU" 137 | 138 | #: ../Utils/DRIQuery.cpp:33 139 | msgid "Found %1 devices" 140 | msgstr "" 141 | 142 | #: ../Utils/ConfigurationLoader.cpp:93 143 | msgid "Found configuration on path: %1" 144 | msgstr "" 145 | 146 | #: ../Utils/DRIQuery.cpp:84 147 | msgid "GPU \"%1\" has the driver \"%2\"" 148 | msgstr "" 149 | 150 | #: ../Utils/DRIQuery.cpp:57 151 | msgid "GPU has been detected as \"%1\" from \"%2\"" 152 | msgstr "" 153 | 154 | #: ../Utils/DRIQuery.cpp:75 155 | msgid "Generating EGL Display from GBM device for \"%1\"" 156 | msgstr "" 157 | 158 | #: ../GUI.cpp:139 159 | msgid "Generating final XML for saving..." 160 | msgstr "正在生成最终的 XML 以保存……" 161 | 162 | #: ../Utils/DRIQuery.cpp:66 163 | msgid "Generating gbm device for path \"%1\"" 164 | msgstr "" 165 | 166 | #: ../Utils/ConfigurationLoader.cpp:17 167 | msgid "Legacy system-wide XML path: %1" 168 | msgstr "" 169 | 170 | #: ../Utils/ConfigurationLoader.cpp:24 171 | msgid "Legacy system-wide file doesn't exist" 172 | msgstr "" 173 | 174 | #: ../Utils/DRIQuery.cpp:90 175 | msgid "Loading driver options" 176 | msgstr "" 177 | 178 | #: ../GUI.cpp:71 179 | msgid "Main window object is not in glade file!" 180 | msgstr "主窗口对象不在 glade 文件内!" 181 | 182 | #: ../Utils/XorgQuery.cpp:85 183 | msgid "" 184 | "Missing GLX_MESA_query_renderer extension. Probably this is a closed-source " 185 | "driver." 186 | msgstr "" 187 | 188 | #: ../GUI.cpp:314 189 | msgid "Notebook object not found in glade file!" 190 | msgstr "笔记本(notebook)对象不在 glade 文件内!" 191 | 192 | #: ../GUI.cpp:359 193 | msgid "Option %1 doesn't exist in application %2. Merge failed" 194 | msgstr "应用程序 %2 中不存在选项 %1。合并失败。" 195 | 196 | #: ../GUI.cpp:533 197 | msgid "PRIME Settings" 198 | msgstr "PRIME 设置" 199 | 200 | #: ../Utils/Parser.cpp:6 201 | msgid "Parsing XML %1" 202 | msgstr "" 203 | 204 | #: ../Utils/Parser.cpp:128 205 | msgid "Parsing device for XML: %1" 206 | msgstr "正在写入生成的 XML:%1" 207 | 208 | #: ../Utils/DRIQuery.cpp:45 209 | msgid "Processing GPU with PCI ID \"%1\"" 210 | msgstr "" 211 | 212 | #: ../Utils/ConfigurationLoader.cpp:10 213 | msgid "Reading legacy system-wide XML" 214 | msgstr "" 215 | 216 | #: ../Utils/ConfigurationLoader.cpp:70 217 | msgid "Reading system-wide XML" 218 | msgstr "" 219 | 220 | #: ../Utils/ConfigurationLoader.cpp:35 221 | msgid "Reading user defined XML" 222 | msgstr "" 223 | 224 | #: ../GUI.cpp:108 225 | msgid "Remove current Application" 226 | msgstr "移除当前应用程序" 227 | 228 | #: ../Utils/DRIQuery.cpp:124 229 | msgid "Skipping device %1 due to error: %2" 230 | msgstr "" 231 | 232 | #: ../GUI.cpp:642 233 | msgid "Source Code" 234 | msgstr "源代码" 235 | 236 | #: ../GUI.cpp:62 237 | msgid "Start building GTK gui" 238 | msgstr "" 239 | 240 | #: ../Utils/ConfigurationLoader.cpp:77 241 | msgid "System-wide XML path: %1" 242 | msgstr "" 243 | 244 | #: ../Utils/ConfigurationLoader.cpp:117 245 | msgid "System-wide configuration path doesn't exist!" 246 | msgstr "" 247 | 248 | #: ../GUI.cpp:693 249 | msgid "The application has been removed." 250 | msgstr "该应用程序已被移除。" 251 | 252 | #: ../GUI.cpp:778 253 | msgid "The application was successfully added. Reloading default app options." 254 | msgstr "该应用程序已被成功添加。正在重新载入默认的应用选项。" 255 | 256 | #: ../GUI.cpp:678 257 | msgid "The default application cannot be removed." 258 | msgstr "默认的应用程序无法移除。" 259 | 260 | #: ../GUI.cpp:679 261 | msgid "The driver needs a default configuration." 262 | msgstr "驱动需要一个默认配置。" 263 | 264 | #: ../Utils/DRIQuery.cpp:97 265 | msgid "Unable to extract configuration for driver %1" 266 | msgstr "无法提取用于驱动 %1 的配置" 267 | 268 | #: ../Utils/XorgQuery.cpp:31 269 | msgid "Unable to extract driver name for screen %1" 270 | msgstr "无法提取用于驱动 %1 的配置" 271 | 272 | #: ../GUI.cpp:658 273 | msgid "Unexpected response code from about dialog: %1" 274 | msgstr "收到来自“关于”对话框的意外响应代码:%1" 275 | 276 | #: ../GUI.cpp:491 277 | msgid "Use default GPU of screen" 278 | msgstr "使用屏幕的默认 GPU" 279 | 280 | #: ../Utils/ConfigurationLoader.cpp:49 281 | msgid "User defined XML doesn't exist" 282 | msgstr "" 283 | 284 | #: ../Utils/ConfigurationLoader.cpp:42 285 | msgid "User defined XML path: %1" 286 | msgstr "" 287 | 288 | #: ../Utils/ConfigurationLoader.cpp:139 289 | msgid "User defined configuration is empty. Returning an empty object" 290 | msgstr "" 291 | 292 | #: ../Utils/ConfigurationResolver.cpp:380 293 | msgid "" 294 | "User-defined driver '%1' on screen '%2' doesn't have a driver loaded on " 295 | "system. Configuration removed." 296 | msgstr "用户在屏幕“%2”上定义的驱动“%1”未在系统加载的驱动中找到。配置已移除。" 297 | 298 | #: ../GUI.cpp:751 299 | msgid "Validation error" 300 | msgstr "验证错误" 301 | 302 | #: ../GUI.cpp:146 303 | msgid "Writing generated XML: %1" 304 | msgstr "正在写入生成的 XML:%1" 305 | 306 | #: ../GUI.cpp:753 307 | msgid "You need to specify the application name, executable and driver." 308 | msgstr "你必须指定应用程序名称、可执行文件和驱动。" 309 | 310 | #: ../DriConf.glade.h:2 311 | msgid "_Application" 312 | msgstr "应用程序(_A)" 313 | 314 | #: ../DriConf.glade.h:1 315 | msgid "_File" 316 | msgstr "文件(_F)" 317 | 318 | #: ../DriConf.glade.h:3 319 | msgid "_Help" 320 | msgstr "帮助(_H)" 321 | 322 | #: ../main.cpp:63 323 | msgid "adriconf running on Wayland" 324 | msgstr "" 325 | 326 | #: ../main.cpp:66 327 | msgid "adriconf running on X11" 328 | msgstr "" 329 | -------------------------------------------------------------------------------- /po/hr.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: 1.0.1\n" 9 | "Report-Msgid-Bugs-To: Jean Lorenz Hertel \n" 10 | "POT-Creation-Date: 2018-08-06 08:10-0300\n" 11 | "PO-Revision-Date: 2018-01-30 19:15+0100\n" 12 | "Last-Translator: gogo \n" 13 | "Language-Team: \n" 14 | "Language: hr\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "X-Generator: Poedit 1.8.7.1\n" 19 | 20 | #: ../GUI.cpp:728 21 | msgid "Add Application app driver widget is not in glade file!" 22 | msgstr "Glavnog objekta prozora nema u glade datoteci!" 23 | 24 | #: ../GUI.cpp:721 25 | msgid "Add Application app executable widget is not in glade file!" 26 | msgstr "Glavnog objekta prozora nema u glade datoteci!" 27 | 28 | #: ../GUI.cpp:714 29 | msgid "Add Application app name widget is not in glade file!" 30 | msgstr "Glavnog objekta prozora nema u glade datoteci!" 31 | 32 | #: ../GUI.cpp:708 33 | msgid "Add Application dialog is not in glade file!" 34 | msgstr "Glavnog objekta prozora nema u glade datoteci!" 35 | 36 | #: ../GUI.cpp:96 37 | msgid "Add new" 38 | msgstr "Dodaj novo" 39 | 40 | #: ../GUI.cpp:638 41 | msgid "An advanced DRI configurator tool." 42 | msgstr "Napredni alat za DRI podešavanje." 43 | 44 | #: ../GUI.cpp:278 45 | msgid "Application %1 not found" 46 | msgstr "Aplikacija %1 nije pronađena " 47 | 48 | #: ../DriConf.glade.h:6 49 | msgid "Application executable:" 50 | msgstr "Izvršna datoteka aplikacije" 51 | 52 | #: ../DriConf.glade.h:5 53 | msgid "Application name:" 54 | msgstr "Naziv aplikacije" 55 | 56 | #: ../GUI.cpp:692 57 | msgid "Application removed successfully." 58 | msgstr "Aplikacija je uklonjena uspješno." 59 | 60 | #: ../GUI.cpp:776 61 | msgid "Application successfully added." 62 | msgstr "Aplikacija je dodana uspješno." 63 | 64 | #: ../DriConf.glade.h:4 65 | msgid "Cancel" 66 | msgstr "Odustani" 67 | 68 | #: ../main.cpp:70 69 | msgid "Checking if the system is supported" 70 | msgstr "" 71 | 72 | #: ../Utils/XorgQuery.cpp:15 73 | msgid "Couldn't open X display" 74 | msgstr "" 75 | 76 | #: ../main.cpp:46 77 | msgid "Creating the GTK application object" 78 | msgstr "" 79 | 80 | #: ../GUI.cpp:168 81 | msgid "Current language code is %1" 82 | msgstr "Trenutni jezični kôd je %1" 83 | 84 | #: ../ValueObject/EGLDisplayWrapper.cpp:37 85 | msgid "Display is missing EGL_MESA_query_driver extension" 86 | msgstr "" 87 | 88 | #: ../GUI.cpp:211 89 | msgid "Driver %1 not found" 90 | msgstr "Upravljački program %1 nije pronađen" 91 | 92 | #: ../Utils/ConfigurationResolver.cpp:213 93 | msgid "" 94 | "Driver '%1' doesn't support option '%2' on application '%3'. Option removed." 95 | msgstr "" 96 | "Upravljački program '%1' ne podržava mogućnost '%2' na aplikaciji '%3'. " 97 | "Mogućnost uklonjena." 98 | 99 | #: ../Utils/WaylandQuery.cpp:57 100 | msgid "Driver doesn't support extension \"EGL_MESA_query_driver\"" 101 | msgstr "" 102 | 103 | #: ../DriConf.glade.h:7 104 | msgid "Driver:" 105 | msgstr "Upravljački program" 106 | 107 | #: ../Utils/DRIQuery.cpp:28 108 | msgid "Enumerating DRI Devices" 109 | msgstr "" 110 | 111 | #: ../Utils/Parser.cpp:167 112 | msgid "Exception caught during device XML parsing: %1" 113 | msgstr "" 114 | 115 | #: ../Utils/EGLDisplayFactory.cpp:14 116 | msgid "Failed to create EGL display" 117 | msgstr "" 118 | 119 | #: ../Utils/GBMDeviceFactory.cpp:18 120 | msgid "Failed to create GBM device for %1" 121 | msgstr "" 122 | 123 | #: ../Utils/EGLDisplayFactory.cpp:20 124 | msgid "Failed to initialize EGL display" 125 | msgstr "" 126 | 127 | #: ../Utils/ConfigurationLoader.cpp:103 128 | msgid "Failed to load file: %1" 129 | msgstr "" 130 | 131 | #: ../Utils/GBMDeviceFactory.cpp:11 132 | msgid "Failed to open device %1" 133 | msgstr "" 134 | 135 | #: ../GUI.cpp:518 136 | msgid "Force Application to use GPU" 137 | msgstr "Nova aplikacija" 138 | 139 | #: ../Utils/DRIQuery.cpp:33 140 | msgid "Found %1 devices" 141 | msgstr "" 142 | 143 | #: ../Utils/ConfigurationLoader.cpp:93 144 | msgid "Found configuration on path: %1" 145 | msgstr "" 146 | 147 | #: ../Utils/DRIQuery.cpp:84 148 | msgid "GPU \"%1\" has the driver \"%2\"" 149 | msgstr "" 150 | 151 | #: ../Utils/DRIQuery.cpp:57 152 | msgid "GPU has been detected as \"%1\" from \"%2\"" 153 | msgstr "" 154 | 155 | #: ../Utils/DRIQuery.cpp:75 156 | msgid "Generating EGL Display from GBM device for \"%1\"" 157 | msgstr "" 158 | 159 | #: ../GUI.cpp:139 160 | msgid "Generating final XML for saving..." 161 | msgstr "Stvaranje konačnog XML-a za spremanje..." 162 | 163 | #: ../Utils/DRIQuery.cpp:66 164 | msgid "Generating gbm device for path \"%1\"" 165 | msgstr "" 166 | 167 | #: ../Utils/ConfigurationLoader.cpp:17 168 | msgid "Legacy system-wide XML path: %1" 169 | msgstr "" 170 | 171 | #: ../Utils/ConfigurationLoader.cpp:24 172 | msgid "Legacy system-wide file doesn't exist" 173 | msgstr "" 174 | 175 | #: ../Utils/DRIQuery.cpp:90 176 | msgid "Loading driver options" 177 | msgstr "" 178 | 179 | #: ../GUI.cpp:71 180 | msgid "Main window object is not in glade file!" 181 | msgstr "Glavnog objekta prozora nema u glade datoteci!" 182 | 183 | #: ../Utils/XorgQuery.cpp:85 184 | msgid "" 185 | "Missing GLX_MESA_query_renderer extension. Probably this is a closed-source " 186 | "driver." 187 | msgstr "" 188 | 189 | #: ../GUI.cpp:314 190 | msgid "Notebook object not found in glade file!" 191 | msgstr "Objekta bilješke nema u glade datoteci!" 192 | 193 | #: ../GUI.cpp:359 194 | msgid "Option %1 doesn't exist in application %2. Merge failed" 195 | msgstr "Mogućnost %1 ne postoji u aplikaciji %2. Spajanje neuspjelo" 196 | 197 | #: ../GUI.cpp:533 198 | msgid "PRIME Settings" 199 | msgstr "" 200 | 201 | #: ../Utils/Parser.cpp:6 202 | msgid "Parsing XML %1" 203 | msgstr "" 204 | 205 | #: ../Utils/Parser.cpp:128 206 | msgid "Parsing device for XML: %1" 207 | msgstr "Zapisivanje stvorenog XML-a: %1" 208 | 209 | #: ../Utils/DRIQuery.cpp:45 210 | msgid "Processing GPU with PCI ID \"%1\"" 211 | msgstr "" 212 | 213 | #: ../Utils/ConfigurationLoader.cpp:10 214 | msgid "Reading legacy system-wide XML" 215 | msgstr "" 216 | 217 | #: ../Utils/ConfigurationLoader.cpp:70 218 | msgid "Reading system-wide XML" 219 | msgstr "" 220 | 221 | #: ../Utils/ConfigurationLoader.cpp:35 222 | msgid "Reading user defined XML" 223 | msgstr "" 224 | 225 | #: ../GUI.cpp:108 226 | msgid "Remove current Application" 227 | msgstr "Ukloni trenutnu aplikaciju" 228 | 229 | #: ../Utils/DRIQuery.cpp:124 230 | msgid "Skipping device %1 due to error: %2" 231 | msgstr "" 232 | 233 | #: ../GUI.cpp:642 234 | msgid "Source Code" 235 | msgstr "Izvorni kôd" 236 | 237 | #: ../GUI.cpp:62 238 | msgid "Start building GTK gui" 239 | msgstr "" 240 | 241 | #: ../Utils/ConfigurationLoader.cpp:77 242 | msgid "System-wide XML path: %1" 243 | msgstr "" 244 | 245 | #: ../Utils/ConfigurationLoader.cpp:117 246 | msgid "System-wide configuration path doesn't exist!" 247 | msgstr "" 248 | 249 | #: ../GUI.cpp:693 250 | msgid "The application has been removed." 251 | msgstr "Aplikacija je uklonjena." 252 | 253 | #: ../GUI.cpp:778 254 | msgid "The application was successfully added. Reloading default app options." 255 | msgstr "" 256 | "Aplikacija je uspješno dodana. Ponovno učitavanje zadanih mogućnosti " 257 | "aplikacije." 258 | 259 | #: ../GUI.cpp:678 260 | msgid "The default application cannot be removed." 261 | msgstr "Zadana aplikacija se ne može ukloniti." 262 | 263 | #: ../GUI.cpp:679 264 | msgid "The driver needs a default configuration." 265 | msgstr "Upravljački program zahtijeva zadano podešavanje." 266 | 267 | #: ../Utils/DRIQuery.cpp:97 268 | msgid "Unable to extract configuration for driver %1" 269 | msgstr "" 270 | 271 | #: ../Utils/XorgQuery.cpp:31 272 | msgid "Unable to extract driver name for screen %1" 273 | msgstr "" 274 | 275 | #: ../GUI.cpp:658 276 | msgid "Unexpected response code from about dialog: %1" 277 | msgstr "Neočekivani odgovor kôda iz dijaloga o programu: %1" 278 | 279 | #: ../GUI.cpp:491 280 | msgid "Use default GPU of screen" 281 | msgstr "" 282 | 283 | #: ../Utils/ConfigurationLoader.cpp:49 284 | msgid "User defined XML doesn't exist" 285 | msgstr "" 286 | 287 | #: ../Utils/ConfigurationLoader.cpp:42 288 | msgid "User defined XML path: %1" 289 | msgstr "" 290 | 291 | #: ../Utils/ConfigurationLoader.cpp:139 292 | msgid "User defined configuration is empty. Returning an empty object" 293 | msgstr "" 294 | 295 | #: ../Utils/ConfigurationResolver.cpp:380 296 | msgid "" 297 | "User-defined driver '%1' on screen '%2' doesn't have a driver loaded on " 298 | "system. Configuration removed." 299 | msgstr "" 300 | 301 | #: ../GUI.cpp:751 302 | msgid "Validation error" 303 | msgstr "Greška provjere" 304 | 305 | #: ../GUI.cpp:146 306 | msgid "Writing generated XML: %1" 307 | msgstr "Zapisivanje stvorenog XML-a: %1" 308 | 309 | #: ../GUI.cpp:753 310 | msgid "You need to specify the application name, executable and driver." 311 | msgstr "" 312 | "Morate navesti naziv aplikacije, izvršnu datoteku i upravljački program." 313 | 314 | #: ../DriConf.glade.h:2 315 | msgid "_Application" 316 | msgstr "_Aplikacija" 317 | 318 | #: ../DriConf.glade.h:1 319 | msgid "_File" 320 | msgstr "_Datoteka" 321 | 322 | #: ../DriConf.glade.h:3 323 | msgid "_Help" 324 | msgstr "_Pomoć" 325 | 326 | #: ../main.cpp:63 327 | msgid "adriconf running on Wayland" 328 | msgstr "" 329 | 330 | #: ../main.cpp:66 331 | msgid "adriconf running on X11" 332 | msgstr "" 333 | 334 | #~ msgid "Save" 335 | #~ msgstr "Spremi" 336 | -------------------------------------------------------------------------------- /po/en.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | #, fuzzy 7 | msgid "" 8 | msgstr "" 9 | "Project-Id-Version: 1.0.1\n" 10 | "Report-Msgid-Bugs-To: Jean Lorenz Hertel \n" 11 | "POT-Creation-Date: 2018-08-06 08:10-0300\n" 12 | "PO-Revision-Date: 2020-01-26 20:10-0300\n" 13 | "Last-Translator: Jean Lorenz Hertel \n" 14 | "Language-Team: LANGUAGE \n" 15 | "Language: en\n" 16 | "MIME-Version: 1.0\n" 17 | "Content-Type: text/plain; charset=UTF-8\n" 18 | "Content-Transfer-Encoding: 8bit\n" 19 | 20 | #: ../GUI.cpp:728 21 | msgid "Add Application app driver widget is not in glade file!" 22 | msgstr "Main window object is not in glade file!" 23 | 24 | #: ../GUI.cpp:721 25 | msgid "Add Application app executable widget is not in glade file!" 26 | msgstr "Main window object is not in glade file!" 27 | 28 | #: ../GUI.cpp:714 29 | msgid "Add Application app name widget is not in glade file!" 30 | msgstr "Main window object is not in glade file!" 31 | 32 | #: ../GUI.cpp:708 33 | msgid "Add Application dialog is not in glade file!" 34 | msgstr "Main window object is not in glade file!" 35 | 36 | #: ../GUI.cpp:96 37 | msgid "Add new" 38 | msgstr "Add new" 39 | 40 | #: ../GUI.cpp:638 41 | msgid "An advanced DRI configurator tool." 42 | msgstr "An advanced DRI configurator tool." 43 | 44 | #: ../GUI.cpp:278 45 | msgid "Application %1 not found" 46 | msgstr "Application %1 not found " 47 | 48 | #: ../DriConf.glade.h:6 49 | msgid "Application executable:" 50 | msgstr "Application executable" 51 | 52 | #: ../DriConf.glade.h:5 53 | #, fuzzy 54 | msgid "Application name:" 55 | msgstr "Application name" 56 | 57 | #: ../GUI.cpp:692 58 | msgid "Application removed successfully." 59 | msgstr "Application removed successfully." 60 | 61 | #: ../GUI.cpp:776 62 | msgid "Application successfully added." 63 | msgstr "Application successfully added." 64 | 65 | #: ../DriConf.glade.h:4 66 | msgid "Cancel" 67 | msgstr "Cancel" 68 | 69 | #: ../main.cpp:70 70 | msgid "Checking if the system is supported" 71 | msgstr "Checking if the system is supported" 72 | 73 | #: ../Utils/XorgQuery.cpp:15 74 | msgid "Couldn't open X display" 75 | msgstr "Couldn't open X display" 76 | 77 | #: ../main.cpp:46 78 | msgid "Creating the GTK application object" 79 | msgstr "Creating the GTK application object" 80 | 81 | #: ../GUI.cpp:168 82 | #, fuzzy 83 | msgid "Current language code is %1" 84 | msgstr "Current language code is %1" 85 | 86 | #: ../ValueObject/EGLDisplayWrapper.cpp:37 87 | msgid "Display is missing EGL_MESA_query_driver extension" 88 | msgstr "Display is missing EGL_MESA_query_driver extension" 89 | 90 | #: ../GUI.cpp:211 91 | msgid "Driver %1 not found" 92 | msgstr "Driver %1 not found" 93 | 94 | #: ../Utils/ConfigurationResolver.cpp:213 95 | msgid "" 96 | "Driver '%1' doesn't support option '%2' on application '%3'. Option removed." 97 | msgstr "" 98 | "Driver '%1' doesn't support option '%2' on application '%3'. Option removed." 99 | 100 | #: ../Utils/WaylandQuery.cpp:57 101 | msgid "Driver doesn't support extension \"EGL_MESA_query_driver\"" 102 | msgstr "" 103 | 104 | #: ../DriConf.glade.h:7 105 | msgid "Driver:" 106 | msgstr "Driver:" 107 | 108 | #: ../Utils/DRIQuery.cpp:28 109 | msgid "Enumerating DRI Devices" 110 | msgstr "" 111 | 112 | #: ../Utils/Parser.cpp:167 113 | msgid "Exception caught during device XML parsing: %1" 114 | msgstr "" 115 | 116 | #: ../Utils/EGLDisplayFactory.cpp:14 117 | msgid "Failed to create EGL display" 118 | msgstr "" 119 | 120 | #: ../Utils/GBMDeviceFactory.cpp:18 121 | msgid "Failed to create GBM device for %1" 122 | msgstr "" 123 | 124 | #: ../Utils/EGLDisplayFactory.cpp:20 125 | msgid "Failed to initialize EGL display" 126 | msgstr "" 127 | 128 | #: ../Utils/ConfigurationLoader.cpp:103 129 | msgid "Failed to load file: %1" 130 | msgstr "" 131 | 132 | #: ../Utils/GBMDeviceFactory.cpp:11 133 | msgid "Failed to open device %1" 134 | msgstr "" 135 | 136 | #: ../GUI.cpp:518 137 | msgid "Force Application to use GPU" 138 | msgstr "Force Application to use GPU" 139 | 140 | #: ../Utils/DRIQuery.cpp:33 141 | msgid "Found %1 devices" 142 | msgstr "" 143 | 144 | #: ../Utils/ConfigurationLoader.cpp:93 145 | msgid "Found configuration on path: %1" 146 | msgstr "" 147 | 148 | #: ../Utils/DRIQuery.cpp:84 149 | msgid "GPU \"%1\" has the driver \"%2\"" 150 | msgstr "" 151 | 152 | #: ../Utils/DRIQuery.cpp:57 153 | msgid "GPU has been detected as \"%1\" from \"%2\"" 154 | msgstr "" 155 | 156 | #: ../Utils/DRIQuery.cpp:75 157 | msgid "Generating EGL Display from GBM device for \"%1\"" 158 | msgstr "" 159 | 160 | #: ../GUI.cpp:139 161 | msgid "Generating final XML for saving..." 162 | msgstr "Generating final XML for saving..." 163 | 164 | #: ../Utils/DRIQuery.cpp:66 165 | msgid "Generating gbm device for path \"%1\"" 166 | msgstr "" 167 | 168 | #: ../Utils/ConfigurationLoader.cpp:17 169 | msgid "Legacy system-wide XML path: %1" 170 | msgstr "Legacy system-wide XML path: %1" 171 | 172 | #: ../Utils/ConfigurationLoader.cpp:24 173 | msgid "Legacy system-wide file doesn't exist" 174 | msgstr "" 175 | 176 | #: ../Utils/DRIQuery.cpp:90 177 | msgid "Loading driver options" 178 | msgstr "" 179 | 180 | #: ../GUI.cpp:71 181 | msgid "Main window object is not in glade file!" 182 | msgstr "Main window object is not in glade file!" 183 | 184 | #: ../Utils/XorgQuery.cpp:85 185 | msgid "" 186 | "Missing GLX_MESA_query_renderer extension. Probably this is a closed-source " 187 | "driver." 188 | msgstr "" 189 | 190 | #: ../GUI.cpp:314 191 | msgid "Notebook object not found in glade file!" 192 | msgstr "Notebook object not found in glade file!" 193 | 194 | #: ../GUI.cpp:359 195 | msgid "Option %1 doesn't exist in application %2. Merge failed" 196 | msgstr "Option %1 doesn't exist in application %2. Merge failed" 197 | 198 | #: ../GUI.cpp:533 199 | msgid "PRIME Settings" 200 | msgstr "PRIME Settings" 201 | 202 | #: ../Utils/Parser.cpp:6 203 | msgid "Parsing XML %1" 204 | msgstr "" 205 | 206 | #: ../Utils/Parser.cpp:128 207 | msgid "Parsing device for XML: %1" 208 | msgstr "Writing generated XML: %1" 209 | 210 | #: ../Utils/DRIQuery.cpp:45 211 | msgid "Processing GPU with PCI ID \"%1\"" 212 | msgstr "" 213 | 214 | #: ../Utils/ConfigurationLoader.cpp:10 215 | msgid "Reading legacy system-wide XML" 216 | msgstr "Reading legacy system-wide XML" 217 | 218 | #: ../Utils/ConfigurationLoader.cpp:70 219 | msgid "Reading system-wide XML" 220 | msgstr "" 221 | 222 | #: ../Utils/ConfigurationLoader.cpp:35 223 | msgid "Reading user defined XML" 224 | msgstr "" 225 | 226 | #: ../GUI.cpp:108 227 | msgid "Remove current Application" 228 | msgstr "Remove current Application" 229 | 230 | #: ../Utils/DRIQuery.cpp:124 231 | msgid "Skipping device %1 due to error: %2" 232 | msgstr "" 233 | 234 | #: ../GUI.cpp:642 235 | msgid "Source Code" 236 | msgstr "Source Code" 237 | 238 | #: ../GUI.cpp:62 239 | msgid "Start building GTK gui" 240 | msgstr "Start building GTK gui" 241 | 242 | #: ../Utils/ConfigurationLoader.cpp:77 243 | msgid "System-wide XML path: %1" 244 | msgstr "" 245 | 246 | #: ../Utils/ConfigurationLoader.cpp:117 247 | msgid "System-wide configuration path doesn't exist!" 248 | msgstr "" 249 | 250 | #: ../GUI.cpp:693 251 | msgid "The application has been removed." 252 | msgstr "The application has been removed." 253 | 254 | #: ../GUI.cpp:778 255 | msgid "The application was successfully added. Reloading default app options." 256 | msgstr "The application was successfully added. Reloading default app options." 257 | 258 | #: ../GUI.cpp:678 259 | msgid "The default application cannot be removed." 260 | msgstr "The default application cannot be removed." 261 | 262 | #: ../GUI.cpp:679 263 | msgid "The driver needs a default configuration." 264 | msgstr "The driver needs a default configuration." 265 | 266 | #: ../Utils/DRIQuery.cpp:97 267 | msgid "Unable to extract configuration for driver %1" 268 | msgstr "Unable to extract configuration for driver %1" 269 | 270 | #: ../Utils/XorgQuery.cpp:31 271 | msgid "Unable to extract driver name for screen %1" 272 | msgstr "Unable to extract configuration for driver %1" 273 | 274 | #: ../GUI.cpp:658 275 | msgid "Unexpected response code from about dialog: %1" 276 | msgstr "Unexpected response code from about dialog: %1" 277 | 278 | #: ../GUI.cpp:491 279 | msgid "Use default GPU of screen" 280 | msgstr "Use default GPU of screen" 281 | 282 | #: ../Utils/ConfigurationLoader.cpp:49 283 | msgid "User defined XML doesn't exist" 284 | msgstr "" 285 | 286 | #: ../Utils/ConfigurationLoader.cpp:42 287 | msgid "User defined XML path: %1" 288 | msgstr "" 289 | 290 | #: ../Utils/ConfigurationLoader.cpp:139 291 | msgid "User defined configuration is empty. Returning an empty object" 292 | msgstr "" 293 | 294 | #: ../Utils/ConfigurationResolver.cpp:380 295 | msgid "" 296 | "User-defined driver '%1' on screen '%2' doesn't have a driver loaded on " 297 | "system. Configuration removed." 298 | msgstr "" 299 | 300 | #: ../GUI.cpp:751 301 | msgid "Validation error" 302 | msgstr "Validation error" 303 | 304 | #: ../GUI.cpp:146 305 | msgid "Writing generated XML: %1" 306 | msgstr "Writing generated XML: %1" 307 | 308 | #: ../GUI.cpp:753 309 | msgid "You need to specify the application name, executable and driver." 310 | msgstr "You need to specify the application name, executable and driver." 311 | 312 | #: ../DriConf.glade.h:2 313 | msgid "_Application" 314 | msgstr "Application" 315 | 316 | #: ../DriConf.glade.h:1 317 | msgid "_File" 318 | msgstr "File" 319 | 320 | #: ../DriConf.glade.h:3 321 | msgid "_Help" 322 | msgstr "Help" 323 | 324 | #: ../main.cpp:63 325 | msgid "adriconf running on Wayland" 326 | msgstr "adriconf running on Wayland" 327 | 328 | #: ../main.cpp:66 329 | msgid "adriconf running on X11" 330 | msgstr "adriconf running on X11" 331 | -------------------------------------------------------------------------------- /po/lv.po: -------------------------------------------------------------------------------- 1 | # Latvian translations for 1.0.1 package. 2 | # Copyright (C) 2019 THE 1.0.1'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the 1.0.1 package. 4 | # Linards , 2019. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: 1.0.1\n" 9 | "Report-Msgid-Bugs-To: Jean Lorenz Hertel \n" 10 | "POT-Creation-Date: 2018-08-06 08:10-0300\n" 11 | "PO-Revision-Date: 2019-07-01 15:07+0300\n" 12 | "Last-Translator: Linards \n" 13 | "Language-Team: Latvian\n" 14 | "Language: lv\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " 19 | "2);\n" 20 | 21 | #: ../GUI.cpp:728 22 | msgid "Add Application app driver widget is not in glade file!" 23 | msgstr "" 24 | "Pievienot Programmu aplikācijas drivera sīkrīku dialogs nav glade failā!" 25 | 26 | #: ../GUI.cpp:721 27 | msgid "Add Application app executable widget is not in glade file!" 28 | msgstr "" 29 | "Pievienot Programmu aplikācijas izpildāmā faila sīkrīku dialogs nav glade " 30 | "failā!" 31 | 32 | #: ../GUI.cpp:714 33 | msgid "Add Application app name widget is not in glade file!" 34 | msgstr "" 35 | "Pievienot Programmu apliokjācijas nosaukuma sīkrīku dialogs nav glade failā!" 36 | 37 | #: ../GUI.cpp:708 38 | msgid "Add Application dialog is not in glade file!" 39 | msgstr "Pievienot Programmu dialogs nav glade failā!" 40 | 41 | #: ../GUI.cpp:96 42 | msgid "Add new" 43 | msgstr "Pievienot jaunu" 44 | 45 | #: ../GUI.cpp:638 46 | msgid "An advanced DRI configurator tool." 47 | msgstr "Padziļinātais DRI Konfigurācijas rīks." 48 | 49 | #: ../GUI.cpp:278 50 | msgid "Application %1 not found" 51 | msgstr "Programma %1 nav atrasta " 52 | 53 | #: ../DriConf.glade.h:6 54 | msgid "Application executable:" 55 | msgstr "Programmas izpildāmais fails:" 56 | 57 | #: ../DriConf.glade.h:5 58 | msgid "Application name:" 59 | msgstr "Programmas vārds:" 60 | 61 | #: ../GUI.cpp:692 62 | msgid "Application removed successfully." 63 | msgstr "Programma noņemta veiksmīgi." 64 | 65 | #: ../GUI.cpp:776 66 | msgid "Application successfully added." 67 | msgstr "Programma pievienota veikismīgi." 68 | 69 | #: ../DriConf.glade.h:4 70 | msgid "Cancel" 71 | msgstr "Atcelt" 72 | 73 | #: ../main.cpp:70 74 | msgid "Checking if the system is supported" 75 | msgstr "" 76 | 77 | #: ../Utils/XorgQuery.cpp:15 78 | msgid "Couldn't open X display" 79 | msgstr "Nevar atvērt X displeju" 80 | 81 | #: ../main.cpp:46 82 | msgid "Creating the GTK application object" 83 | msgstr "" 84 | 85 | #: ../GUI.cpp:168 86 | msgid "Current language code is %1" 87 | msgstr "Pašreizējais valodas kods ir %1" 88 | 89 | #: ../ValueObject/EGLDisplayWrapper.cpp:37 90 | msgid "Display is missing EGL_MESA_query_driver extension" 91 | msgstr "" 92 | 93 | #: ../GUI.cpp:211 94 | msgid "Driver %1 not found" 95 | msgstr "Draiveris %1 nav atrasts" 96 | 97 | #: ../Utils/ConfigurationResolver.cpp:213 98 | msgid "" 99 | "Driver '%1' doesn't support option '%2' on application '%3'. Option removed." 100 | msgstr "Driveris '%1' neatbalsta opciju '%2' aplikācijā '%3'. Opcija noņemta." 101 | 102 | #: ../Utils/WaylandQuery.cpp:57 103 | msgid "Driver doesn't support extension \"EGL_MESA_query_driver\"" 104 | msgstr "" 105 | 106 | #: ../DriConf.glade.h:7 107 | msgid "Driver:" 108 | msgstr "Draiveris:" 109 | 110 | #: ../Utils/DRIQuery.cpp:28 111 | msgid "Enumerating DRI Devices" 112 | msgstr "" 113 | 114 | #: ../Utils/Parser.cpp:167 115 | msgid "Exception caught during device XML parsing: %1" 116 | msgstr "" 117 | 118 | #: ../Utils/EGLDisplayFactory.cpp:14 119 | msgid "Failed to create EGL display" 120 | msgstr "" 121 | 122 | #: ../Utils/GBMDeviceFactory.cpp:18 123 | msgid "Failed to create GBM device for %1" 124 | msgstr "" 125 | 126 | #: ../Utils/EGLDisplayFactory.cpp:20 127 | msgid "Failed to initialize EGL display" 128 | msgstr "" 129 | 130 | #: ../Utils/ConfigurationLoader.cpp:103 131 | msgid "Failed to load file: %1" 132 | msgstr "" 133 | 134 | #: ../Utils/GBMDeviceFactory.cpp:11 135 | msgid "Failed to open device %1" 136 | msgstr "" 137 | 138 | #: ../GUI.cpp:518 139 | msgid "Force Application to use GPU" 140 | msgstr "Piespiest Programmu lietot GPU" 141 | 142 | #: ../Utils/DRIQuery.cpp:33 143 | msgid "Found %1 devices" 144 | msgstr "" 145 | 146 | #: ../Utils/ConfigurationLoader.cpp:93 147 | msgid "Found configuration on path: %1" 148 | msgstr "" 149 | 150 | #: ../Utils/DRIQuery.cpp:84 151 | msgid "GPU \"%1\" has the driver \"%2\"" 152 | msgstr "" 153 | 154 | #: ../Utils/DRIQuery.cpp:57 155 | msgid "GPU has been detected as \"%1\" from \"%2\"" 156 | msgstr "" 157 | 158 | #: ../Utils/DRIQuery.cpp:75 159 | msgid "Generating EGL Display from GBM device for \"%1\"" 160 | msgstr "" 161 | 162 | #: ../GUI.cpp:139 163 | msgid "Generating final XML for saving..." 164 | msgstr "Ģenerē galīgo XML faila versiju saglabāšanai..." 165 | 166 | #: ../Utils/DRIQuery.cpp:66 167 | msgid "Generating gbm device for path \"%1\"" 168 | msgstr "" 169 | 170 | #: ../Utils/ConfigurationLoader.cpp:17 171 | msgid "Legacy system-wide XML path: %1" 172 | msgstr "" 173 | 174 | #: ../Utils/ConfigurationLoader.cpp:24 175 | msgid "Legacy system-wide file doesn't exist" 176 | msgstr "" 177 | 178 | #: ../Utils/DRIQuery.cpp:90 179 | msgid "Loading driver options" 180 | msgstr "" 181 | 182 | #: ../GUI.cpp:71 183 | msgid "Main window object is not in glade file!" 184 | msgstr "Galvenais loga objekts nav glade failā!" 185 | 186 | #: ../Utils/XorgQuery.cpp:85 187 | msgid "" 188 | "Missing GLX_MESA_query_renderer extension. Probably this is a closed-source " 189 | "driver." 190 | msgstr "" 191 | 192 | #: ../GUI.cpp:314 193 | msgid "Notebook object not found in glade file!" 194 | msgstr "Bloknota objekts nav atrasts glade failā!" 195 | 196 | #: ../GUI.cpp:359 197 | msgid "Option %1 doesn't exist in application %2. Merge failed" 198 | msgstr "Opcija %1 neeksistē programmā %2. Apvienošana izgāzās" 199 | 200 | #: ../GUI.cpp:533 201 | msgid "PRIME Settings" 202 | msgstr "PRIME iestatījumi" 203 | 204 | #: ../Utils/Parser.cpp:6 205 | msgid "Parsing XML %1" 206 | msgstr "" 207 | 208 | #: ../Utils/Parser.cpp:128 209 | msgid "Parsing device for XML: %1" 210 | msgstr "Raksta ģenerēto XML: %1" 211 | 212 | #: ../Utils/DRIQuery.cpp:45 213 | msgid "Processing GPU with PCI ID \"%1\"" 214 | msgstr "" 215 | 216 | #: ../Utils/ConfigurationLoader.cpp:10 217 | msgid "Reading legacy system-wide XML" 218 | msgstr "" 219 | 220 | #: ../Utils/ConfigurationLoader.cpp:70 221 | msgid "Reading system-wide XML" 222 | msgstr "" 223 | 224 | #: ../Utils/ConfigurationLoader.cpp:35 225 | msgid "Reading user defined XML" 226 | msgstr "" 227 | 228 | #: ../GUI.cpp:108 229 | msgid "Remove current Application" 230 | msgstr "Noņemt esošo Programmu" 231 | 232 | #: ../Utils/DRIQuery.cpp:124 233 | msgid "Skipping device %1 due to error: %2" 234 | msgstr "" 235 | 236 | #: ../GUI.cpp:642 237 | msgid "Source Code" 238 | msgstr "Pirmkods" 239 | 240 | #: ../GUI.cpp:62 241 | msgid "Start building GTK gui" 242 | msgstr "" 243 | 244 | #: ../Utils/ConfigurationLoader.cpp:77 245 | msgid "System-wide XML path: %1" 246 | msgstr "" 247 | 248 | #: ../Utils/ConfigurationLoader.cpp:117 249 | msgid "System-wide configuration path doesn't exist!" 250 | msgstr "" 251 | 252 | #: ../GUI.cpp:693 253 | msgid "The application has been removed." 254 | msgstr "Programma tika noņemta." 255 | 256 | #: ../GUI.cpp:778 257 | msgid "The application was successfully added. Reloading default app options." 258 | msgstr "" 259 | "Programma tika pievienota veikismīgi. Pārlādēju noklusējuma aplikācijas " 260 | "opcijas." 261 | 262 | #: ../GUI.cpp:678 263 | msgid "The default application cannot be removed." 264 | msgstr "Noklusējuma programma nevar tikt noņemta." 265 | 266 | #: ../GUI.cpp:679 267 | msgid "The driver needs a default configuration." 268 | msgstr "Draiverim nepieciešama noklusējuma konfigurācija." 269 | 270 | #: ../Utils/DRIQuery.cpp:97 271 | msgid "Unable to extract configuration for driver %1" 272 | msgstr "Nevar izvilkt konfigurāciju draiverim %1" 273 | 274 | #: ../Utils/XorgQuery.cpp:31 275 | msgid "Unable to extract driver name for screen %1" 276 | msgstr "Nevar izvilkt konfigurāciju draiverim %1" 277 | 278 | #: ../GUI.cpp:658 279 | msgid "Unexpected response code from about dialog: %1" 280 | msgstr "" 281 | 282 | #: ../GUI.cpp:491 283 | msgid "Use default GPU of screen" 284 | msgstr "Lieto noklusējuma GPU ekrānam" 285 | 286 | #: ../Utils/ConfigurationLoader.cpp:49 287 | msgid "User defined XML doesn't exist" 288 | msgstr "" 289 | 290 | #: ../Utils/ConfigurationLoader.cpp:42 291 | msgid "User defined XML path: %1" 292 | msgstr "" 293 | 294 | #: ../Utils/ConfigurationLoader.cpp:139 295 | msgid "User defined configuration is empty. Returning an empty object" 296 | msgstr "" 297 | 298 | #: ../Utils/ConfigurationResolver.cpp:380 299 | msgid "" 300 | "User-defined driver '%1' on screen '%2' doesn't have a driver loaded on " 301 | "system. Configuration removed." 302 | msgstr "" 303 | "Lietotaja-definētais driverim '%1' uz ekrāna '%2' nav ielādēts draivera " 304 | "sistēma. Konfigurācija noņemta." 305 | 306 | #: ../GUI.cpp:751 307 | msgid "Validation error" 308 | msgstr "Pārbaudes kļūda" 309 | 310 | #: ../GUI.cpp:146 311 | msgid "Writing generated XML: %1" 312 | msgstr "Raksta ģenerēto XML: %1" 313 | 314 | #: ../GUI.cpp:753 315 | msgid "You need to specify the application name, executable and driver." 316 | msgstr "" 317 | "Jums nepieciešams norādīt programmas vārdu, izpildāmo failu vai draiveri." 318 | 319 | #: ../DriConf.glade.h:2 320 | msgid "_Application" 321 | msgstr "_Programma" 322 | 323 | #: ../DriConf.glade.h:1 324 | msgid "_File" 325 | msgstr "_Fails" 326 | 327 | #: ../DriConf.glade.h:3 328 | msgid "_Help" 329 | msgstr "_Palīdzība" 330 | 331 | #: ../main.cpp:63 332 | msgid "adriconf running on Wayland" 333 | msgstr "" 334 | 335 | #: ../main.cpp:66 336 | msgid "adriconf running on X11" 337 | msgstr "" 338 | -------------------------------------------------------------------------------- /po/pt_BR.po: -------------------------------------------------------------------------------- 1 | # SOME DESCRIPTIVE TITLE. 2 | # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 | # This file is distributed under the same license as the PACKAGE package. 4 | # FIRST AUTHOR , YEAR. 5 | # 6 | msgid "" 7 | msgstr "" 8 | "Project-Id-Version: 1.0.1\n" 9 | "Report-Msgid-Bugs-To: Jean Lorenz Hertel \n" 10 | "POT-Creation-Date: 2018-08-06 08:10-0300\n" 11 | "PO-Revision-Date: 2020-01-26 20:10-0300\n" 12 | "Last-Translator: Jean Lorenz Hertel \n" 13 | "Language-Team: LANGUAGE \n" 14 | "Language: pt_BR\n" 15 | "MIME-Version: 1.0\n" 16 | "Content-Type: text/plain; charset=UTF-8\n" 17 | "Content-Transfer-Encoding: 8bit\n" 18 | 19 | #: ../GUI.cpp:728 20 | msgid "Add Application app driver widget is not in glade file!" 21 | msgstr "Objeto window principal não está no arquivo glade!" 22 | 23 | #: ../GUI.cpp:721 24 | msgid "Add Application app executable widget is not in glade file!" 25 | msgstr "Objeto window principal não está no arquivo glade!" 26 | 27 | #: ../GUI.cpp:714 28 | msgid "Add Application app name widget is not in glade file!" 29 | msgstr "Objeto window principal não está no arquivo glade!" 30 | 31 | #: ../GUI.cpp:708 32 | msgid "Add Application dialog is not in glade file!" 33 | msgstr "Objeto window principal não está no arquivo glade!" 34 | 35 | #: ../GUI.cpp:96 36 | msgid "Add new" 37 | msgstr "Adicionar novo" 38 | 39 | #: ../GUI.cpp:638 40 | msgid "An advanced DRI configurator tool." 41 | msgstr "Uma ferramenta de configuração de DRI avançada." 42 | 43 | #: ../GUI.cpp:278 44 | msgid "Application %1 not found" 45 | msgstr "Aplicação %1 não encontrada" 46 | 47 | #: ../DriConf.glade.h:6 48 | msgid "Application executable:" 49 | msgstr "Executável da aplicação" 50 | 51 | #: ../DriConf.glade.h:5 52 | msgid "Application name:" 53 | msgstr "Nome da aplicação" 54 | 55 | #: ../GUI.cpp:692 56 | msgid "Application removed successfully." 57 | msgstr "Aplicação removida com sucesso." 58 | 59 | #: ../GUI.cpp:776 60 | msgid "Application successfully added." 61 | msgstr "Aplicação adicionada com sucesso." 62 | 63 | #: ../DriConf.glade.h:4 64 | msgid "Cancel" 65 | msgstr "Cancelar" 66 | 67 | #: ../main.cpp:70 68 | msgid "Checking if the system is supported" 69 | msgstr "Verificando se o sistema é suportado" 70 | 71 | #: ../Utils/XorgQuery.cpp:15 72 | msgid "Couldn't open X display" 73 | msgstr "Falhou ao abrir uma conexão com o servidor X" 74 | 75 | #: ../main.cpp:46 76 | msgid "Creating the GTK application object" 77 | msgstr "Criando o objecto de aplicação GTK" 78 | 79 | #: ../GUI.cpp:168 80 | msgid "Current language code is %1" 81 | msgstr "Código de lingua atual é %1" 82 | 83 | #: ../ValueObject/EGLDisplayWrapper.cpp:37 84 | msgid "Display is missing EGL_MESA_query_driver extension" 85 | msgstr "O display não possui a extensão EGL_MESA_query_driver" 86 | 87 | #: ../GUI.cpp:211 88 | msgid "Driver %1 not found" 89 | msgstr "Driver %1 não encontrado" 90 | 91 | #: ../Utils/ConfigurationResolver.cpp:213 92 | msgid "" 93 | "Driver '%1' doesn't support option '%2' on application '%3'. Option removed." 94 | msgstr "" 95 | "Driver '%1' não suporta a opção '%2' na aplicação '%3'. Opção será removida." 96 | 97 | #: ../Utils/WaylandQuery.cpp:57 98 | msgid "Driver doesn't support extension \"EGL_MESA_query_driver\"" 99 | msgstr "O driver não suporta a extensão \"EGL_MESA_query_driver\"" 100 | 101 | #: ../DriConf.glade.h:7 102 | msgid "Driver:" 103 | msgstr "Driver:" 104 | 105 | #: ../Utils/DRIQuery.cpp:28 106 | msgid "Enumerating DRI Devices" 107 | msgstr "Enumerando dispositivos DRI" 108 | 109 | #: ../Utils/Parser.cpp:167 110 | msgid "Exception caught during device XML parsing: %1" 111 | msgstr "Exceção pega durante a leitura do XML do dispositivo: %1" 112 | 113 | #: ../Utils/EGLDisplayFactory.cpp:14 114 | msgid "Failed to create EGL display" 115 | msgstr "Falhou ao criar display EGL" 116 | 117 | #: ../Utils/GBMDeviceFactory.cpp:18 118 | msgid "Failed to create GBM device for %1" 119 | msgstr "Falhou em criar o dispositivo GBM" 120 | 121 | #: ../Utils/EGLDisplayFactory.cpp:20 122 | msgid "Failed to initialize EGL display" 123 | msgstr "Falhou ao inicializar o display EGL" 124 | 125 | #: ../Utils/ConfigurationLoader.cpp:103 126 | msgid "Failed to load file: %1" 127 | msgstr "Falhou ao carregar arquivo: %1" 128 | 129 | #: ../Utils/GBMDeviceFactory.cpp:11 130 | msgid "Failed to open device %1" 131 | msgstr "Falhou ao abrir dispositivo %1" 132 | 133 | #: ../GUI.cpp:518 134 | msgid "Force Application to use GPU" 135 | msgstr "Aplicação %1 não encontrada" 136 | 137 | #: ../Utils/DRIQuery.cpp:33 138 | msgid "Found %1 devices" 139 | msgstr "Encontrou %1 dispositivo(s)" 140 | 141 | #: ../Utils/ConfigurationLoader.cpp:93 142 | msgid "Found configuration on path: %1" 143 | msgstr "Configuração encontrada no caminho: %1" 144 | 145 | #: ../Utils/DRIQuery.cpp:84 146 | msgid "GPU \"%1\" has the driver \"%2\"" 147 | msgstr "A GPU \"%1\" possui o driver \"%2\"" 148 | 149 | #: ../Utils/DRIQuery.cpp:57 150 | msgid "GPU has been detected as \"%1\" from \"%2\"" 151 | msgstr "GPU foi detectada como \"%1\" de \"%2\"" 152 | 153 | #: ../Utils/DRIQuery.cpp:75 154 | msgid "Generating EGL Display from GBM device for \"%1\"" 155 | msgstr "Gerando display EGL a partir do dispositivo GBM para \"%1\"" 156 | 157 | #: ../GUI.cpp:139 158 | msgid "Generating final XML for saving..." 159 | msgstr "Gerando XML final para salvar..." 160 | 161 | #: ../Utils/DRIQuery.cpp:66 162 | msgid "Generating gbm device for path \"%1\"" 163 | msgstr "Gerando dispositivo gbm para o caminho \"%1\"" 164 | 165 | #: ../Utils/ConfigurationLoader.cpp:17 166 | msgid "Legacy system-wide XML path: %1" 167 | msgstr "Caminho do XML de sistema legado: %1" 168 | 169 | #: ../Utils/ConfigurationLoader.cpp:24 170 | msgid "Legacy system-wide file doesn't exist" 171 | msgstr "O arquivo de sistema legado não existe" 172 | 173 | #: ../Utils/DRIQuery.cpp:90 174 | msgid "Loading driver options" 175 | msgstr "Carreagando opções do driver" 176 | 177 | #: ../GUI.cpp:71 178 | msgid "Main window object is not in glade file!" 179 | msgstr "Objeto window principal não está no arquivo glade!" 180 | 181 | #: ../Utils/XorgQuery.cpp:85 182 | msgid "" 183 | "Missing GLX_MESA_query_renderer extension. Probably this is a closed-source " 184 | "driver." 185 | msgstr "" 186 | "Extensão GLX_MESA_query_renderer está faltando. Provavelmente este é um " 187 | "driver de código fechado" 188 | 189 | #: ../GUI.cpp:314 190 | msgid "Notebook object not found in glade file!" 191 | msgstr "Objeto Notebook não encontrado no arquivo glade!" 192 | 193 | #: ../GUI.cpp:359 194 | msgid "Option %1 doesn't exist in application %2. Merge failed" 195 | msgstr "Opção %1 não existe na aplicação %2. Mesclagem falhou" 196 | 197 | #: ../GUI.cpp:533 198 | msgid "PRIME Settings" 199 | msgstr "Configurações PRIME" 200 | 201 | #: ../Utils/Parser.cpp:6 202 | msgid "Parsing XML %1" 203 | msgstr "Lendo XML %1" 204 | 205 | #: ../Utils/Parser.cpp:128 206 | msgid "Parsing device for XML: %1" 207 | msgstr "Escrevendo XML gerado: %1" 208 | 209 | #: ../Utils/DRIQuery.cpp:45 210 | msgid "Processing GPU with PCI ID \"%1\"" 211 | msgstr "Processando GPU com o PCI ID \"%1\"" 212 | 213 | #: ../Utils/ConfigurationLoader.cpp:10 214 | msgid "Reading legacy system-wide XML" 215 | msgstr "Lendo o XML de sistema legado" 216 | 217 | #: ../Utils/ConfigurationLoader.cpp:70 218 | msgid "Reading system-wide XML" 219 | msgstr "Lendo o XML de sistema" 220 | 221 | #: ../Utils/ConfigurationLoader.cpp:35 222 | msgid "Reading user defined XML" 223 | msgstr "Lendo o XML definido pelo usuário" 224 | 225 | #: ../GUI.cpp:108 226 | msgid "Remove current Application" 227 | msgstr "Remover aplicação atual" 228 | 229 | #: ../Utils/DRIQuery.cpp:124 230 | msgid "Skipping device %1 due to error: %2" 231 | msgstr "Ignorando dispositivo %1 devido ao erro: %2" 232 | 233 | #: ../GUI.cpp:642 234 | msgid "Source Code" 235 | msgstr "Código Fonte" 236 | 237 | #: ../GUI.cpp:62 238 | msgid "Start building GTK gui" 239 | msgstr "Iniciando construção da gui GTK" 240 | 241 | #: ../Utils/ConfigurationLoader.cpp:77 242 | msgid "System-wide XML path: %1" 243 | msgstr "Caminho do XML de sistema: %1" 244 | 245 | #: ../Utils/ConfigurationLoader.cpp:117 246 | msgid "System-wide configuration path doesn't exist!" 247 | msgstr "O caminho de configuração do sistema não existe!" 248 | 249 | #: ../GUI.cpp:693 250 | msgid "The application has been removed." 251 | msgstr "A aplicação foi removida." 252 | 253 | #: ../GUI.cpp:778 254 | msgid "The application was successfully added. Reloading default app options." 255 | msgstr "" 256 | "A aplicação foi adicionada com sucesso. Recarregando opções da aplicação " 257 | "padrão." 258 | 259 | #: ../GUI.cpp:678 260 | msgid "The default application cannot be removed." 261 | msgstr "A aplicação padrão não pode ser removida." 262 | 263 | #: ../GUI.cpp:679 264 | msgid "The driver needs a default configuration." 265 | msgstr "O driver precisa de uma aplicação padrão." 266 | 267 | #: ../Utils/DRIQuery.cpp:97 268 | msgid "Unable to extract configuration for driver %1" 269 | msgstr "Incapaz de extrair uma configuração para o driver %1" 270 | 271 | #: ../Utils/XorgQuery.cpp:31 272 | msgid "Unable to extract driver name for screen %1" 273 | msgstr "Incapaz de extrair uma configuração para o driver %1" 274 | 275 | #: ../GUI.cpp:658 276 | msgid "Unexpected response code from about dialog: %1" 277 | msgstr "Código de resposta do dialogo inesperado: %1" 278 | 279 | #: ../GUI.cpp:491 280 | msgid "Use default GPU of screen" 281 | msgstr "Usar GPU padrão da tela" 282 | 283 | #: ../Utils/ConfigurationLoader.cpp:49 284 | msgid "User defined XML doesn't exist" 285 | msgstr "O XML definido pelo usuário não existe" 286 | 287 | #: ../Utils/ConfigurationLoader.cpp:42 288 | msgid "User defined XML path: %1" 289 | msgstr "Caminho do XML definido pelo usuário: %1" 290 | 291 | #: ../Utils/ConfigurationLoader.cpp:139 292 | msgid "User defined configuration is empty. Returning an empty object" 293 | msgstr "" 294 | "Configuração definida pelo usuário está vazia. Retornando um objeto vazio" 295 | 296 | #: ../Utils/ConfigurationResolver.cpp:380 297 | msgid "" 298 | "User-defined driver '%1' on screen '%2' doesn't have a driver loaded on " 299 | "system. Configuration removed." 300 | msgstr "" 301 | "Driver '%1' definido pelo usuário na tela '%2' não possui um driver " 302 | "carregado no sistema. Configuração removida." 303 | 304 | #: ../GUI.cpp:751 305 | msgid "Validation error" 306 | msgstr "Erro de validação" 307 | 308 | #: ../GUI.cpp:146 309 | msgid "Writing generated XML: %1" 310 | msgstr "Escrevendo XML gerado: %1" 311 | 312 | #: ../GUI.cpp:753 313 | msgid "You need to specify the application name, executable and driver." 314 | msgstr "Você precisa especificar o nome da aplicação, executável e driver." 315 | 316 | #: ../DriConf.glade.h:2 317 | msgid "_Application" 318 | msgstr "Aplicação" 319 | 320 | #: ../DriConf.glade.h:1 321 | msgid "_File" 322 | msgstr "Arquivo" 323 | 324 | #: ../DriConf.glade.h:3 325 | msgid "_Help" 326 | msgstr "Ajuda" 327 | 328 | #: ../main.cpp:63 329 | msgid "adriconf running on Wayland" 330 | msgstr "adriconf executando em Wayland" 331 | 332 | #: ../main.cpp:66 333 | msgid "adriconf running on X11" 334 | msgstr "adriconf executando em X11" 335 | --------------------------------------------------------------------------------