Lines Matching refs:var
27 static int var_to_pixfmt(struct fb_var_screeninfo *var) in var_to_pixfmt() argument
32 if (var->bits_per_pixel == 8) in var_to_pixfmt()
38 if (var->bits_per_pixel == 16 && var->red.length == 8 && in var_to_pixfmt()
39 var->green.length == 4 && var->blue.length == 4) { in var_to_pixfmt()
40 if (var->green.offset >= var->blue.offset) in var_to_pixfmt()
49 if (var->bits_per_pixel == 12 && var->red.length == 8 && in var_to_pixfmt()
50 var->green.length == 2 && var->blue.length == 2) { in var_to_pixfmt()
51 if (var->green.offset >= var->blue.offset) in var_to_pixfmt()
60 if (var->bits_per_pixel == 16 && var->red.length == 16 && in var_to_pixfmt()
61 var->green.length == 16 && var->blue.length == 16) { in var_to_pixfmt()
62 if (var->red.offset == 0) in var_to_pixfmt()
64 else if (var->green.offset >= var->blue.offset) in var_to_pixfmt()
73 if (var->bits_per_pixel == 16 && var->red.length <= 5 && in var_to_pixfmt()
74 var->green.length <= 6 && var->blue.length <= 5) { in var_to_pixfmt()
75 if (var->transp.length == 0) { in var_to_pixfmt()
76 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
86 if (var->bits_per_pixel <= 32 && var->red.length <= 8 && in var_to_pixfmt()
87 var->green.length <= 8 && var->blue.length <= 8) { in var_to_pixfmt()
88 if (var->bits_per_pixel == 24 && var->transp.length == 0) { in var_to_pixfmt()
89 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
95 if (var->bits_per_pixel == 32 && var->transp.offset == 24) { in var_to_pixfmt()
96 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
101 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
113 static void pixfmt_to_var(struct fb_var_screeninfo *var, int pix_fmt) in pixfmt_to_var() argument
117 var->bits_per_pixel = 16; in pixfmt_to_var()
118 var->red.offset = 11; var->red.length = 5; in pixfmt_to_var()
119 var->green.offset = 5; var->green.length = 6; in pixfmt_to_var()
120 var->blue.offset = 0; var->blue.length = 5; in pixfmt_to_var()
121 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
124 var->bits_per_pixel = 16; in pixfmt_to_var()
125 var->red.offset = 0; var->red.length = 5; in pixfmt_to_var()
126 var->green.offset = 5; var->green.length = 6; in pixfmt_to_var()
127 var->blue.offset = 11; var->blue.length = 5; in pixfmt_to_var()
128 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
131 var->bits_per_pixel = 32; in pixfmt_to_var()
132 var->red.offset = 16; var->red.length = 8; in pixfmt_to_var()
133 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
134 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
135 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
138 var->bits_per_pixel = 32; in pixfmt_to_var()
139 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
140 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
141 var->blue.offset = 16; var->blue.length = 8; in pixfmt_to_var()
142 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
145 var->bits_per_pixel = 32; in pixfmt_to_var()
146 var->red.offset = 16; var->red.length = 8; in pixfmt_to_var()
147 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
148 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
149 var->transp.offset = 24; var->transp.length = 8; in pixfmt_to_var()
152 var->bits_per_pixel = 32; in pixfmt_to_var()
153 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
154 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
155 var->blue.offset = 16; var->blue.length = 8; in pixfmt_to_var()
156 var->transp.offset = 24; var->transp.length = 8; in pixfmt_to_var()
159 var->bits_per_pixel = 24; in pixfmt_to_var()
160 var->red.offset = 16; var->red.length = 8; in pixfmt_to_var()
161 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
162 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
163 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
166 var->bits_per_pixel = 24; in pixfmt_to_var()
167 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
168 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
169 var->blue.offset = 16; var->blue.length = 8; in pixfmt_to_var()
170 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
173 var->bits_per_pixel = 12; in pixfmt_to_var()
174 var->red.offset = 4; var->red.length = 8; in pixfmt_to_var()
175 var->green.offset = 2; var->green.length = 2; in pixfmt_to_var()
176 var->blue.offset = 0; var->blue.length = 2; in pixfmt_to_var()
177 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
180 var->bits_per_pixel = 12; in pixfmt_to_var()
181 var->red.offset = 4; var->red.length = 8; in pixfmt_to_var()
182 var->green.offset = 0; var->green.length = 2; in pixfmt_to_var()
183 var->blue.offset = 2; var->blue.length = 2; in pixfmt_to_var()
184 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
187 var->bits_per_pixel = 16; in pixfmt_to_var()
188 var->red.offset = 8; var->red.length = 8; in pixfmt_to_var()
189 var->green.offset = 4; var->green.length = 4; in pixfmt_to_var()
190 var->blue.offset = 0; var->blue.length = 4; in pixfmt_to_var()
191 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
194 var->bits_per_pixel = 16; in pixfmt_to_var()
195 var->red.offset = 8; var->red.length = 8; in pixfmt_to_var()
196 var->green.offset = 0; var->green.length = 4; in pixfmt_to_var()
197 var->blue.offset = 4; var->blue.length = 4; in pixfmt_to_var()
198 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
201 var->bits_per_pixel = 16; in pixfmt_to_var()
202 var->red.offset = 8; var->red.length = 16; in pixfmt_to_var()
203 var->green.offset = 4; var->green.length = 16; in pixfmt_to_var()
204 var->blue.offset = 0; var->blue.length = 16; in pixfmt_to_var()
205 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
208 var->bits_per_pixel = 16; in pixfmt_to_var()
209 var->red.offset = 8; var->red.length = 16; in pixfmt_to_var()
210 var->green.offset = 0; var->green.length = 16; in pixfmt_to_var()
211 var->blue.offset = 4; var->blue.length = 16; in pixfmt_to_var()
212 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
215 var->bits_per_pixel = 16; in pixfmt_to_var()
216 var->red.offset = 0; var->red.length = 16; in pixfmt_to_var()
217 var->green.offset = 4; var->green.length = 16; in pixfmt_to_var()
218 var->blue.offset = 8; var->blue.length = 16; in pixfmt_to_var()
219 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
222 var->bits_per_pixel = 8; in pixfmt_to_var()
223 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
224 var->green.offset = 0; var->green.length = 8; in pixfmt_to_var()
225 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
226 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
287 static int mmpfb_check_var(struct fb_var_screeninfo *var, in mmpfb_check_var() argument
292 if (var->bits_per_pixel == 8) in mmpfb_check_var()
297 if (var->xoffset + var->xres > var->xres_virtual) in mmpfb_check_var()
299 if (var->yoffset + var->yres > var->yres_virtual) in mmpfb_check_var()
305 if (var->xres_virtual * var->yres_virtual * in mmpfb_check_var()
306 (var->bits_per_pixel >> 3) > fbi->fb_size) in mmpfb_check_var()
334 val = chan_to_field(red, &info->var.red); in mmpfb_setcolreg()
335 val |= chan_to_field(green, &info->var.green); in mmpfb_setcolreg()
336 val |= chan_to_field(blue , &info->var.blue); in mmpfb_setcolreg()
348 static int mmpfb_pan_display(struct fb_var_screeninfo *var, in mmpfb_pan_display() argument
355 addr.phys[0] = (var->yoffset * var->xres_virtual + var->xoffset) in mmpfb_pan_display()
356 * var->bits_per_pixel / 8 + fbi->fb_start_dma; in mmpfb_pan_display()
365 struct fb_var_screeninfo *var = &info->var; in var_update() local
370 pix_fmt = var_to_pixfmt(var); in var_update()
373 pixfmt_to_var(var, pix_fmt); in var_update()
377 m = (struct fb_videomode *)fb_match_mode(var, &info->modelist); in var_update()
380 m = (struct fb_videomode *)fb_find_best_mode(var, in var_update()
382 fb_videomode_to_var(var, m); in var_update()
387 var->yres_virtual = var->yres * 2; in var_update()
390 info->fix.line_length = var->xres_virtual * var->bits_per_pixel / 8; in var_update()
391 info->fix.ypanstep = var->yres; in var_update()
398 struct fb_var_screeninfo *var = &info->var; in mmpfb_set_par() local
420 addr.phys[0] = (var->yoffset * var->xres_virtual + var->xoffset) in mmpfb_set_par()
421 * var->bits_per_pixel / 8 + fbi->fb_start_dma; in mmpfb_set_par()
431 struct fb_var_screeninfo *var = &fbi->fb_info->var; in mmpfb_power() local
444 (var->yoffset * var->xres_virtual + var->xoffset) in mmpfb_power()
445 * var->bits_per_pixel / 8; in mmpfb_power()
499 fb_videomode_to_var(&info->var, &fbi->mode); in modes_setup()
518 info->fix.ypanstep = info->var.yres; in fb_info_setup()
525 info->fix.line_length = info->var.xres_virtual * in fb_info_setup()
526 info->var.bits_per_pixel / 8; in fb_info_setup()
573 pixfmt_to_var(&info->var, fbi->pix_fmt); in mmpfb_probe()
607 info->var.yres_virtual = info->var.yres * 2; in mmpfb_probe()
610 fbi->fb_size = info->var.xres_virtual * info->var.yres_virtual in mmpfb_probe()
611 * info->var.bits_per_pixel / 8; in mmpfb_probe()