blob: 15775e35dfa910fdc0056ff88b91272deb80ca6a [file] [log] [blame]
Przemyslaw Marczak679549d2014-01-22 11:24:12 +01001/*
2 * Copyright (C) 2013 Samsung Electronics
3 * Przemyslaw Marczak <p.marczak@samsung.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <lcd.h>
10#include <libtizen.h>
11#include <samsung/misc.h>
12
13#ifdef CONFIG_CMD_BMP
14void draw_logo(void)
15{
16 int x, y;
17 ulong addr;
18
19 addr = panel_info.logo_addr;
20 if (!addr) {
21 error("There is no logo data.");
22 return;
23 }
24
25 if (panel_info.vl_width >= panel_info.logo_width) {
26 x = ((panel_info.vl_width - panel_info.logo_width) >> 1);
Przemyslaw Marczak903afe12013-11-29 18:30:43 +010027 x += panel_info.logo_x_offset; /* For X center align */
Przemyslaw Marczak679549d2014-01-22 11:24:12 +010028 } else {
29 x = 0;
30 printf("Warning: image width is bigger than display width\n");
31 }
32
33 if (panel_info.vl_height >= panel_info.logo_height) {
34 y = ((panel_info.vl_height - panel_info.logo_height) >> 1);
Przemyslaw Marczak903afe12013-11-29 18:30:43 +010035 y += panel_info.logo_y_offset; /* For Y center align */
Przemyslaw Marczak679549d2014-01-22 11:24:12 +010036 } else {
37 y = 0;
38 printf("Warning: image height is bigger than display height\n");
39 }
40
41 bmp_display(addr, x, y);
42}
43#endif /* CONFIG_CMD_BMP */