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