Lines Matching refs:var
14 static int var_to_pixfmt(struct fb_var_screeninfo *var) in var_to_pixfmt() argument
19 if (var->bits_per_pixel == 8) in var_to_pixfmt()
25 if (var->bits_per_pixel == 16 && var->red.length == 8 && in var_to_pixfmt()
26 var->green.length == 4 && var->blue.length == 4) { in var_to_pixfmt()
27 if (var->green.offset >= var->blue.offset) in var_to_pixfmt()
36 if (var->bits_per_pixel == 12 && var->red.length == 8 && in var_to_pixfmt()
37 var->green.length == 2 && var->blue.length == 2) { in var_to_pixfmt()
38 if (var->green.offset >= var->blue.offset) in var_to_pixfmt()
47 if (var->bits_per_pixel == 16 && var->red.length == 16 && in var_to_pixfmt()
48 var->green.length == 16 && var->blue.length == 16) { in var_to_pixfmt()
49 if (var->red.offset == 0) in var_to_pixfmt()
51 else if (var->green.offset >= var->blue.offset) in var_to_pixfmt()
60 if (var->bits_per_pixel == 16 && var->red.length <= 5 && in var_to_pixfmt()
61 var->green.length <= 6 && var->blue.length <= 5) { in var_to_pixfmt()
62 if (var->transp.length == 0) { in var_to_pixfmt()
63 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
73 if (var->bits_per_pixel <= 32 && var->red.length <= 8 && in var_to_pixfmt()
74 var->green.length <= 8 && var->blue.length <= 8) { in var_to_pixfmt()
75 if (var->bits_per_pixel == 24 && var->transp.length == 0) { in var_to_pixfmt()
76 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
82 if (var->bits_per_pixel == 32 && var->transp.offset == 24) { in var_to_pixfmt()
83 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
88 if (var->red.offset >= var->blue.offset) in var_to_pixfmt()
98 static void pixfmt_to_var(struct fb_var_screeninfo *var, int pix_fmt) in pixfmt_to_var() argument
102 var->bits_per_pixel = 16; in pixfmt_to_var()
103 var->red.offset = 11; var->red.length = 5; in pixfmt_to_var()
104 var->green.offset = 5; var->green.length = 6; in pixfmt_to_var()
105 var->blue.offset = 0; var->blue.length = 5; in pixfmt_to_var()
106 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
109 var->bits_per_pixel = 16; in pixfmt_to_var()
110 var->red.offset = 0; var->red.length = 5; in pixfmt_to_var()
111 var->green.offset = 5; var->green.length = 6; in pixfmt_to_var()
112 var->blue.offset = 11; var->blue.length = 5; in pixfmt_to_var()
113 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
116 var->bits_per_pixel = 32; in pixfmt_to_var()
117 var->red.offset = 16; var->red.length = 8; in pixfmt_to_var()
118 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
119 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
120 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
123 var->bits_per_pixel = 32; in pixfmt_to_var()
124 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
125 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
126 var->blue.offset = 16; var->blue.length = 8; in pixfmt_to_var()
127 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
130 var->bits_per_pixel = 32; in pixfmt_to_var()
131 var->red.offset = 16; var->red.length = 8; in pixfmt_to_var()
132 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
133 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
134 var->transp.offset = 24; var->transp.length = 8; in pixfmt_to_var()
137 var->bits_per_pixel = 32; in pixfmt_to_var()
138 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
139 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
140 var->blue.offset = 16; var->blue.length = 8; in pixfmt_to_var()
141 var->transp.offset = 24; var->transp.length = 8; in pixfmt_to_var()
144 var->bits_per_pixel = 24; in pixfmt_to_var()
145 var->red.offset = 16; var->red.length = 8; in pixfmt_to_var()
146 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
147 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
148 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
151 var->bits_per_pixel = 24; in pixfmt_to_var()
152 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
153 var->green.offset = 8; var->green.length = 8; in pixfmt_to_var()
154 var->blue.offset = 16; var->blue.length = 8; in pixfmt_to_var()
155 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
158 var->bits_per_pixel = 12; in pixfmt_to_var()
159 var->red.offset = 4; var->red.length = 8; in pixfmt_to_var()
160 var->green.offset = 2; var->green.length = 2; in pixfmt_to_var()
161 var->blue.offset = 0; var->blue.length = 2; in pixfmt_to_var()
162 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
165 var->bits_per_pixel = 12; in pixfmt_to_var()
166 var->red.offset = 4; var->red.length = 8; in pixfmt_to_var()
167 var->green.offset = 0; var->green.length = 2; in pixfmt_to_var()
168 var->blue.offset = 2; var->blue.length = 2; in pixfmt_to_var()
169 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
172 var->bits_per_pixel = 16; in pixfmt_to_var()
173 var->red.offset = 8; var->red.length = 8; in pixfmt_to_var()
174 var->green.offset = 4; var->green.length = 4; in pixfmt_to_var()
175 var->blue.offset = 0; var->blue.length = 4; in pixfmt_to_var()
176 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
179 var->bits_per_pixel = 16; in pixfmt_to_var()
180 var->red.offset = 8; var->red.length = 8; in pixfmt_to_var()
181 var->green.offset = 0; var->green.length = 4; in pixfmt_to_var()
182 var->blue.offset = 4; var->blue.length = 4; in pixfmt_to_var()
183 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
186 var->bits_per_pixel = 16; in pixfmt_to_var()
187 var->red.offset = 8; var->red.length = 16; in pixfmt_to_var()
188 var->green.offset = 4; var->green.length = 16; in pixfmt_to_var()
189 var->blue.offset = 0; var->blue.length = 16; in pixfmt_to_var()
190 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
193 var->bits_per_pixel = 16; in pixfmt_to_var()
194 var->red.offset = 8; var->red.length = 16; in pixfmt_to_var()
195 var->green.offset = 0; var->green.length = 16; in pixfmt_to_var()
196 var->blue.offset = 4; var->blue.length = 16; in pixfmt_to_var()
197 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
200 var->bits_per_pixel = 16; in pixfmt_to_var()
201 var->red.offset = 0; var->red.length = 16; in pixfmt_to_var()
202 var->green.offset = 4; var->green.length = 16; in pixfmt_to_var()
203 var->blue.offset = 8; var->blue.length = 16; in pixfmt_to_var()
204 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
207 var->bits_per_pixel = 8; in pixfmt_to_var()
208 var->red.offset = 0; var->red.length = 8; in pixfmt_to_var()
209 var->green.offset = 0; var->green.length = 8; in pixfmt_to_var()
210 var->blue.offset = 0; var->blue.length = 8; in pixfmt_to_var()
211 var->transp.offset = 0; var->transp.length = 0; in pixfmt_to_var()
272 static int mmpfb_check_var(struct fb_var_screeninfo *var, in mmpfb_check_var() argument
277 if (var->bits_per_pixel == 8) in mmpfb_check_var()
282 if (var->xoffset + var->xres > var->xres_virtual) in mmpfb_check_var()
284 if (var->yoffset + var->yres > var->yres_virtual) in mmpfb_check_var()
290 if (var->xres_virtual * var->yres_virtual * in mmpfb_check_var()
291 (var->bits_per_pixel >> 3) > fbi->fb_size) in mmpfb_check_var()
319 val = chan_to_field(red, &info->var.red); in mmpfb_setcolreg()
320 val |= chan_to_field(green, &info->var.green); in mmpfb_setcolreg()
321 val |= chan_to_field(blue , &info->var.blue); in mmpfb_setcolreg()
333 static int mmpfb_pan_display(struct fb_var_screeninfo *var, in mmpfb_pan_display() argument
340 addr.phys[0] = (var->yoffset * var->xres_virtual + var->xoffset) in mmpfb_pan_display()
341 * var->bits_per_pixel / 8 + fbi->fb_start_dma; in mmpfb_pan_display()
350 struct fb_var_screeninfo *var = &info->var; in var_update() local
355 pix_fmt = var_to_pixfmt(var); in var_update()
358 pixfmt_to_var(var, pix_fmt); in var_update()
362 m = (struct fb_videomode *)fb_match_mode(var, &info->modelist); in var_update()
365 m = (struct fb_videomode *)fb_find_best_mode(var, in var_update()
367 fb_videomode_to_var(var, m); in var_update()
372 var->yres_virtual = var->yres * 2; in var_update()
375 info->fix.line_length = var->xres_virtual * var->bits_per_pixel / 8; in var_update()
376 info->fix.ypanstep = var->yres; in var_update()
383 struct fb_var_screeninfo *var = &info->var; in mmpfb_set_win() local
392 win.pitch[0] = var->xres_virtual * stride; in mmpfb_set_win()
394 (stride == 1) ? (var->xres_virtual >> 1) : 0; in mmpfb_set_win()
401 struct fb_var_screeninfo *var = &info->var; in mmpfb_set_par() local
419 addr.phys[0] = (var->yoffset * var->xres_virtual + var->xoffset) in mmpfb_set_par()
420 * var->bits_per_pixel / 8 + fbi->fb_start_dma; in mmpfb_set_par()
429 struct fb_var_screeninfo *var = &fbi->fb_info->var; in mmpfb_power() local
439 (var->yoffset * var->xres_virtual + var->xoffset) in mmpfb_power()
440 * var->bits_per_pixel / 8; in mmpfb_power()
493 fb_videomode_to_var(&info->var, &fbi->mode); in modes_setup()
512 info->fix.ypanstep = info->var.yres; in fb_info_setup()
519 info->fix.line_length = info->var.xres_virtual * in fb_info_setup()
520 info->var.bits_per_pixel / 8; in fb_info_setup()
563 pixfmt_to_var(&info->var, fbi->pix_fmt); in mmpfb_probe()
597 info->var.yres_virtual = info->var.yres * 2; in mmpfb_probe()
600 fbi->fb_size = info->var.xres_virtual * info->var.yres_virtual in mmpfb_probe()
601 * info->var.bits_per_pixel / 8; in mmpfb_probe()