From a8a6f6a024b49c4c714b8b46250778a15df95622 Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Sat, 8 Jul 2017 04:19:01 +0200 Subject: [PATCH 1/8] two last commits now also in develop branch --- Makefile.am | 4 +- src/bbconfig.c | 29 +++++-- src/findpathwild.c | 203 ++++++++++++++++++++++++++++++++++++++++++++ src/findpathwild.h | 22 +++++ test/bumblebee.conf | 69 +++++++++++++++ 5 files changed, 320 insertions(+), 7 deletions(-) create mode 100644 src/findpathwild.c create mode 100644 src/findpathwild.h create mode 100644 test/bumblebee.conf diff --git a/Makefile.am b/Makefile.am index 78e238a..23ebfa3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,12 +59,12 @@ sbin_PROGRAMS = bin/bumblebeed bin_PROGRAMS = bin/optirun bin_optirun_SOURCES = src/module.c src/bbconfig.c src/bblogger.c src/bbrun.c \ - src/bbsocket.c src/optirun.c src/bbsocketclient.c + src/bbsocket.c src/optirun.c src/bbsocketclient.c src/findpathwild.c bin_optirun_LDADD = ${glib_LIBS} ${kmod_LIBS} -lrt bin_bumblebeed_SOURCES = src/pci.c src/bbconfig.c src/bblogger.c src/bbrun.c \ src/bbsocket.c src/module.c src/bbsecondary.c src/switch/switching.c \ src/switch/sw_bbswitch.c src/switch/sw_switcheroo.c \ - src/driver.c src/bumblebeed.c + src/driver.c src/bumblebeed.c src/findpathwild.c bin_bumblebeed_LDADD = ${x11_LIBS} ${libbsd_LIBS} ${glib_LIBS} ${kmod_LIBS} -lrt dist_doc_DATA = $(relnotes) README.markdown diff --git a/src/bbconfig.c b/src/bbconfig.c index 62a3306..6cbc845 100644 --- a/src/bbconfig.c +++ b/src/bbconfig.c @@ -34,6 +34,7 @@ #include "bbconfig.h" #include "bblogger.h" #include "module.h" +#include "findpathwild.h" /* config values for PM methods, edit bb_pm_method in bbconfig.h as well! */ const char *bb_pm_method_string[PM_METHODS_COUNT] = { @@ -376,7 +377,10 @@ GKeyFile *bbconfig_parse_conf(void) { section = "optirun"; key = "Bridge"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { - free_and_set_value(&bb_config.optirun_bridge, g_key_file_get_string(bbcfg, section, key, NULL)); + char* primusLibraryPath; + primusLibraryPath = malloc(MAX_STR_LEN); + findPathListWild(primusLibraryPath, g_key_file_get_string(bbcfg, section, key, NULL)); + free_and_set_value(&bb_config.primus_ld_path, primusLibraryPath); } key = "PrimusLibraryPath"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { @@ -423,7 +427,10 @@ GKeyFile *bbconfig_parse_conf(void) { } key = "XorgConfDir"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { - free_and_set_value(&bb_config.x_conf_dir, g_key_file_get_string(bbcfg, section, key, NULL)); + char* xorgConfDir; + xorgConfDir = malloc(MAX_STR_LEN); + findPathListWild(xorgConfDir, g_key_file_get_string(bbcfg, section, key, NULL)); + free_and_set_value(&bb_config.x_conf_dir, xorgConfDir); } key = "XorgBinary"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { @@ -457,18 +464,30 @@ void bbconfig_parse_conf_driver(GKeyFile *bbcfg, char *driver) { /* if KernelDriver is empty, the default behavior is to copy Driver which * is done in driver_detect() */ if (*module_name) { - free_and_set_value(&bb_config.module_name, module_name); + char* kernelDriver; + kernelDriver = malloc(MAX_STR_LEN); + if(findDriverWild(kernelDriver, module_name)) { + free_and_set_value(&bb_config.module_name, kernelDriver); + } else { + free_and_set_value(&bb_config.module_name, module_name); + } } else { g_free(module_name); } } key = "LibraryPath"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { - free_and_set_value(&bb_config.ld_path, g_key_file_get_string(bbcfg, section, key, NULL)); + char* libraryPath; + libraryPath = malloc(MAX_STR_LEN); + findPathListWild(libraryPath, g_key_file_get_string(bbcfg, section, key, NULL)); + free_and_set_value(&bb_config.ld_path, libraryPath); } key = "XorgModulePath"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { - free_and_set_value(&bb_config.mod_path, g_key_file_get_string(bbcfg, section, key, NULL)); + char* xorgModulePath; + xorgModulePath = malloc(MAX_STR_LEN); + findPathListWildDelim(xorgModulePath, g_key_file_get_string(bbcfg, section, key, NULL), ','); + free_and_set_value(&bb_config.mod_path, xorgModulePath); } key = "PMMethod"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { diff --git a/src/findpathwild.c b/src/findpathwild.c new file mode 100644 index 0000000..c169c6f --- /dev/null +++ b/src/findpathwild.c @@ -0,0 +1,203 @@ +/*********************************************************************** + + Copyright (c) 2017 Stefan Helmert + + ***********************************************************************/ + +#include "findpathwild.h" +#include +#include +#include +#include +#include +#include +#include + + +char* getRootPath(char *rootPath, char *wildPath) +{ + char c; + c = 1; + unsigned pidxend = 0; + for(int i=0; c && i < MAX_STR_LEN; i++){ + c = wildPath[i]; + rootPath[i] = c; + if('/' == c){ + pidxend = i; + } + if('?' == c){ + rootPath[pidxend] = 0; + return &wildPath[pidxend+1]; // may be dangerous, bacause reduces maximum string length + } + } + return ""; +} + +char* splitStr(char* str, char delim) +{ + char c; + c = 1; + for(int i=0; c && i < MAX_STR_LEN; i++){ + c = str[i]; + if(delim == c){ + str[i] = 0; + return &str[i+1]; + } + + } + return ""; +} + +int cmpStrWild(char* inputStr, char* wildStr) +{ + char ci, cw; + ci = 1; + cw = 1; + for(int i = 0; ci && cw && i < MAX_STR_LEN; i++){ + ci = inputStr[i]; + cw = wildStr[i]; + if(ci == cw) continue; + if('?' == cw) continue; + return 0; + } + if(0 == ci && 0 == cw) return 1; + return 0; +} + +char* findPathWild(char* foundPath, char* wildPath) +{ + DIR *dir; + struct dirent *ent; + char found[MAX_STR_LEN]; + char rootPath[MAX_STR_LEN]; + char currentLabel[MAX_STR_LEN]; + char* pathEnd; + int cmpResult; + + + if('/' == wildPath[strlen(wildPath) -1]){ + wildPath[strlen(wildPath) -1] = 0; + } + + pathEnd = getRootPath(rootPath, wildPath); + strncpy(currentLabel, pathEnd, MAX_STR_LEN - 1); + pathEnd = splitStr(currentLabel, '/'); + strncat(rootPath, "/", MAX_STR_LEN - strlen(rootPath) - 1); + // structur: /root/Path / currentLabel / p?th/E?d/ + // | rootPath | currentLabel | pathEnd + + if ((dir = opendir (rootPath)) != NULL) { // acceppt only if path exists + if(0 == currentLabel[0]) { // no currentLabel means end of path reached + strncpy(foundPath, rootPath, MAX_STR_LEN - 1); + closedir (dir); + return foundPath; // means the path is found in deepest recursion + } + while ((ent = readdir (dir)) != NULL) { // go through all dirs in rootPath + cmpResult = cmpStrWild(ent->d_name, currentLabel); // check if wildcard matches + if(cmpResult) { // found match - next recursion step, process inner directory wildcards + strncpy(found, rootPath, MAX_STR_LEN - 1); + strncat(found, ent->d_name, MAX_STR_LEN - strlen(found) - 1); + strncat(found, "/", MAX_STR_LEN - strlen(found) - 1); + strncat(found, pathEnd, MAX_STR_LEN - strlen(found) - 1); + if(findPathWild(foundPath, found) != NULL) { + closedir (dir); + return foundPath; + } + } + } + closedir (dir); + return NULL; + } else { + return NULL; + } +} + + +char* findPathListWildDelim(char* foundPathList, char* wildPathList, char delim) +{ + char lWildPathList[MAX_STR_LEN] = ""; + char foundPath[MAX_STR_LEN] = ""; + char* nextStr; + char* wildPath; + char delimStr[2]; + delimStr[0] = delim; + delimStr[1] = 0; + foundPathList[0] = 0; + strncpy(lWildPathList, wildPathList, MAX_STR_LEN - 1); + wildPath = lWildPathList; + while(1){ + nextStr = splitStr(wildPath, delim); + + if(0 == wildPath[0]) { + return foundPathList; + } + + if(findPathWild(foundPath, wildPath)){ + if(0 != foundPathList[0]) { + strncat(foundPathList, delimStr, MAX_STR_LEN - strlen(foundPathList) - 1); + } + strncat(foundPathList, foundPath, MAX_STR_LEN - strlen(foundPathList) - 1); + } + wildPath = nextStr; + } + return NULL; +} + +char* findPathListWild(char* foundPathList, char* wildPathList) +{ + return findPathListWildDelim(foundPathList, wildPathList, ':'); +} + +char* findFileWild(char* foundDriver, char* fileNameWild, char* rootPath) +{ + DIR *dir; + struct dirent *ent; + char recursePath[MAX_STR_LEN]; + char* ret; + if ((dir = opendir (rootPath)) != NULL) { + while ((ent = readdir (dir)) != NULL) { + if(0 == strcmp(ent->d_name, ".")) continue; + if(0 == strcmp(ent->d_name, "..")) continue; + strncpy(recursePath, rootPath, MAX_STR_LEN - 1); + strncat(recursePath, "/", MAX_STR_LEN - strlen(recursePath) - 1); + strncat(recursePath, ent->d_name, MAX_STR_LEN - strlen(recursePath) - 1); + if(NULL != (ret = findFileWild(foundDriver, fileNameWild, recursePath))) { + return ret; + } + + } + closedir (dir); + return NULL; + } else { // can't open dir (is file or dir has not the right permissions) + struct stat s; + stat(rootPath, &s); + if(S_ISREG(s.st_mode)) { // is a file + if(cmpStrWild(basename(rootPath), fileNameWild)) { + strncpy(foundDriver, basename(rootPath), MAX_STR_LEN - 1); + return rootPath; + } + } + return NULL; + } +} + +char* findDriverWild(char* foundDriver, char* driverNameWild) +{ + struct utsname unameData; + char rootPath[MAX_STR_LEN]; + char wild[MAX_STR_LEN]; + char* ret; + if(uname(&unameData)) { + return NULL; + } + strncpy(rootPath, "/lib/modules/", MAX_STR_LEN - 1); + strncat(rootPath, unameData.release, MAX_STR_LEN - strlen(rootPath) - 1); + strncpy(wild, driverNameWild, MAX_STR_LEN - 1); + strncat(wild, ".ko", MAX_STR_LEN - strlen(wild) - 1); + ret = findFileWild(foundDriver, wild, rootPath); + foundDriver[strlen(foundDriver) - 3] = 0; + return ret; +} + + + diff --git a/src/findpathwild.h b/src/findpathwild.h new file mode 100644 index 0000000..9de61df --- /dev/null +++ b/src/findpathwild.h @@ -0,0 +1,22 @@ +/*********************************************************************** + + Copyright (c) 2017 Stefan Helmert + + ***********************************************************************/ + + +#define MAX_STR_LEN 512 + +char* getRootPath(char *rootPath, char *wildPath); +char* splitStr(char* str, char delim); +int cmpStrWild(char* inputStr, char* wildStr); +char* findPathWild(char* foundPath, char* wildPath); +char* findPathListWildDelim(char* foundPathList, char* wildPathList, char delim); +char* findPathListWild(char* foundPathList, char* wildPathList); +char* findFileWild(char* foundDriver, char* fileNameWild, char* rootPath); +char* findDriverWild(char* foundDriver, char* driverNameWild); + + + + + diff --git a/test/bumblebee.conf b/test/bumblebee.conf new file mode 100644 index 0000000..30243d8 --- /dev/null +++ b/test/bumblebee.conf @@ -0,0 +1,69 @@ +# Configuration file for Bumblebee. Values should **not** be put between quotes + +## Server options. Any change made in this section will need a server restart +# to take effect. +[bumblebeed] +# The secondary Xorg server DISPLAY number +VirtualDisplay=:8 +# Should the unused Xorg server be kept running? Set this to true if waiting +# for X to be ready is too long and don't need power management at all. +KeepUnusedXServer=false +# The name of the Bumbleblee server group name (GID name) +ServerGroup=bumblebee +# Card power state at exit. Set to false if the card shoud be ON when Bumblebee +# server exits. +TurnCardOffAtExit=false +# The default behavior of '-f' option on optirun. If set to "true", '-f' will +# be ignored. +NoEcoModeOverride=false +# The Driver used by Bumblebee server. If this value is not set (or empty), +# auto-detection is performed. The available drivers are nvidia and nouveau +# (See also the driver-specific sections below) +Driver = nvidia +# Directory with a dummy config file to pass as a -configdir to secondary X +XorgConfDir=/etc/bumblebee/xorg.conf.d + +## Client options. Will take effect on the next optirun executed. +[optirun] +# Acceleration/ rendering bridge, possible values are auto, virtualgl and +# primus. +Bridge=auto +# The method used for VirtualGL to transport frames between X servers. +# Possible values are proxy, jpeg, rgb, xv and yuv. +VGLTransport=proxy +# List of paths which are searched for the primus libGL.so.1 when using +# the primus bridge +PrimusLibraryPath=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus +# Should the program run under optirun even if Bumblebee server or nvidia card +# is not available? +AllowFallbackToIGC=false + + +# Driver-specific settings are grouped under [driver-NAME]. The sections are +# parsed if the Driver setting in [bumblebeed] is set to NAME (or if auto- +# detection resolves to NAME). +# PMMethod: method to use for saving power by disabling the nvidia card, valid +# values are: auto - automatically detect which PM method to use +# bbswitch - new in BB 3, recommended if available +# switcheroo - vga_switcheroo method, use at your own risk +# none - disable PM completely +# https://github.com/Bumblebee-Project/Bumblebee/wiki/Comparison-of-PM-methods + +## Section with nvidia driver specific options, only parsed if Driver=nvidia +[driver-nvidia] +# Module name to load, defaults to Driver if empty or unset +KernelDriver = nvidia_??? +PMMethod=auto +# colon-separated path to the nvidia libraries +LibraryPath = /usr/lib/nvidia-???:/usr/lib32/nvidia-??? +# comma-separated path of the directory containing nvidia_drv.so and the +# default Xorg modules path +XorgModulePath = /usr/lib/nvidia-???/xorg,/usr/lib/xorg/modules +XorgConfFile=/etc/bumblebee/xorg.conf.nvidia + +## Section with nouveau driver specific options, only parsed if Driver=nouveau +[driver-nouveau] +KernelDriver=nouveau +PMMethod=auto +XorgConfFile=/etc/bumblebee/xorg.conf.nouveau + From a3f54d5946ea17207d4482d2662392915f21321b Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Sat, 8 Jul 2017 04:42:07 +0200 Subject: [PATCH 2/8] added new header to Makefile.am for distcheck --- Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.am b/Makefile.am index 23ebfa3..73f60a4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -47,6 +47,7 @@ EXTRA_DIST = scripts/systemd/bumblebeed.service.in \ src/bbsocketclient.h \ src/bbsocket.h \ src/driver.h \ + src/findpathwild.h \ src/module.h \ src/pci.h \ src/switch/switching.h From 79d606aaa6f0a303a720579300320a3b158e3f0d Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Sat, 8 Jul 2017 04:47:50 +0200 Subject: [PATCH 3/8] added new header to Makefile.am for distcheck --- src/findpathwild.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/findpathwild.c b/src/findpathwild.c index c169c6f..7a5a8d7 100644 --- a/src/findpathwild.c +++ b/src/findpathwild.c @@ -19,7 +19,8 @@ char* getRootPath(char *rootPath, char *wildPath) char c; c = 1; unsigned pidxend = 0; - for(int i=0; c && i < MAX_STR_LEN; i++){ + int i; + for(i=0; c && i < MAX_STR_LEN; i++){ c = wildPath[i]; rootPath[i] = c; if('/' == c){ @@ -37,7 +38,8 @@ char* splitStr(char* str, char delim) { char c; c = 1; - for(int i=0; c && i < MAX_STR_LEN; i++){ + int i; + for(i=0; c && i < MAX_STR_LEN; i++){ c = str[i]; if(delim == c){ str[i] = 0; @@ -53,7 +55,8 @@ int cmpStrWild(char* inputStr, char* wildStr) char ci, cw; ci = 1; cw = 1; - for(int i = 0; ci && cw && i < MAX_STR_LEN; i++){ + int i; + for(i = 0; ci && cw && i < MAX_STR_LEN; i++){ ci = inputStr[i]; cw = wildStr[i]; if(ci == cw) continue; From 3cc5a750cef35ddab4ab0a48354edcd716267a1a Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Sun, 9 Jul 2017 04:01:40 +0200 Subject: [PATCH 4/8] prime-select intel at bumblebee startup --- scripts/systemd/bumblebeed.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/systemd/bumblebeed.service.in b/scripts/systemd/bumblebeed.service.in index 7a4cbc7..c2891a1 100644 --- a/scripts/systemd/bumblebeed.service.in +++ b/scripts/systemd/bumblebeed.service.in @@ -3,6 +3,7 @@ Description=Bumblebee C Daemon [Service] Type=simple +ExecStartPre=/usr/bin/prime-select intel ExecStart=@SBINDIR@/bumblebeed --use-syslog Restart=always RestartSec=60 From 2144c806c13201f392ae0a8b869187e4efe7d61d Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Sun, 9 Jul 2017 17:34:59 +0200 Subject: [PATCH 5/8] solved misstake porting to develop branch; added quickinstall script (tested on Ubuntu 16.04) --- quickinstall.bash | 12 ++++++++++++ src/bbconfig.c | 8 ++++---- 2 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 quickinstall.bash diff --git a/quickinstall.bash b/quickinstall.bash new file mode 100755 index 0000000..85d9bde --- /dev/null +++ b/quickinstall.bash @@ -0,0 +1,12 @@ +#!/bin/bash + +make clean +autoreconf -fi +./configure CONF_DRIVER=nvidia CONF_DRIVER_MODULE_NVIDIA=nvidia???? \ + CONF_PRIMUS_LD_PATH=/usr/lib/x86_64-linux-gnu/primus:/usr/lib/i386-linux-gnu/primus \ + CONF_LDPATH_NVIDIA=/usr/lib/nvidia????:/usr/lib32/nvidia???? \ + CONF_MODPATH_NVIDIA=/usr/lib/nvidia????/xorg,/usr/lib/xorg/modules \ +make +sudo make install + + diff --git a/src/bbconfig.c b/src/bbconfig.c index 6cbc845..f9bb6b5 100644 --- a/src/bbconfig.c +++ b/src/bbconfig.c @@ -376,16 +376,16 @@ GKeyFile *bbconfig_parse_conf(void) { // [optirun] section = "optirun"; key = "Bridge"; + if (g_key_file_has_key(bbcfg, section, key, NULL)) { + free_and_set_value(&bb_config.optirun_bridge, g_key_file_get_string(bbcfg, section, key, NULL)); + } + key = "PrimusLibraryPath"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { char* primusLibraryPath; primusLibraryPath = malloc(MAX_STR_LEN); findPathListWild(primusLibraryPath, g_key_file_get_string(bbcfg, section, key, NULL)); free_and_set_value(&bb_config.primus_ld_path, primusLibraryPath); } - key = "PrimusLibraryPath"; - if (g_key_file_has_key(bbcfg, section, key, NULL)) { - free_and_set_value(&bb_config.primus_ld_path, g_key_file_get_string(bbcfg, section, key, NULL)); - } key = "VGLTransport"; if (g_key_file_has_key(bbcfg, section, key, NULL)) { free_and_set_value(&bb_config.vgl_compress, g_key_file_get_string(bbcfg, section, key, NULL)); From 2a7837684cb1a8ffc44131b35a3628fca9736083 Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Sun, 9 Jul 2017 22:34:09 +0200 Subject: [PATCH 6/8] prime-select only if available --- scripts/systemd/bumblebeed.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/systemd/bumblebeed.service.in b/scripts/systemd/bumblebeed.service.in index c2891a1..5c8eeb0 100644 --- a/scripts/systemd/bumblebeed.service.in +++ b/scripts/systemd/bumblebeed.service.in @@ -3,7 +3,7 @@ Description=Bumblebee C Daemon [Service] Type=simple -ExecStartPre=/usr/bin/prime-select intel +ExecStartPre=-/usr/bin/prime-select intel ExecStart=@SBINDIR@/bumblebeed --use-syslog Restart=always RestartSec=60 From 060629c2fa7c6a8011df9555c9896272549a49b2 Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Sun, 9 Jul 2017 23:18:30 +0200 Subject: [PATCH 7/8] updated/correct GPL headers --- src/bbconfig.c | 3 ++- src/findpathwild.c | 27 +++++++++++++++++++++++---- src/findpathwild.h | 27 +++++++++++++++++++++++---- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/src/bbconfig.c b/src/bbconfig.c index f9bb6b5..af3d732 100644 --- a/src/bbconfig.c +++ b/src/bbconfig.c @@ -1,7 +1,8 @@ /* - * Copyright (c) 2011-2013, The Bumblebee Project + * Copyright (c) 2011-2017, The Bumblebee Project * Author: Joaquín Ignacio Aramendía samsagax@gmail.com * Author: Jaron Viëtor AKA "Thulinma" + * Author: Stefan Helmert AKA "TheTesla" * * This file is part of Bumblebee. * diff --git a/src/findpathwild.c b/src/findpathwild.c index 7a5a8d7..fe2c0f5 100644 --- a/src/findpathwild.c +++ b/src/findpathwild.c @@ -1,8 +1,27 @@ -/*********************************************************************** +/* + * Copyright (c) 2017, The Bumblebee Project + * Author: Stefan Helmert AKA "TheTesla" + * + * This file is part of Bumblebee. + * + * Bumblebee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Bumblebee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Bumblebee. If not, see . + */ + +/* + * findpathwild.c: Bumblebee wildcard handler for configuration file handler + */ - Copyright (c) 2017 Stefan Helmert - - ***********************************************************************/ #include "findpathwild.h" #include diff --git a/src/findpathwild.h b/src/findpathwild.h index 9de61df..5f862f9 100644 --- a/src/findpathwild.h +++ b/src/findpathwild.h @@ -1,8 +1,27 @@ -/*********************************************************************** +/* + * Copyright (c) 2017, The Bumblebee Project + * Author: Stefan Helmert AKA "TheTesla" + * + * This file is part of Bumblebee. + * + * Bumblebee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Bumblebee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Bumblebee. If not, see . + */ + +/* + * findpathwild.h: Bumblebee wildcard handler for configuration file handler + */ - Copyright (c) 2017 Stefan Helmert - - ***********************************************************************/ #define MAX_STR_LEN 512 From 0ca87f36a2a6d4cf133c41d5408d022b47b07c6a Mon Sep 17 00:00:00 2001 From: Stefan Helmert Date: Mon, 17 Jul 2017 03:35:16 +0200 Subject: [PATCH 8/8] empty initialisation needed to allow powersaving wo ext. display and enable ext. displ. if connected --- conf/xorg.conf.nvidia | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conf/xorg.conf.nvidia b/conf/xorg.conf.nvidia index 5bd686e..9117a27 100644 --- a/conf/xorg.conf.nvidia +++ b/conf/xorg.conf.nvidia @@ -28,9 +28,11 @@ Section "Device" # render it unusable (unless you have some way to run killall Xorg). Option "ProbeAllGpus" "false" + Option "AllowEmptyInitialConfiguration" "true" + Option "NoLogo" "true" - Option "UseEDID" "false" - Option "UseDisplayDevice" "none" +# Option "UseEDID" "false" +# Option "UseDisplayDevice" "none" # If your NVIDIA drivers are version 331.13 or newer, and you have a laptop # where some of the video outputs such as HDMI or DisplayPort are connected