summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Wai-Hong Tam <waihong@chromium.org>2011-07-25 11:20:35 +0800
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:07 -0700
commite15ae271675d02be118708ebb4498ffc7924e3f2 (patch)
tree44f29c60ac78b6ab450d0ca11968dfbd80858de3
parent462dd4c19934c1aa7388c86d6df42b6417beb080 (diff)
CHROMIUM: Remove deprecated gbb_bmpblk library.
The logic now goes into lib/vbexport/display. BUG=none TEST=build without error. Change-Id: I6f8e694c01c53cace462b08242c57b6649e6ef56 Reviewed-on: http://gerrit.chromium.org/gerrit/4643 Tested-by: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
-rw-r--r--include/chromeos/gbb_bmpblk.h27
-rw-r--r--lib/chromeos/Makefile1
-rw-r--r--lib/chromeos/gbb_bmpblk.c124
3 files changed, 0 insertions, 152 deletions
diff --git a/include/chromeos/gbb_bmpblk.h b/include/chromeos/gbb_bmpblk.h
deleted file mode 100644
index b6c2a1c9c1f..00000000000
--- a/include/chromeos/gbb_bmpblk.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- */
-
-#ifndef __CHROMEOS_GBB_BMPBLK_H__
-#define __CHROMEOS_GBB_BMPBLK_H__
-
-enum {
- BMPBLK_OK = 0,
- BMPBLK_UNSUPPORTED_COMPRESSION,
- BMPBLK_LZMA_DECOMPRESS_FAILED,
- BMPBLK_BMP_DISPLAY_FAILED,
-};
-
-/* Print the screen info in BMP block. */
-int print_screen_info_in_bmpblk(uint8_t *gbb_start, int index);
-
-/* Display the screen on LCD. */
-int display_screen_in_bmpblk(uint8_t *gbb_start, int index);
-
-#endif /* __CHROMEOS_GBB_BMPBLK_H__ */
diff --git a/lib/chromeos/Makefile b/lib/chromeos/Makefile
index a004bfba6dd..e21429a399b 100644
--- a/lib/chromeos/Makefile
+++ b/lib/chromeos/Makefile
@@ -16,7 +16,6 @@ COBJS-$(CONFIG_CHROMEOS) += cmdline_updater.o
COBJS-$(CONFIG_CHROMEOS) += crossystem_data.o
COBJS-$(CONFIG_CHROMEOS) += fdt_decode.o
COBJS-$(CONFIG_CHROMEOS) += firmware_storage_spi.o
-COBJS-$(CONFIG_CHROMEOS) += gbb_bmpblk.o
COBJS-$(CONFIG_CHROMEOS) += memory_wipe.o
COBJS-$(CONFIG_CHROMEOS) += preboot_fdt_update.o
diff --git a/lib/chromeos/gbb_bmpblk.c b/lib/chromeos/gbb_bmpblk.c
deleted file mode 100644
index 0f4fc1033c9..00000000000
--- a/lib/chromeos/gbb_bmpblk.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- *
- * Alternatively, this software may be distributed under the terms of the
- * GNU General Public License ("GPL") version 2 as published by the Free
- * Software Foundation.
- */
-
-/* Library for Chrome OS GBB BMP block. */
-
-#include <common.h>
-#include <lcd.h>
-#include <malloc.h>
-#include <chromeos/common.h>
-#include <chromeos/gbb_bmpblk.h>
-#include <lzma/LzmaTypes.h>
-#include <lzma/LzmaDec.h>
-#include <lzma/LzmaTools.h>
-
-/* headers of vboot_reference */
-#include <bmpblk_header.h>
-#include <gbb_header.h>
-
-/* defined in common/lcd.c */
-extern int lcd_display_bitmap (ulong, int, int);
-
-static uint8_t *uncompress_lzma(uint8_t *in_addr, SizeT in_size,
- SizeT out_size)
-{
- uint8_t *out_addr = malloc(out_size);
- SizeT lzma_len = out_size;
- int ret;
-
- ret = lzmaBuffToBuffDecompress(out_addr, &lzma_len, in_addr, in_size);
- if (ret != SZ_OK) {
- free(out_addr);
- out_addr = NULL;
- }
- return out_addr;
-}
-
-int print_screen_info_in_bmpblk(uint8_t *gbb_start, int index)
-{
- GoogleBinaryBlockHeader *gbbh;
- BmpBlockHeader *bmph;
- ScreenLayout *screen;
- ImageInfo *info;
- int i;
-
- gbbh = (GoogleBinaryBlockHeader *)gbb_start;
- bmph = (BmpBlockHeader *)(gbb_start + gbbh->bmpfv_offset);
- screen = (ScreenLayout *)(bmph + 1);
-
- assert(index <
- bmph->number_of_localizations * bmph->number_of_screenlayouts);
- screen += index;
-
- printf("screens[%d] info:\n", index);
- for (i = 0;
- i < MAX_IMAGE_IN_LAYOUT && screen->images[i].image_info_offset;
- ++i) {
- info = (ImageInfo *)((uint8_t *)bmph +
- screen->images[i].image_info_offset);
- printf("\t- %s (%d x %d) showed on (%d, %d)\n",
- (info->format==FORMAT_BMP)?"BMP":"Unknown Image",
- info->width,
- info->height,
- screen->images[i].x,
- screen->images[i].y);
- }
- return BMPBLK_OK;
-}
-
-int display_screen_in_bmpblk(uint8_t *gbb_start, int index)
-{
- GoogleBinaryBlockHeader *gbbh;
- BmpBlockHeader *bmph;
- ScreenLayout *screen;
- ImageInfo *info;
- uint8_t *data;
- int i;
- int ret;
-
- gbbh = (GoogleBinaryBlockHeader *)gbb_start;
- bmph = (BmpBlockHeader *)(gbb_start + gbbh->bmpfv_offset);
- screen = (ScreenLayout *)(bmph + 1);
-
- assert(index <
- bmph->number_of_localizations * bmph->number_of_screenlayouts);
- screen += index;
-
- for (i = 0;
- i < MAX_IMAGE_IN_LAYOUT && screen->images[i].image_info_offset;
- ++i) {
- info = (ImageInfo *)((uint8_t *)bmph +
- screen->images[i].image_info_offset);
-
- if (info->compression != COMPRESS_NONE &&
- info->compression != COMPRESS_LZMA1)
- return BMPBLK_UNSUPPORTED_COMPRESSION;
-
- data = (uint8_t *)(info + 1);
- if (info->compression == COMPRESS_LZMA1) {
- data = uncompress_lzma(data,
- (SizeT)info->compressed_size,
- (SizeT)info->original_size);
- }
- if (!data)
- return BMPBLK_LZMA_DECOMPRESS_FAILED;
-
- ret = lcd_display_bitmap((ulong)data,
- screen->images[i].x,
- screen->images[i].y);
-
- if (info->compression == COMPRESS_LZMA1)
- free(data);
-
- if (ret)
- return BMPBLK_BMP_DISPLAY_FAILED;
- }
- return BMPBLK_OK;
-}