Lines Matching refs:var
116 static int vfb_check_var(struct fb_var_screeninfo *var,
121 static int vfb_pan_display(struct fb_var_screeninfo *var,
161 static int vfb_check_var(struct fb_var_screeninfo *var, in vfb_check_var() argument
171 if (var->vmode & FB_VMODE_CONUPDATE) { in vfb_check_var()
172 var->vmode |= FB_VMODE_YWRAP; in vfb_check_var()
173 var->xoffset = info->var.xoffset; in vfb_check_var()
174 var->yoffset = info->var.yoffset; in vfb_check_var()
180 if (!var->xres) in vfb_check_var()
181 var->xres = 1; in vfb_check_var()
182 if (!var->yres) in vfb_check_var()
183 var->yres = 1; in vfb_check_var()
184 if (var->xres > var->xres_virtual) in vfb_check_var()
185 var->xres_virtual = var->xres; in vfb_check_var()
186 if (var->yres > var->yres_virtual) in vfb_check_var()
187 var->yres_virtual = var->yres; in vfb_check_var()
188 if (var->bits_per_pixel <= 1) in vfb_check_var()
189 var->bits_per_pixel = 1; in vfb_check_var()
190 else if (var->bits_per_pixel <= 8) in vfb_check_var()
191 var->bits_per_pixel = 8; in vfb_check_var()
192 else if (var->bits_per_pixel <= 16) in vfb_check_var()
193 var->bits_per_pixel = 16; in vfb_check_var()
194 else if (var->bits_per_pixel <= 24) in vfb_check_var()
195 var->bits_per_pixel = 24; in vfb_check_var()
196 else if (var->bits_per_pixel <= 32) in vfb_check_var()
197 var->bits_per_pixel = 32; in vfb_check_var()
201 if (var->xres_virtual < var->xoffset + var->xres) in vfb_check_var()
202 var->xres_virtual = var->xoffset + var->xres; in vfb_check_var()
203 if (var->yres_virtual < var->yoffset + var->yres) in vfb_check_var()
204 var->yres_virtual = var->yoffset + var->yres; in vfb_check_var()
210 get_line_length(var->xres_virtual, var->bits_per_pixel); in vfb_check_var()
211 if (line_length * var->yres_virtual > videomemorysize) in vfb_check_var()
219 switch (var->bits_per_pixel) { in vfb_check_var()
222 var->red.offset = 0; in vfb_check_var()
223 var->red.length = 8; in vfb_check_var()
224 var->green.offset = 0; in vfb_check_var()
225 var->green.length = 8; in vfb_check_var()
226 var->blue.offset = 0; in vfb_check_var()
227 var->blue.length = 8; in vfb_check_var()
228 var->transp.offset = 0; in vfb_check_var()
229 var->transp.length = 0; in vfb_check_var()
232 if (var->transp.length) { in vfb_check_var()
233 var->red.offset = 0; in vfb_check_var()
234 var->red.length = 5; in vfb_check_var()
235 var->green.offset = 5; in vfb_check_var()
236 var->green.length = 5; in vfb_check_var()
237 var->blue.offset = 10; in vfb_check_var()
238 var->blue.length = 5; in vfb_check_var()
239 var->transp.offset = 15; in vfb_check_var()
240 var->transp.length = 1; in vfb_check_var()
242 var->red.offset = 0; in vfb_check_var()
243 var->red.length = 5; in vfb_check_var()
244 var->green.offset = 5; in vfb_check_var()
245 var->green.length = 6; in vfb_check_var()
246 var->blue.offset = 11; in vfb_check_var()
247 var->blue.length = 5; in vfb_check_var()
248 var->transp.offset = 0; in vfb_check_var()
249 var->transp.length = 0; in vfb_check_var()
253 var->red.offset = 0; in vfb_check_var()
254 var->red.length = 8; in vfb_check_var()
255 var->green.offset = 8; in vfb_check_var()
256 var->green.length = 8; in vfb_check_var()
257 var->blue.offset = 16; in vfb_check_var()
258 var->blue.length = 8; in vfb_check_var()
259 var->transp.offset = 0; in vfb_check_var()
260 var->transp.length = 0; in vfb_check_var()
263 var->red.offset = 0; in vfb_check_var()
264 var->red.length = 8; in vfb_check_var()
265 var->green.offset = 8; in vfb_check_var()
266 var->green.length = 8; in vfb_check_var()
267 var->blue.offset = 16; in vfb_check_var()
268 var->blue.length = 8; in vfb_check_var()
269 var->transp.offset = 24; in vfb_check_var()
270 var->transp.length = 8; in vfb_check_var()
273 var->red.msb_right = 0; in vfb_check_var()
274 var->green.msb_right = 0; in vfb_check_var()
275 var->blue.msb_right = 0; in vfb_check_var()
276 var->transp.msb_right = 0; in vfb_check_var()
287 info->fix.line_length = get_line_length(info->var.xres_virtual, in vfb_set_par()
288 info->var.bits_per_pixel); in vfb_set_par()
308 if (info->var.grayscale) { in vfb_setcolreg()
342 red = CNVT_TOHW(red, info->var.red.length); in vfb_setcolreg()
343 green = CNVT_TOHW(green, info->var.green.length); in vfb_setcolreg()
344 blue = CNVT_TOHW(blue, info->var.blue.length); in vfb_setcolreg()
345 transp = CNVT_TOHW(transp, info->var.transp.length); in vfb_setcolreg()
363 v = (red << info->var.red.offset) | in vfb_setcolreg()
364 (green << info->var.green.offset) | in vfb_setcolreg()
365 (blue << info->var.blue.offset) | in vfb_setcolreg()
366 (transp << info->var.transp.offset); in vfb_setcolreg()
367 switch (info->var.bits_per_pixel) { in vfb_setcolreg()
389 static int vfb_pan_display(struct fb_var_screeninfo *var, in vfb_pan_display() argument
392 if (var->vmode & FB_VMODE_YWRAP) { in vfb_pan_display()
393 if (var->yoffset < 0 in vfb_pan_display()
394 || var->yoffset >= info->var.yres_virtual in vfb_pan_display()
395 || var->xoffset) in vfb_pan_display()
398 if (var->xoffset + info->var.xres > info->var.xres_virtual || in vfb_pan_display()
399 var->yoffset + info->var.yres > info->var.yres_virtual) in vfb_pan_display()
402 info->var.xoffset = var->xoffset; in vfb_pan_display()
403 info->var.yoffset = var->yoffset; in vfb_pan_display()
404 if (var->vmode & FB_VMODE_YWRAP) in vfb_pan_display()
405 info->var.vmode |= FB_VMODE_YWRAP; in vfb_pan_display()
407 info->var.vmode &= ~FB_VMODE_YWRAP; in vfb_pan_display()
509 retval = fb_find_mode(&info->var, info, NULL, in vfb_probe()
513 info->var = vfb_default; in vfb_probe()