Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve Xorg output parsing smartness, improve optirun output on fail…
…ure.
  • Loading branch information
Thulinma committed Jan 12, 2012
1 parent 36bae2d commit f57f68d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/bblogger.c
Expand Up @@ -132,10 +132,11 @@ static void parse_xorg_output(char * string){
/* Warning lines are warnings. */
if (strncmp(string, "(WW)", 4) == 0){
prio = LOG_WARNING;
/* recognize some of the less usefull nouveau warnings, degrade them to LOG_INFO level. */
if (strstr(string, "trying again")){prio = LOG_INFO;}/* warning about no outputs being found connected */
if (strstr(string, "initial framebuffer")){prio = LOG_INFO;}/* warning for set resolution with no screen attached */
if (strstr(string, "looking for one")){prio = LOG_INFO;}/* no keyboard/mouse warning */
/* recognize some of the less useful nouveau/nvidia warnings, degrade them to LOG_INFO level. */
if (strstr(string, "trying again")){prio = LOG_INFO;}/* nouveau: warning about no outputs being found connected */
if (strstr(string, "initial framebuffer")){prio = LOG_INFO;}/* nouveau: warning for set resolution with no screen attached */
if (strstr(string, "looking for one")){prio = LOG_INFO;}/* nouveau: no keyboard/mouse warning */
if (strstr(string, "EDID")){prio = LOG_INFO;}/* nvidia: cannot read EDID warning */
/* Recognize nvidia complaining about ConnectedMonitor setting */
if (strstr(string, "valid display devices are")){
valid = strstr(string, "'");//find the '-character
Expand Down
5 changes: 3 additions & 2 deletions src/optirun.c
Expand Up @@ -106,12 +106,13 @@ static int run_app(int argc, char *argv[]) {
while (bb_status.bb_socket != -1) {
r = socketRead(&bb_status.bb_socket, buffer, BUFFER_SIZE);
if (r > 0) {
bb_log(LOG_INFO, "Response: %*s\n", r, buffer);
bb_log(LOG_INFO, "Response: %s\n", buffer);
switch (buffer[0]) {
case 'N': //No, run normally.
bb_log(LOG_ERR, "Cannot access secondary GPU%s\n", buffer+2);
socketClose(&bb_status.bb_socket);
if (!bb_config.fallback_start) {
bb_log(LOG_ERR, "Cannot access secondary GPU. Aborting.\n");
bb_log(LOG_ERR, "Aborting because fallback start is disabled.\n");
}
break;
case 'Y': //Yes, run through vglrun
Expand Down

0 comments on commit f57f68d

Please sign in to comment.