Lines Matching refs:var
82 static int vfb_get_var(struct fb_var_screeninfo *var, int con,
84 static int vfb_set_var(struct fb_var_screeninfo *var, int con,
86 static int vfb_pan_display(struct fb_var_screeninfo *var, int con,
110 struct fb_var_screeninfo *var);
111 static void set_color_bitfields(struct fb_var_screeninfo *var);
136 struct fb_var_screeninfo *var; in vfb_get_fix() local
139 var = &vfb_default; in vfb_get_fix()
141 var = &fb_display[con].var; in vfb_get_fix()
142 vfb_encode_fix(fix, var); in vfb_get_fix()
151 static int vfb_get_var(struct fb_var_screeninfo *var, int con, in vfb_get_var() argument
155 *var = vfb_default; in vfb_get_var()
157 *var = fb_display[con].var; in vfb_get_var()
158 set_color_bitfields(var); in vfb_get_var()
167 static int vfb_set_var(struct fb_var_screeninfo *var, int con, in vfb_set_var() argument
170 int err, activate = var->activate; in vfb_set_var()
185 if (var->vmode & FB_VMODE_CONUPDATE) { in vfb_set_var()
186 var->vmode |= FB_VMODE_YWRAP; in vfb_set_var()
187 var->xoffset = display->var.xoffset; in vfb_set_var()
188 var->yoffset = display->var.yoffset; in vfb_set_var()
194 if (!var->xres) in vfb_set_var()
195 var->xres = 1; in vfb_set_var()
196 if (!var->yres) in vfb_set_var()
197 var->yres = 1; in vfb_set_var()
198 if (var->xres > var->xres_virtual) in vfb_set_var()
199 var->xres_virtual = var->xres; in vfb_set_var()
200 if (var->yres > var->yres_virtual) in vfb_set_var()
201 var->yres_virtual = var->yres; in vfb_set_var()
202 if (var->bits_per_pixel <= 1) in vfb_set_var()
203 var->bits_per_pixel = 1; in vfb_set_var()
204 else if (var->bits_per_pixel <= 8) in vfb_set_var()
205 var->bits_per_pixel = 8; in vfb_set_var()
206 else if (var->bits_per_pixel <= 16) in vfb_set_var()
207 var->bits_per_pixel = 16; in vfb_set_var()
210 else if (var->bits_per_pixel <= 24) in vfb_set_var()
211 var->bits_per_pixel = 24; in vfb_set_var()
212 else if (var->bits_per_pixel <= 32) in vfb_set_var()
213 var->bits_per_pixel = 32; in vfb_set_var()
221 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in vfb_set_var()
222 if (line_length*var->yres_virtual > videomemorysize) in vfb_set_var()
225 set_color_bitfields(var); in vfb_set_var()
228 oldxres = display->var.xres; in vfb_set_var()
229 oldyres = display->var.yres; in vfb_set_var()
230 oldvxres = display->var.xres_virtual; in vfb_set_var()
231 oldvyres = display->var.yres_virtual; in vfb_set_var()
232 oldbpp = display->var.bits_per_pixel; in vfb_set_var()
233 display->var = *var; in vfb_set_var()
234 if (oldxres != var->xres || oldyres != var->yres || in vfb_set_var()
235 oldvxres != var->xres_virtual || oldvyres != var->yres_virtual || in vfb_set_var()
236 oldbpp != var->bits_per_pixel) { in vfb_set_var()
239 vfb_encode_fix(&fix, var); in vfb_set_var()
249 switch (var->bits_per_pixel) { in vfb_set_var()
295 if (oldbpp != var->bits_per_pixel) { in vfb_set_var()
311 static int vfb_pan_display(struct fb_var_screeninfo *var, int con, in vfb_pan_display() argument
314 if (var->vmode & FB_VMODE_YWRAP) { in vfb_pan_display()
315 if (var->yoffset < 0 || in vfb_pan_display()
316 var->yoffset >= fb_display[con].var.yres_virtual || in vfb_pan_display()
317 var->xoffset) in vfb_pan_display()
320 if (var->xoffset+fb_display[con].var.xres > in vfb_pan_display()
321 fb_display[con].var.xres_virtual || in vfb_pan_display()
322 var->yoffset+fb_display[con].var.yres > in vfb_pan_display()
323 fb_display[con].var.yres_virtual) in vfb_pan_display()
326 fb_display[con].var.xoffset = var->xoffset; in vfb_pan_display()
327 fb_display[con].var.yoffset = var->yoffset; in vfb_pan_display()
328 if (var->vmode & FB_VMODE_YWRAP) in vfb_pan_display()
329 fb_display[con].var.vmode |= FB_VMODE_YWRAP; in vfb_pan_display()
331 fb_display[con].var.vmode &= ~FB_VMODE_YWRAP; in vfb_pan_display()
347 fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel), in vfb_get_cmap()
363 1<<fb_display[con].var.bits_per_pixel, 0))) in vfb_set_cmap()
470 struct fb_var_screeninfo *var) in vfb_encode_fix() argument
478 switch (var->bits_per_pixel) { in vfb_encode_fix()
496 fix->line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in vfb_encode_fix()
499 static void set_color_bitfields(struct fb_var_screeninfo *var) in set_color_bitfields() argument
501 switch (var->bits_per_pixel) { in set_color_bitfields()
504 var->red.offset = 0; in set_color_bitfields()
505 var->red.length = 8; in set_color_bitfields()
506 var->green.offset = 0; in set_color_bitfields()
507 var->green.length = 8; in set_color_bitfields()
508 var->blue.offset = 0; in set_color_bitfields()
509 var->blue.length = 8; in set_color_bitfields()
510 var->transp.offset = 0; in set_color_bitfields()
511 var->transp.length = 0; in set_color_bitfields()
514 var->red.offset = 0; in set_color_bitfields()
515 var->red.length = 5; in set_color_bitfields()
516 var->green.offset = 5; in set_color_bitfields()
517 var->green.length = 6; in set_color_bitfields()
518 var->blue.offset = 11; in set_color_bitfields()
519 var->blue.length = 5; in set_color_bitfields()
520 var->transp.offset = 0; in set_color_bitfields()
521 var->transp.length = 0; in set_color_bitfields()
524 var->red.offset = 0; in set_color_bitfields()
525 var->red.length = 8; in set_color_bitfields()
526 var->green.offset = 8; in set_color_bitfields()
527 var->green.length = 8; in set_color_bitfields()
528 var->blue.offset = 16; in set_color_bitfields()
529 var->blue.length = 8; in set_color_bitfields()
530 var->transp.offset = 0; in set_color_bitfields()
531 var->transp.length = 0; in set_color_bitfields()
534 var->red.offset = 0; in set_color_bitfields()
535 var->red.length = 8; in set_color_bitfields()
536 var->green.offset = 8; in set_color_bitfields()
537 var->green.length = 8; in set_color_bitfields()
538 var->blue.offset = 16; in set_color_bitfields()
539 var->blue.length = 8; in set_color_bitfields()
540 var->transp.offset = 24; in set_color_bitfields()
541 var->transp.length = 8; in set_color_bitfields()
544 var->red.msb_right = 0; in set_color_bitfields()
545 var->green.msb_right = 0; in set_color_bitfields()
546 var->blue.msb_right = 0; in set_color_bitfields()
547 var->transp.msb_right = 0; in set_color_bitfields()
597 fb_set_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel), 1, in do_install_cmap()