VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen, int force, VbNvContext *vncptr) { VbError_t retval; /* Initialize display if necessary */ if (!disp_width) { retval = VbExDisplayInit(&disp_width, &disp_height); if (VBERROR_SUCCESS != retval) return retval; } /* If requested screen is the same as the current one, we're done. */ if (disp_current_screen == screen && 0 == force) return VBERROR_SUCCESS; /* If the screen is blank, turn off the backlight; else turn it on. */ VbExDisplayBacklight(VB_SCREEN_BLANK == screen ? 0 : 1); /* Request the screen */ disp_current_screen = screen; /* Look in the GBB first */ if (VBERROR_SUCCESS == VbDisplayScreenFromGBB(cparams, screen, vncptr)) return VBERROR_SUCCESS; /* If screen wasn't in the GBB bitmaps, fall back to a default */ return VbExDisplayScreen(screen); }
static int show_screen_and_delay(uint32_t screen_type) { if (VbExDisplayScreen(screen_type)) { VbExDebug("Failed to show a screen.\n"); return 1; } VbExSleepMs(1000); return 0; }