ecore-drm: Don't crash when trying to disable an output

Summary: If we call these functions with an already disabled output,
we crash. Check for an output being 'enabled' before we make these
calls.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-06-03 14:29:14 -04:00
parent fb9f33035e
commit 354fd6f67b
1 changed files with 2 additions and 0 deletions

View File

@ -763,6 +763,7 @@ _ecore_drm_output_render_disable(Ecore_Drm_Output *output)
EINA_SAFETY_ON_NULL_RETURN(output);
output->need_repaint = EINA_FALSE;
if (!output->enabled) return;
ecore_drm_output_cursor_size_set(output, 0, 0, 0);
ecore_drm_output_dpms_set(output, DRM_MODE_DPMS_OFF);
}
@ -951,6 +952,7 @@ EAPI void
ecore_drm_output_cursor_size_set(Ecore_Drm_Output *output, int handle, int w, int h)
{
EINA_SAFETY_ON_NULL_RETURN(output);
if (!output->enabled) return;
drmModeSetCursor(output->dev->drm.fd, output->crtc_id, handle, w, h);
}