summaryrefslogtreecommitdiff
path: root/src/lib/ecore_drm
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-05-13 14:37:35 -0400
committerChris Michael <cp.michael@samsung.com>2015-05-13 14:42:15 -0400
commit7d5d06bb20b2842619785b034e6fa15b080a53b1 (patch)
treefa6c2b278d85d34b72e7167d2ed46c08349316ac /src/lib/ecore_drm
parent443010b465fec213f9a1f084328cc285591586e6 (diff)
ecore-drm: Only send output events when we enable/disable an output
Summary: This reduces the number of output events that wl_drm module will receive from ecore-drm. We now only send those events when an output gets enabled/disabled where previously we were also sending them during output creation. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_drm')
-rw-r--r--src/lib/ecore_drm/ecore_drm_output.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c
index e893ce9417..8d922f8050 100644
--- a/src/lib/ecore_drm/ecore_drm_output.c
+++ b/src/lib/ecore_drm/ecore_drm_output.c
@@ -425,6 +425,7 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnecto
425 output->name = eina_stringshare_add("UNKNOWN"); 425 output->name = eina_stringshare_add("UNKNOWN");
426 426
427 output->connected = (conn->connection == DRM_MODE_CONNECTED); 427 output->connected = (conn->connection == DRM_MODE_CONNECTED);
428 output->enabled = output->connected;
428 output->conn_type = conn->connector_type; 429 output->conn_type = conn->connector_type;
429 if (conn->connector_type < ALEN(conn_types)) 430 if (conn->connector_type < ALEN(conn_types))
430 type = conn_types[conn->connector_type]; 431 type = conn_types[conn->connector_type];
@@ -535,8 +536,6 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnecto
535 (conn->count_modes == 0) ? ", built-in" : ""); 536 (conn->count_modes == 0) ? ", built-in" : "");
536 } 537 }
537 538
538 _ecore_drm_output_event_send(output, EINA_TRUE);
539
540 return output; 539 return output;
541 540
542err: 541err:
@@ -963,6 +962,9 @@ ecore_drm_output_enable(Ecore_Drm_Output *output)
963 if (output->enabled) return EINA_TRUE; 962 if (output->enabled) return EINA_TRUE;
964 963
965 output->enabled = EINA_TRUE; 964 output->enabled = EINA_TRUE;
965 ecore_drm_output_dpms_set(output, DRM_MODE_DPMS_ON);
966
967 _ecore_drm_output_event_send(output, EINA_TRUE);
966 968
967 return EINA_TRUE; 969 return EINA_TRUE;
968} 970}
@@ -975,6 +977,9 @@ ecore_drm_output_disable(Ecore_Drm_Output *output)
975 if (!output->enabled) return; 977 if (!output->enabled) return;
976 978
977 output->enabled = EINA_FALSE; 979 output->enabled = EINA_FALSE;
980 ecore_drm_output_dpms_set(output, DRM_MODE_DPMS_OFF);
981
982 _ecore_drm_output_event_send(output, EINA_FALSE);
978} 983}
979 984
980EAPI void 985EAPI void
@@ -997,6 +1002,8 @@ ecore_drm_output_repaint(Ecore_Drm_Output *output)
997 EINA_SAFETY_ON_NULL_RETURN(output->dev); 1002 EINA_SAFETY_ON_NULL_RETURN(output->dev);
998 EINA_SAFETY_ON_TRUE_RETURN(output->pending_destroy); 1003 EINA_SAFETY_ON_TRUE_RETURN(output->pending_destroy);
999 1004
1005 if (!output->enabled) return;
1006
1000 dev = output->dev; 1007 dev = output->dev;
1001 1008
1002 /* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */ 1009 /* DBG("Output Repaint: %d %d", output->crtc_id, output->conn_id); */
@@ -1101,7 +1108,7 @@ ecore_drm_outputs_geometry_get(Ecore_Drm_Device *dev, int *x, int *y, int *w, in
1101 1108
1102 EINA_LIST_FOREACH(dev->outputs, l, output) 1109 EINA_LIST_FOREACH(dev->outputs, l, output)
1103 { 1110 {
1104 if (!output->connected) continue; 1111 if ((!output->connected) || (!output->enabled)) continue;
1105 if (output->cloned) continue; 1112 if (output->cloned) continue;
1106 ow += MAX(ow, output->current_mode->width); 1113 ow += MAX(ow, output->current_mode->width);
1107 oh = MAX(oh, output->current_mode->height); 1114 oh = MAX(oh, output->current_mode->height);