Lines Matching full:var
66 int fb_get_color_depth(struct fb_var_screeninfo *var, in fb_get_color_depth() argument
75 if (var->green.length == var->blue.length && in fb_get_color_depth()
76 var->green.length == var->red.length && in fb_get_color_depth()
77 var->green.offset == var->blue.offset && in fb_get_color_depth()
78 var->green.offset == var->red.offset) in fb_get_color_depth()
79 depth = var->green.length; in fb_get_color_depth()
81 depth = var->green.length + var->red.length + in fb_get_color_depth()
82 var->blue.length; in fb_get_color_depth()
166 fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) in fb_pan_display() argument
169 unsigned int yres = info->var.yres; in fb_pan_display()
172 if (var->yoffset > 0) { in fb_pan_display()
173 if (var->vmode & FB_VMODE_YWRAP) { in fb_pan_display()
174 if (!fix->ywrapstep || (var->yoffset % fix->ywrapstep)) in fb_pan_display()
178 } else if (!fix->ypanstep || (var->yoffset % fix->ypanstep)) in fb_pan_display()
182 if (var->xoffset > 0 && (!fix->xpanstep || in fb_pan_display()
183 (var->xoffset % fix->xpanstep))) in fb_pan_display()
187 var->yoffset > info->var.yres_virtual - yres || in fb_pan_display()
188 var->xoffset > info->var.xres_virtual - info->var.xres) in fb_pan_display()
191 if ((err = info->fbops->fb_pan_display(var, info))) in fb_pan_display()
193 info->var.xoffset = var->xoffset; in fb_pan_display()
194 info->var.yoffset = var->yoffset; in fb_pan_display()
195 if (var->vmode & FB_VMODE_YWRAP) in fb_pan_display()
196 info->var.vmode |= FB_VMODE_YWRAP; in fb_pan_display()
198 info->var.vmode &= ~FB_VMODE_YWRAP; in fb_pan_display()
203 static int fb_check_caps(struct fb_info *info, struct fb_var_screeninfo *var, in fb_check_caps() argument
213 info->fbops->fb_get_caps(info, &fbcaps, var); in fb_check_caps()
224 fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) in fb_set_var() argument
233 if (var->activate & FB_ACTIVATE_INV_MODE) { in fb_set_var()
236 fb_var_to_videomode(&mode1, var); in fb_set_var()
237 fb_var_to_videomode(&mode2, &info->var); in fb_set_var()
238 /* make sure we don't delete the videomode of current var */ in fb_set_var()
249 if (!(var->activate & FB_ACTIVATE_FORCE) && in fb_set_var()
250 !memcmp(&info->var, var, sizeof(struct fb_var_screeninfo))) in fb_set_var()
253 activate = var->activate; in fb_set_var()
259 var->grayscale > 1) { in fb_set_var()
260 if (var->red.offset || var->green.offset || in fb_set_var()
261 var->blue.offset || var->transp.offset || in fb_set_var()
262 var->red.length || var->green.length || in fb_set_var()
263 var->blue.length || var->transp.length || in fb_set_var()
264 var->red.msb_right || var->green.msb_right || in fb_set_var()
265 var->blue.msb_right || var->transp.msb_right) in fb_set_var()
270 *var = info->var; in fb_set_var()
275 if (var->xres < 8 || var->yres < 8) in fb_set_var()
279 if (check_mul_overflow(var->xres, var->yres, &unused) || in fb_set_var()
280 check_mul_overflow(var->xres_virtual, var->yres_virtual, &unused)) in fb_set_var()
283 ret = info->fbops->fb_check_var(var, info); in fb_set_var()
289 if (var->xres_virtual < var->xres || in fb_set_var()
290 var->yres_virtual < var->yres) { in fb_set_var()
293 var->xres_virtual, var->yres_virtual, in fb_set_var()
294 var->xres, var->yres); in fb_set_var()
298 if ((var->activate & FB_ACTIVATE_MASK) != FB_ACTIVATE_NOW) in fb_set_var()
302 ret = fb_check_caps(info, var, activate); in fb_set_var()
308 old_var = info->var; in fb_set_var()
309 info->var = *var; in fb_set_var()
315 info->var = old_var; in fb_set_var()
323 fb_pan_display(info, &info->var); in fb_set_var()
325 fb_var_to_videomode(&mode, &info->var); in fb_set_var()
437 fb_var_to_videomode(&mode, &fb_info->var); in do_register_framebuffer()
651 struct fb_var_screeninfo var = info->var; in fb_new_modelist() local
660 fb_videomode_to_var(&var, m); in fb_new_modelist()
661 var.activate = FB_ACTIVATE_TEST; in fb_new_modelist()
662 err = fb_set_var(info, &var); in fb_new_modelist()
663 fb_var_to_videomode(&mode, &var); in fb_new_modelist()