From 839d7f4dc2446615bc13c2e242348ed49a8fdd12 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 17 Jul 2018 13:19:48 +0900 Subject: [PATCH] e blanking - offer option to not use dpms so a new bug in a gpu driver. if dpms is enabled, wakeup doesn't happen. mouse doesn't do anything, rendering doesn't happen... i can use the keyboard and ctrl+alt+enmd restart e or killall -HUP enlightenment and e restarts and renders ... but nothing appears. interestingly if i let it timeout again and wake it up a second time... things render (but e is confused it seems and mouse input doesnt work until i restart e). it's some kind of xorg/driver bug here with this dpms - no dpms and all is fine. all e does with regards to dplms is enable or disbale it (and set the timeouts) so e isn't doing antyhign special otherwise with dpms on vs off ... so somethnig deeper down the stack here, but to get a desktop that works at least for now, add an option to not use dpms. --- src/bin/e_config.c | 1 + src/bin/e_config.h | 1 + src/bin/e_dpms.c | 14 ++++++++++++-- src/bin/e_screensaver.c | 13 ++++++++----- .../conf_display/e_int_config_screensaver.c | 6 ++++++ 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 5abf91bae..136c00825 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -615,6 +615,7 @@ _e_config_edd_init(Eina_Bool old) E_CONFIG_VAL(D, T, screensaver_interval, INT); E_CONFIG_VAL(D, T, screensaver_blanking, INT); E_CONFIG_VAL(D, T, screensaver_expose, INT); + E_CONFIG_VAL(D, T, screensaver_dpms_off, UCHAR); E_CONFIG_VAL(D, T, screensaver_ask_presentation, UCHAR); E_CONFIG_VAL(D, T, screensaver_ask_presentation_timeout, DOUBLE); E_CONFIG_VAL(D, T, screensaver_desklock_timeout, INT); diff --git a/src/bin/e_config.h b/src/bin/e_config.h index 0ac67f144..8aa13474c 100644 --- a/src/bin/e_config.h +++ b/src/bin/e_config.h @@ -219,6 +219,7 @@ struct _E_Config int screensaver_interval; // GUI int screensaver_blanking; // GUI int screensaver_expose; // GUI + unsigned char screensaver_dpms_off; // GUI unsigned char screensaver_ask_presentation; // GUI double screensaver_ask_presentation_timeout; // GUI int screensaver_desklock_timeout; // GUI diff --git a/src/bin/e_dpms.c b/src/bin/e_dpms.c index 9bda36c32..026e3cc62 100644 --- a/src/bin/e_dpms.c +++ b/src/bin/e_dpms.c @@ -41,7 +41,12 @@ e_dpms_update(void) _e_dpms_enabled = enabled; #ifndef HAVE_WAYLAND_ONLY if (e_comp->comp_type == E_PIXMAP_TYPE_X) - ecore_x_dpms_enabled_set(enabled); + { + if (!e_config->screensaver_dpms_off) + ecore_x_dpms_enabled_set(enabled); + else + ecore_x_dpms_enabled_set(0); + } #endif } if (!enabled) return; @@ -86,7 +91,12 @@ e_dpms_force_update(void) (!e_config->mode.presentation)); #ifndef HAVE_WAYLAND_ONLY if (e_comp->comp_type == E_PIXMAP_TYPE_X) - ecore_x_dpms_enabled_set(enabled); + { + if (!e_config->screensaver_dpms_off) + ecore_x_dpms_enabled_set(enabled); + else + ecore_x_dpms_enabled_set(0); + } #endif if (!enabled) return; diff --git a/src/bin/e_screensaver.c b/src/bin/e_screensaver.c index da0ea2d3a..ef313c562 100644 --- a/src/bin/e_screensaver.c +++ b/src/bin/e_screensaver.c @@ -149,12 +149,15 @@ e_screensaver_update(void) // screen doesnt turn off at all because x thinks interanlly // that the monitor is still off... so this is odd, but it's // necessary on some hardware. - int enabled; + if (!e_config->screensaver_dpms_off) + { + int enabled; - enabled = ((e_config->screensaver_enable) && - (!e_config->mode.presentation)); - ecore_x_dpms_enabled_set(!enabled); - ecore_x_dpms_enabled_set(enabled); + enabled = ((e_config->screensaver_enable) && + (!e_config->mode.presentation)); + ecore_x_dpms_enabled_set(!enabled); + ecore_x_dpms_enabled_set(enabled); + } ecore_x_screensaver_set(timeout, interval, blanking, expose); } } diff --git a/src/modules/conf_display/e_int_config_screensaver.c b/src/modules/conf_display/e_int_config_screensaver.c index 2568325de..ef4c8997c 100644 --- a/src/modules/conf_display/e_int_config_screensaver.c +++ b/src/modules/conf_display/e_int_config_screensaver.c @@ -32,6 +32,7 @@ struct _E_Config_Dialog_Data int wake_on_notify; int wake_on_urgent; int no_dpms_on_fullscreen; + int use_dpms; struct { @@ -77,6 +78,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) cfdata->wake_on_notify = e_config->screensaver_wake_on_notify; cfdata->wake_on_urgent = e_config->screensaver_wake_on_urgent; cfdata->no_dpms_on_fullscreen = e_config->no_dpms_on_fullscreen; + cfdata->use_dpms = !e_config->screensaver_dpms_off; } static void * @@ -133,6 +135,7 @@ _basic_apply(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfdata) } e_config->no_dpms_on_fullscreen = cfdata->no_dpms_on_fullscreen; + e_config->screensaver_dpms_off = !cfdata->use_dpms; /* Apply settings */ e_screensaver_update(); @@ -172,6 +175,9 @@ _basic_create(E_Config_Dialog *cfd EINA_UNUSED, Evas *evas, E_Config_Dialog_Data oc = e_widget_check_add(evas, _("Enable screen blanking"), &(cfdata->enable_screensaver)); e_widget_list_object_append(ol, oc, 1, 1, 0.5); + oc2 = e_widget_check_add(evas, _("Use Power Saving (DPMS)"), + &(cfdata->use_dpms)); + e_widget_list_object_append(ol, oc2, 1, 1, 0.5); ow = e_widget_label_add(evas, _("Timeout")); e_widget_check_widget_disable_on_unchecked_add(oc, ow);