summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-06-21 12:55:17 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-06-21 12:55:17 -0400
commit51b589da6a56e9a0bf36226318da4917ec3218fb (patch)
tree247106d4ecb770a32b7930595810adfb15ccbe4a
parentb2a4f45790bd6d3beba494d55e269cc0650f0848 (diff)
downloadefl-51b589da6a56e9a0bf36226318da4917ec3218fb.tar.gz
ecore-drm2: Fix redrawing screen when we vt-switch back to a session
When we vt-switch away from a running session, we need to disable rendering to an output and re-enable when we switch back. This patch set essentially makes vt-switching work again in Enlightenment Wayland. Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_device.c9
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_fb.c2
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c6
3 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_device.c b/src/lib/ecore_drm2/ecore_drm2_device.c
index 95b7315935..ad786e8269 100644
--- a/src/lib/ecore_drm2/ecore_drm2_device.c
+++ b/src/lib/ecore_drm2/ecore_drm2_device.c
@@ -9,12 +9,19 @@
#endif
static Eina_Bool
-_cb_session_active(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+_cb_session_active(void *data, int type EINA_UNUSED, void *event)
{
+ Eina_List *l;
+ Ecore_Drm2_Device *device;
+ Ecore_Drm2_Output *output;
Elput_Event_Session_Active *ev;
Ecore_Drm2_Event_Activate *ea;
ev = event;
+ device = data;
+
+ EINA_LIST_FOREACH(device->outputs, l, output)
+ ecore_drm2_output_enabled_set(output, ev->active);
ea = calloc(1, sizeof(Ecore_Drm2_Event_Activate));
if (!ea) return ECORE_CALLBACK_RENEW;
diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 9032c122be..4b6b9a57a2 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -225,6 +225,8 @@ ecore_drm2_fb_flip(Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output, void *data)
EINA_SAFETY_ON_NULL_RETURN_VAL(output, -1);
EINA_SAFETY_ON_NULL_RETURN_VAL(output->current_mode, -1);
+ if (!output->enabled) return -1;
+
if (output->next)
WRN("Fb reused too soon, tearing may be visible");
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 7596164f73..b8436ef70a 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -964,7 +964,11 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled)
if (output->enabled)
ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON);
else
- ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF);
+ {
+ ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF);
+ output->current = NULL;
+ output->next = NULL;
+ }
_output_event_send(output);
}