renderer-native: Unset mode on disabled CRTCs

Make sure we properly unset the CRTC mode when a monitor is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=787629
This commit is contained in:
Jonas Ådahl 2017-09-28 11:59:27 -04:00
parent 99e1cd549d
commit 20749e5dbd
2 changed files with 27 additions and 0 deletions

View File

@ -132,6 +132,7 @@ struct _MetaRendererNative
CoglClosure *swap_notify_idle; CoglClosure *swap_notify_idle;
int64_t frame_counter; int64_t frame_counter;
gboolean pending_unset_disabled_crtcs;
gboolean no_add_fb2; gboolean no_add_fb2;
}; };
@ -1396,6 +1397,8 @@ meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native)
onscreen_native->pending_set_crtc = TRUE; onscreen_native->pending_set_crtc = TRUE;
} }
renderer_native->pending_unset_disabled_crtcs = TRUE;
} }
static CoglOnscreen * static CoglOnscreen *
@ -1778,6 +1781,29 @@ void
meta_renderer_native_finish_frame (MetaRendererNative *renderer_native) meta_renderer_native_finish_frame (MetaRendererNative *renderer_native)
{ {
renderer_native->frame_counter++; renderer_native->frame_counter++;
if (renderer_native->pending_unset_disabled_crtcs)
{
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
MetaMonitorManagerKms *monitor_manager_kms =
META_MONITOR_MANAGER_KMS (monitor_manager);
unsigned int i;
for (i = 0; i < monitor_manager->n_crtcs; i++)
{
MetaCrtc *crtc = &monitor_manager->crtcs[i];
if (crtc->current_mode)
continue;
meta_monitor_manager_kms_apply_crtc_mode (monitor_manager_kms,
crtc, 0, 0, 0);
}
renderer_native->pending_unset_disabled_crtcs = FALSE;
}
} }
int64_t int64_t

View File

@ -160,6 +160,7 @@ meta_stage_native_rebuild_views (MetaStageNative *stage_native)
MetaRenderer *renderer = meta_backend_get_renderer (backend); MetaRenderer *renderer = meta_backend_get_renderer (backend);
meta_renderer_rebuild_views (renderer); meta_renderer_rebuild_views (renderer);
meta_renderer_native_queue_modes_reset (META_RENDERER_NATIVE (renderer));
ensure_frame_callbacks (stage_native); ensure_frame_callbacks (stage_native);
} }