summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-07-27 15:35:42 -0400
committerChris Michael <cp.michael@samsung.com>2016-07-27 15:35:42 -0400
commit4431ff01ffc40fc55c0923bee03296f67ee5ef65 (patch)
treed928c1a28e5ae2a9d7b9a63acff816f2423a0f13
parent1bbc23b08634444edee9a19603aaf3360489f483 (diff)
ecore-drm2: Fix issue of VT-Switching going blank on returns
As it turns out, when we vt-switch Back to a running Enlightenment, it ends up processing all outputs and causes Evas to create a giant canvas to cover all outputs. This new canvas causes a blank screen as the pageflipping fails (due to fb being too large). As we do not yet support output on more an one screen anyway, temporarily disable any output which is not marked as primary. Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/lib/ecore_drm2/ecore_drm2_outputs.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c
index 1eb50d6..f44bee8 100644
--- a/src/lib/ecore_drm2/ecore_drm2_outputs.c
+++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c
@@ -83,6 +83,8 @@ _output_event_send(Ecore_Drm2_Output *output)
83{ 83{
84 Ecore_Drm2_Event_Output_Changed *ev; 84 Ecore_Drm2_Event_Output_Changed *ev;
85 85
86 if ((!output->enabled) && (!output->connected)) return;
87
86 ev = calloc(1, sizeof(Ecore_Drm2_Event_Output_Changed)); 88 ev = calloc(1, sizeof(Ecore_Drm2_Event_Output_Changed));
87 if (!ev) return; 89 if (!ev) return;
88 90
@@ -594,6 +596,12 @@ _output_create(Ecore_Drm2_Device *dev, const drmModeRes *res, const drmModeConne
594 596
595 if (!eina_list_count(dev->outputs)) 597 if (!eina_list_count(dev->outputs))
596 output->primary = EINA_TRUE; 598 output->primary = EINA_TRUE;
599 else
600 {
601 /* temporarily disable other outputs which are not primary */
602 output->connected = EINA_FALSE;
603 output->enabled = EINA_FALSE;
604 }
597 605
598 dev->alloc.crtc |= (1 << output->crtc_id); 606 dev->alloc.crtc |= (1 << output->crtc_id);
599 dev->alloc.conn |= (1 << output->conn_id); 607 dev->alloc.conn |= (1 << output->conn_id);
@@ -979,16 +987,29 @@ ecore_drm2_output_enabled_set(Ecore_Drm2_Output *output, Eina_Bool enabled)
979{ 987{
980 EINA_SAFETY_ON_NULL_RETURN(output); 988 EINA_SAFETY_ON_NULL_RETURN(output);
981 989
990 if (!output->connected) return;
982 if (output->enabled == enabled) return; 991 if (output->enabled == enabled) return;
983 output->enabled = enabled; 992 output->enabled = enabled;
984 993
985 if (output->enabled) 994 if (output->enabled)
986 ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON); 995 {
996 Ecore_Drm2_Fb *fb;
997
998 if (output->current) fb = output->current;
999 else if (output->next) fb = output->next;
1000
1001 drmModeSetCrtc(output->fd, output->crtc_id, fb->id,
1002 output->x, output->y,
1003 &output->conn_id, 1,
1004 &output->current_mode->info);
1005
1006 ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_ON);
1007 }
987 else 1008 else
988 { 1009 {
989 ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF); 1010 ecore_drm2_output_dpms_set(output, DRM_MODE_DPMS_OFF);
990 output->current = NULL; 1011 output->current = NULL;
991 output->next = NULL; 1012 /* output->next = NULL; */
992 } 1013 }
993 1014
994 _output_event_send(output); 1015 _output_event_send(output);