aboutsummaryrefslogtreecommitdiffstats
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
parentecore-drm: Greatly improve drm rendering speed (diff)
downloadefl-7d5d06bb20b2842619785b034e6fa15b080a53b1.tar.gz
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
output->name = eina_stringshare_add("UNKNOWN");
output->connected = (conn->connection == DRM_MODE_CONNECTED);
+ output->enabled = output->connected;
output->conn_type = conn->connector_type;
if (conn->connector_type < ALEN(conn_types))
type = conn_types[conn->connector_type];
@@ -535,8 +536,6 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnecto
(conn->count_modes == 0) ? ", built-in" : "");
}
- _ecore_drm_output_event_send(output, EINA_TRUE);
-
return output;
err:
@@ -963,6 +962,9 @@ ecore_drm_output_enable(Ecore_Drm_Output *output)
if (output->enabled) return EINA_TRUE;
output->enabled = EINA_TRUE;
+ ecore_drm_output_dpms_set(output, DRM_MODE_DPMS_ON);
+
+ _ecore_drm_output_event_send(output, EINA_TRUE);
return EINA_TRUE;
}
@@ -975,6 +977,9 @@ ecore_drm_output_disable(Ecore_Drm_Output *output)
if (!output->enabled) return;
output->enabled = EINA_FALSE;
+ ecore_drm_output_dpms_set(output, DRM_MODE_DPMS_OFF);
+
+ _ecore_drm_output_event_send(output, EINA_FALSE);
}
EAPI void
@@ -997,6 +1002,8 @@ ecore_drm_output_repaint(Ecore_Drm_Output *output)
EINA_SAFETY_ON_NULL_RETURN(output->dev);
EINA_SAFETY_ON_TRUE_RETURN(output->pending_destroy);
+ if (!output->enabled) return;
+
dev = output->dev;
/* 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
EINA_LIST_FOREACH(dev->outputs, l, output)
{
- if (!output->connected) continue;
+ if ((!output->connected) || (!output->enabled)) continue;
if (output->cloned) continue;
ow += MAX(ow, output->current_mode->width);
oh = MAX(oh, output->current_mode->height);