diff options
Diffstat (limited to 'firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c')
-rw-r--r-- | firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c b/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c new file mode 100644 index 0000000000..1affab3b01 --- /dev/null +++ b/firmware/target/arm/s5l8700/meizu-m6sp/lcd-m6sp.c | |||
@@ -0,0 +1,135 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 by Alan Korr | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or | ||
13 | * modify it under the terms of the GNU General Public License | ||
14 | * as published by the Free Software Foundation; either version 2 | ||
15 | * of the License, or (at your option) any later version. | ||
16 | * | ||
17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
18 | * KIND, either express or implied. | ||
19 | * | ||
20 | ****************************************************************************/ | ||
21 | #include "config.h" | ||
22 | |||
23 | #include "hwcompat.h" | ||
24 | #include "kernel.h" | ||
25 | #include "lcd.h" | ||
26 | #include "system.h" | ||
27 | #include "cpu.h" | ||
28 | |||
29 | /*** definitions ***/ | ||
30 | |||
31 | |||
32 | /** globals **/ | ||
33 | |||
34 | static int xoffset; /* needed for flip */ | ||
35 | |||
36 | /*** hardware configuration ***/ | ||
37 | |||
38 | int lcd_default_contrast(void) | ||
39 | { | ||
40 | return 0x1f; | ||
41 | } | ||
42 | |||
43 | void lcd_set_contrast(int val) | ||
44 | { | ||
45 | } | ||
46 | |||
47 | void lcd_set_invert_display(bool yesno) | ||
48 | { | ||
49 | } | ||
50 | |||
51 | /* turn the display upside down (call lcd_update() afterwards) */ | ||
52 | void lcd_set_flip(bool yesno) | ||
53 | { | ||
54 | /* TODO: flip mode isn't working. The commands in the else part of | ||
55 | this function are how the original firmware inits the LCD */ | ||
56 | |||
57 | if (yesno) | ||
58 | { | ||
59 | xoffset = 132 - LCD_WIDTH; /* 132 colums minus the 128 we have */ | ||
60 | } | ||
61 | else | ||
62 | { | ||
63 | xoffset = 0; | ||
64 | } | ||
65 | } | ||
66 | |||
67 | |||
68 | /* LCD init */ | ||
69 | void lcd_init_device(void) | ||
70 | { | ||
71 | } | ||
72 | |||
73 | /*** Update functions ***/ | ||
74 | |||
75 | /* Performance function that works with an external buffer | ||
76 | note that by and bheight are in 8-pixel units! */ | ||
77 | void lcd_blit_mono(const unsigned char *data, int x, int by, int width, | ||
78 | int bheight, int stride) | ||
79 | { | ||
80 | /* Copy display bitmap to hardware */ | ||
81 | while (bheight--) | ||
82 | { | ||
83 | } | ||
84 | } | ||
85 | |||
86 | |||
87 | /* Performance function that works with an external buffer | ||
88 | note that by and bheight are in 8-pixel units! */ | ||
89 | void lcd_blit_grey_phase_blit(unsigned char *values, unsigned char *phases, | ||
90 | int x, int by, int width, int bheight, int stride) | ||
91 | { | ||
92 | (void)values; | ||
93 | (void)phases; | ||
94 | (void)x; | ||
95 | (void)by; | ||
96 | (void)width; | ||
97 | (void)bheight; | ||
98 | (void)stride; | ||
99 | } | ||
100 | |||
101 | /* Update the display. | ||
102 | This must be called after all other LCD functions that change the display. */ | ||
103 | void lcd_update(void) ICODE_ATTR; | ||
104 | void lcd_update(void) | ||
105 | { | ||
106 | int y; | ||
107 | |||
108 | /* Copy display bitmap to hardware */ | ||
109 | for (y = 0; y < LCD_FBHEIGHT; y++) | ||
110 | { | ||
111 | } | ||
112 | } | ||
113 | |||
114 | /* Update a fraction of the display. */ | ||
115 | void lcd_update_rect(int, int, int, int) ICODE_ATTR; | ||
116 | void lcd_update_rect(int x, int y, int width, int height) | ||
117 | { | ||
118 | int ymax; | ||
119 | |||
120 | /* The Y coordinates have to work on even 8 pixel rows */ | ||
121 | ymax = (y + height-1) >> 3; | ||
122 | y >>= 3; | ||
123 | |||
124 | if(x + width > LCD_WIDTH) | ||
125 | width = LCD_WIDTH - x; | ||
126 | if (width <= 0) | ||
127 | return; /* nothing left to do, 0 is harmful to lcd_write_data() */ | ||
128 | if(ymax >= LCD_FBHEIGHT) | ||
129 | ymax = LCD_FBHEIGHT-1; | ||
130 | |||
131 | /* Copy specified rectange bitmap to hardware */ | ||
132 | for (; y <= ymax; y++) | ||
133 | { | ||
134 | } | ||
135 | } | ||