Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Che-Liang Chiou | a2a5729 | 2011-10-20 23:04:22 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2011 The Chromium OS Authors. |
Che-Liang Chiou | a2a5729 | 2011-10-20 23:04:22 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <api_public.h> |
| 8 | #include <lcd.h> |
Simon Glass | f7ae49f | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Che-Liang Chiou | a2a5729 | 2011-10-20 23:04:22 +0000 | [diff] [blame] | 10 | #include <video_font.h> /* Get font width and height */ |
| 11 | |
| 12 | /* lcd.h needs BMP_LOGO_HEIGHT to calculate CONSOLE_ROWS */ |
| 13 | #if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO) |
| 14 | #include <bmp_logo.h> |
| 15 | #endif |
| 16 | |
| 17 | /* TODO(clchiou): add support of video device */ |
| 18 | |
| 19 | int display_get_info(int type, struct display_info *di) |
| 20 | { |
| 21 | if (!di) |
| 22 | return API_EINVAL; |
| 23 | |
| 24 | switch (type) { |
| 25 | default: |
| 26 | debug("%s: unsupport display device type: %d\n", |
| 27 | __FILE__, type); |
| 28 | return API_ENODEV; |
| 29 | #ifdef CONFIG_LCD |
| 30 | case DISPLAY_TYPE_LCD: |
| 31 | di->pixel_width = panel_info.vl_col; |
| 32 | di->pixel_height = panel_info.vl_row; |
Jeroen Hofstee | fbd239b | 2013-01-22 10:44:14 +0000 | [diff] [blame] | 33 | di->screen_rows = lcd_get_screen_rows(); |
| 34 | di->screen_cols = lcd_get_screen_columns(); |
Che-Liang Chiou | a2a5729 | 2011-10-20 23:04:22 +0000 | [diff] [blame] | 35 | break; |
| 36 | #endif |
| 37 | } |
| 38 | |
| 39 | di->type = type; |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | int display_draw_bitmap(ulong bitmap, int x, int y) |
| 44 | { |
| 45 | if (!bitmap) |
| 46 | return API_EINVAL; |
| 47 | #ifdef CONFIG_LCD |
| 48 | return lcd_display_bitmap(bitmap, x, y); |
| 49 | #else |
| 50 | return API_ENODEV; |
| 51 | #endif |
| 52 | } |
| 53 | |
| 54 | void display_clear(void) |
| 55 | { |
| 56 | #ifdef CONFIG_LCD |
| 57 | lcd_clear(); |
| 58 | #endif |
| 59 | } |