summaryrefslogtreecommitdiff
path: root/include/amlogic/vinfo.h (plain)
blob: 81eb2f5b8836fcbc56542686880f35a7525f6674
1#ifndef __VINFO_H_
2#define __VINFO_H_
3
4struct vinfo_s {
5 ushort width; /* Number of columns (i.e. 160) */
6 ushort height; /* Number of rows (i.e. 100) */
7 ushort field_height; /* for interlace */
8 u_char vl_bpix; /* Bits per pixel, 0 = 1 */
9
10 void *vd_base; /* Start of framebuffer memory */
11
12 void *vd_console_address; /* Start of console buffer */
13 short console_col;
14 short console_row;
15
16 int vd_color_fg;
17 int vd_color_bg;
18
19 ushort *cmap; /* Pointer to the colormap */
20 void *priv; /* Pointer to driver-specific data */
21};
22
23
24/************************************************************************/
25/* ** BITMAP DISPLAY SUPPORT */
26/************************************************************************/
27#if defined(CONFIG_CMD_BMP) || defined(CONFIG_SPLASH_SCREEN)
28# include <bmp_layout.h>
29# include <asm/byteorder.h>
30#endif
31
32/*
33 * Information about displays we are using. This is for configuring
34 * the LCD controller and memory allocation. Someone has to know what
35 * is connected, as we can't autodetect anything.
36 */
37#define CONFIG_SYS_HIGH 0 /* Pins are active high */
38#define CONFIG_SYS_LOW 1 /* Pins are active low */
39
40#define LCD_COLOR2 2
41#define LCD_COLOR4 4
42#define LCD_COLOR8 8
43#define LCD_COLOR16 16
44#define LCD_COLOR24 24
45#define LCD_COLOR32 32
46
47
48/*----------------------------------------------------------------------*/
49#if defined(CONFIG_LCD_INFO_BELOW_LOGO)
50# define LCD_INFO_X 0
51# define LCD_INFO_Y (BMP_LOGO_HEIGHT + VIDEO_FONT_HEIGHT)
52#elif defined(CONFIG_LCD_LOGO)
53# define LCD_INFO_X (BMP_LOGO_WIDTH + 4 * VIDEO_FONT_WIDTH)
54# define LCD_INFO_Y (VIDEO_FONT_HEIGHT)
55#else
56# define LCD_INFO_X (VIDEO_FONT_WIDTH)
57# define LCD_INFO_Y (VIDEO_FONT_HEIGHT)
58#endif
59
60/* Calculate nr. of bits per pixel and nr. of colors */
61#define NBITS(bit_code) (bit_code)
62#define NCOLORS(bit_code) (1 << NBITS(bit_code))
63
64/************************************************************************/
65/* ** CONSOLE CONSTANTS */
66/************************************************************************/
67#if LCD_BPP == LCD_MONOCHROME
68
69/*
70 * Simple black/white definitions
71 */
72# define CONSOLE_COLOR_BLACK 0
73# define CONSOLE_COLOR_WHITE 1 /* Must remain last / highest */
74
75#elif LCD_BPP == LCD_COLOR8
76
77/*
78 * 8bpp color definitions
79 */
80# define CONSOLE_COLOR_BLACK 0
81# define CONSOLE_COLOR_RED 1
82# define CONSOLE_COLOR_GREEN 2
83# define CONSOLE_COLOR_YELLOW 3
84# define CONSOLE_COLOR_BLUE 4
85# define CONSOLE_COLOR_MAGENTA 5
86# define CONSOLE_COLOR_CYAN 6
87# define CONSOLE_COLOR_GREY 14
88# define CONSOLE_COLOR_WHITE 15 /* Must remain last / highest */
89
90#elif LCD_BPP == LCD_COLOR24
91/*
92 * 24bpp color definitions
93 */
94# define CONSOLE_COLOR_BLACK 0
95# define CONSOLE_COLOR_RED 0x0000ff
96# define CONSOLE_COLOR_GREEN 0x00ff00
97# define CONSOLE_COLOR_YELLOW 0x00ffff
98# define CONSOLE_COLOR_BLUE 0xff0000
99# define CONSOLE_COLOR_MAGENTA 0xff00ff
100# define CONSOLE_COLOR_CYAN 0xffff00
101# define CONSOLE_COLOR_GREY 0x808080
102# define CONSOLE_COLOR_WHITE 0xffffff /* Must remain last / highest */
103
104#else
105
106/*
107 * 16bpp color definitions
108 */
109# define CONSOLE_COLOR_BLACK 0x0000
110# define CONSOLE_COLOR_RED 0xf800
111# define CONSOLE_COLOR_GREEN 0x07e0
112# define CONSOLE_COLOR_YELLOW 0xffe0
113# define CONSOLE_COLOR_BLUE 0x001f
114# define CONSOLE_COLOR_MAGENTA 0xf81f
115# define CONSOLE_COLOR_CYAN 0x07ff
116# define CONSOLE_COLOR_WHITE 0xffff /* Must remain last / highest */
117
118#endif /* color definitions */
119
120/************************************************************************/
121#ifndef PAGE_SIZE
122# define PAGE_SIZE 4096
123#endif
124
125/************************************************************************/
126/* ** CONSOLE DEFINITIONS & FUNCTIONS */
127/************************************************************************/
128#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
129# define CONSOLE_ROWS ((info->vl_row-BMP_LOGO_HEIGHT) \
130 / VIDEO_FONT_HEIGHT)
131#else
132# define CONSOLE_ROWS (info->vl_row / VIDEO_FONT_HEIGHT)
133#endif
134
135#define CONSOLE_COLS (panel_info.vl_col / VIDEO_FONT_WIDTH)
136#define CONSOLE_ROW_SIZE (VIDEO_FONT_HEIGHT * lcd_line_length)
137#define CONSOLE_ROW_FIRST (info->vd_console_address)
138#define CONSOLE_ROW_SECOND (info->vd_console_address + CONSOLE_ROW_SIZE)
139#define CONSOLE_ROW_LAST (info->vd_console_address + CONSOLE_SIZE \
140 - CONSOLE_ROW_SIZE)
141#define CONSOLE_SIZE (CONSOLE_ROW_SIZE * CONSOLE_ROWS)
142#define CONSOLE_SCROLL_SIZE (CONSOLE_SIZE - CONSOLE_ROW_SIZE)
143
144# define COLOR_MASK(c) (c)
145
146/************************************************************************/
147
148#endif
149