aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-01-03 07:41:15 +0000
committerChris Michael <cp.michael@samsung.com>2014-01-29 15:27:22 +0000
commit624fe65bda8c03d541627a3e7395c981f90b022b (patch)
tree80683c8f01b02df2cec64414743b18e058ee2196
parentAdd TODO (diff)
downloadefl-624fe65bda8c03d541627a3e7395c981f90b022b.tar.gz
Enable/Disable outputs & inputs during vt switch
Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm/ecore_drm_tty.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_tty.c b/src/lib/ecore_drm/ecore_drm_tty.c
index 54eb62f8b9..41a0561fb7 100644
--- a/src/lib/ecore_drm/ecore_drm_tty.c
+++ b/src/lib/ecore_drm/ecore_drm_tty.c
@@ -25,8 +25,27 @@ _ecore_drm_tty_cb_signal(void *data, int type EINA_UNUSED, void *event)
if (ev->number == 1)
{
+ Ecore_Drm_Input *input;
+ Ecore_Drm_Output *output;
+ Ecore_Drm_Sprite *sprite;
+ Eina_List *l;
+
DBG("Release VT");
+ /* disable inputs (suspends) */
+ EINA_LIST_FOREACH(dev->inputs, l, input)
+ ecore_drm_inputs_disable(input);
+
+ /* disable hardware cursor */
+ EINA_LIST_FOREACH(dev->outputs, l, output)
+ ecore_drm_output_cursor_size_set(output, 0, 0, 0);
+
+ /* disable sprites */
+ EINA_LIST_FOREACH(dev->sprites, l, sprite)
+ ecore_drm_sprites_fb_set(sprite, 0, 0);
+
+ /* close input fds ?? */
+
/* drop drm master */
if (ecore_drm_device_master_drop(dev))
{
@@ -39,6 +58,10 @@ _ecore_drm_tty_cb_signal(void *data, int type EINA_UNUSED, void *event)
}
else if (ev->number == 2)
{
+ Ecore_Drm_Output *output;
+ Ecore_Drm_Input *input;
+ Eina_List *l;
+
DBG("Acquire VT");
/* issue ioctl to acquire vt */
@@ -47,6 +70,14 @@ _ecore_drm_tty_cb_signal(void *data, int type EINA_UNUSED, void *event)
/* set drm master */
if (!ecore_drm_device_master_set(dev))
ERR("Could not set drm master: %m");
+
+ /* set output mode */
+ EINA_LIST_FOREACH(dev->outputs, l, output)
+ ecore_drm_output_enable(output);
+
+ /* enable inputs */
+ EINA_LIST_FOREACH(dev->inputs, l, input)
+ ecore_drm_inputs_enable(input);
}
else
ERR("Could not acquire VT: %m");