/** * pm_vt_switch_required - indicate VT switch at suspend requirements * @dev: device * @required: if true, caller needs VT switch at suspend/resume time * * The different console drivers may or may not require VT switches across * suspend/resume, depending on how they handle restoring video state and * what may be running. * * Drivers can indicate support for switchless suspend/resume, which can * save time and flicker, by using this routine and passing 'false' as * the argument. If any loaded driver needs VT switching, or the * no_console_suspend argument has been passed on the command line, VT * switches will occur.
*/ void pm_vt_switch_required(struct device *dev, bool required)
{ struct pm_vt_switch *entry, *tmp;
/* * There are three cases when a VT switch on suspend/resume are required: * 1) no driver has indicated a requirement one way or another, so preserve * the old behavior * 2) console suspend is disabled, we want to see debug messages across * suspend/resume * 3) any registered driver indicates it needs a VT switch * * If none of these conditions is present, meaning we have at least one driver * that doesn't need the switch, and none that do, we can avoid it to make * resume look a little prettier (and suspend too, but that's usually hidden, * e.g. when closing the lid on a laptop).
*/ staticbool pm_vt_switch(void)
{ struct pm_vt_switch *entry; bool ret = true;
mutex_lock(&vt_switch_mutex); if (list_empty(&pm_vt_switch_list)) goto out;
if (!console_suspend_enabled) goto out;
list_for_each_entry(entry, &pm_vt_switch_list, head) { if (entry->required) goto out;
}
ret = false;
out:
mutex_unlock(&vt_switch_mutex); return ret;
}
void pm_prepare_console(void)
{ if (!pm_vt_switch()) return;
orig_fgconsole = vt_move_to_console(SUSPEND_CONSOLE, 1); if (orig_fgconsole < 0) return;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.