blob: f82b1545f257c7382557ee369890f834c2cac2f2 [file] [log] [blame]
Angel Pons118a9c72020-04-02 23:48:34 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Kyösti Mälkki5687fc92013-11-28 18:11:49 +02003
Julius Werner6d9c1312019-03-28 13:33:55 -07004#include <assert.h>
Kyösti Mälkki5687fc92013-11-28 18:11:49 +02005#include <bootmode.h>
Elyes HAOUAS83ea46b2019-07-12 22:50:12 +02006#include <security/vboot/misc.h>
Yu-Ping Wu9fc8cf82019-11-13 15:57:45 +08007#include <vb2_api.h>
Kyösti Mälkki5687fc92013-11-28 18:11:49 +02008
Kyösti Mälkkiab56b3b2013-11-28 16:44:51 +02009static int gfx_init_done = -1;
10
11int gfx_get_init_done(void)
12{
13 if (gfx_init_done < 0)
14 return 0;
15 return gfx_init_done;
16}
17
18void gfx_set_init_done(int done)
19{
20 gfx_init_done = done;
21}
Aaron Durbinbc98cc62015-09-02 09:21:36 -050022
23int display_init_required(void)
24{
Yu-Ping Wu9fc8cf82019-11-13 15:57:45 +080025 /* For vboot, always honor VB2_CONTEXT_DISPLAY_INIT. */
Christian Walter90cf4bb2019-07-29 09:54:23 +000026 if (CONFIG(VBOOT)) {
Joel Kitching6672bd82019-04-10 16:06:21 +080027 /* Must always select MUST_REQUEST_DISPLAY when using this
28 function. */
29 if (!CONFIG(VBOOT_MUST_REQUEST_DISPLAY))
Julius Werner6d9c1312019-03-28 13:33:55 -070030 dead_code();
Yu-Ping Wu9fc8cf82019-11-13 15:57:45 +080031 return vboot_get_context()->flags & VB2_CONTEXT_DISPLAY_INIT;
Julius Werner6d9c1312019-03-28 13:33:55 -070032 }
Aaron Durbinbc98cc62015-09-02 09:21:36 -050033
34 /* By default always initialize display. */
35 return 1;
36}