mb/google/brya/var/orisa: Update Type C DisplayPort HPD Configuration
[coreboot2.git] / src / lib / bmp_logo.c
blobbecb605645fd7a971a16aa97d74b81e1a4ad5526
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <bootsplash.h>
5 #include <cbfs.h>
6 #include <cbmem.h>
7 #include <stdint.h>
8 #include <vendorcode/google/chromeos/chromeos.h>
10 static const struct cbmem_entry *logo_entry;
12 #if !CONFIG(HAVE_CUSTOM_BMP_LOGO)
13 const char *bmp_logo_filename(void)
15 return "logo.bmp";
17 #endif
19 void *bmp_load_logo(size_t *logo_size)
21 void *logo_buffer;
23 /* CBMEM is locked for S3 resume path. */
24 if (acpi_is_wakeup_s3())
25 return NULL;
27 logo_entry = cbmem_entry_add(CBMEM_ID_FSP_LOGO, 1 * MiB);
28 if (!logo_entry)
29 return NULL;
31 logo_buffer = cbmem_entry_start(logo_entry);
32 if (!logo_buffer)
33 return NULL;
35 *logo_size = cbfs_load(bmp_logo_filename(), logo_buffer, 1 * MiB);
36 if (*logo_size == 0)
37 return NULL;
39 return logo_buffer;
42 void bmp_release_logo(void)
44 if (logo_entry)
45 cbmem_entry_remove(logo_entry);
46 logo_entry = NULL;