aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-fb-v4.h34
-rw-r--r--drivers/video/s3c-fb.c33
2 files changed, 32 insertions, 35 deletions
diff --git a/arch/arm/plat-samsung/include/plat/regs-fb-v4.h b/arch/arm/plat-samsung/include/plat/regs-fb-v4.h
index 8352f5dc8dfa..4c3647f80057 100644
--- a/arch/arm/plat-samsung/include/plat/regs-fb-v4.h
+++ b/arch/arm/plat-samsung/include/plat/regs-fb-v4.h
@@ -137,40 +137,6 @@
137#define WPALCON_W2PAL_16BPP_A555 (1 << 6) 137#define WPALCON_W2PAL_16BPP_A555 (1 << 6)
138 138
139 139
140/* system specific implementation code for palette sizes, and other
141 * information that changes depending on which architecture is being
142 * compiled.
143*/
144
145struct s3c_fb_palette {
146 struct fb_bitfield r;
147 struct fb_bitfield g;
148 struct fb_bitfield b;
149 struct fb_bitfield a;
150};
151
152static inline void s3c_fb_init_palette(unsigned int window,
153 struct s3c_fb_palette *palette)
154{
155 if (window < 2) {
156 /* Windows 0/1 are 8/8/8 or A/8/8/8 */
157 palette->r.offset = 16;
158 palette->r.length = 8;
159 palette->g.offset = 8;
160 palette->g.length = 8;
161 palette->b.offset = 0;
162 palette->b.length = 8;
163 } else {
164 /* currently we assume RGB 5/6/5 */
165 palette->r.offset = 11;
166 palette->r.length = 5;
167 palette->g.offset = 5;
168 palette->g.length = 6;
169 palette->b.offset = 0;
170 palette->b.length = 5;
171 }
172}
173
174/* Notes on per-window bpp settings 140/* Notes on per-window bpp settings
175 * 141 *
176 * Value Win0 Win1 Win2 Win3 Win 4 142 * Value Win0 Win1 Win2 Win3 Win 4
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 5c7ac01ab61d..b00c064beddf 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -116,6 +116,20 @@ struct s3c_fb_driverdata {
116}; 116};
117 117
118/** 118/**
119 * struct s3c_fb_palette - palette information
120 * @r: Red bitfield.
121 * @g: Green bitfield.
122 * @b: Blue bitfield.
123 * @a: Alpha bitfield.
124 */
125struct s3c_fb_palette {
126 struct fb_bitfield r;
127 struct fb_bitfield g;
128 struct fb_bitfield b;
129 struct fb_bitfield a;
130};
131
132/**
119 * struct s3c_fb_win - per window private data for each framebuffer. 133 * struct s3c_fb_win - per window private data for each framebuffer.
120 * @windata: The platform data supplied for the window configuration. 134 * @windata: The platform data supplied for the window configuration.
121 * @parent: The hardware that this window is part of. 135 * @parent: The hardware that this window is part of.
@@ -866,7 +880,24 @@ static int __devinit s3c_fb_probe_win(struct s3c_fb *sfb, unsigned int win_no,
866 } 880 }
867 881
868 /* setup the r/b/g positions for the window's palette */ 882 /* setup the r/b/g positions for the window's palette */
869 s3c_fb_init_palette(win_no, &win->palette); 883 if (win->variant.palette_16bpp) {
884 /* Set RGB 5:6:5 as default */
885 win->palette.r.offset = 11;
886 win->palette.r.length = 5;
887 win->palette.g.offset = 5;
888 win->palette.g.length = 6;
889 win->palette.b.offset = 0;
890 win->palette.b.length = 5;
891
892 } else {
893 /* Set 8bpp or 8bpp and 1bit alpha */
894 win->palette.r.offset = 16;
895 win->palette.r.length = 8;
896 win->palette.g.offset = 8;
897 win->palette.g.length = 8;
898 win->palette.b.offset = 0;
899 win->palette.b.length = 8;
900 }
870 901
871 /* setup the initial video mode from the window */ 902 /* setup the initial video mode from the window */
872 fb_videomode_to_var(&fbinfo->var, initmode); 903 fb_videomode_to_var(&fbinfo->var, initmode);