mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
kms: gracefully handle NULL save_state at cleanup
If we failed to save any crtc state then we skip trying to restore the old state at cleanup. Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
parent
1a638b6fd6
commit
0f33c942f2
@ -297,19 +297,22 @@ _cogl_winsys_egl_cleanup_context (CoglDisplay *display)
|
||||
CoglRenderer *renderer = display->renderer;
|
||||
CoglRendererEGL *egl_renderer = renderer->winsys;
|
||||
CoglRendererKMS *kms_renderer = egl_renderer->platform;
|
||||
int ret;
|
||||
|
||||
/* Restore the saved CRTC - this failing should not propagate an error */
|
||||
ret = drmModeSetCrtc (kms_renderer->fd,
|
||||
kms_display->saved_crtc->crtc_id,
|
||||
kms_display->saved_crtc->buffer_id,
|
||||
kms_display->saved_crtc->x, kms_display->saved_crtc->y,
|
||||
&kms_display->connector->connector_id, 1,
|
||||
&kms_display->saved_crtc->mode);
|
||||
if (ret)
|
||||
g_critical (G_STRLOC ": Error restoring saved CRTC");
|
||||
if (kms_display->saved_crtc)
|
||||
{
|
||||
int ret = drmModeSetCrtc (kms_renderer->fd,
|
||||
kms_display->saved_crtc->crtc_id,
|
||||
kms_display->saved_crtc->buffer_id,
|
||||
kms_display->saved_crtc->x,
|
||||
kms_display->saved_crtc->y,
|
||||
&kms_display->connector->connector_id, 1,
|
||||
&kms_display->saved_crtc->mode);
|
||||
if (ret)
|
||||
g_critical (G_STRLOC ": Error restoring saved CRTC");
|
||||
|
||||
drmModeFreeCrtc (kms_display->saved_crtc);
|
||||
drmModeFreeCrtc (kms_display->saved_crtc);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user