Lines Matching refs:var
71 static int vfb_check_var(struct fb_var_screeninfo *var,
76 static int vfb_pan_display(struct fb_var_screeninfo *var,
117 static int vfb_check_var(struct fb_var_screeninfo *var, in vfb_check_var() argument
127 if (var->vmode & FB_VMODE_CONUPDATE) { in vfb_check_var()
128 var->vmode |= FB_VMODE_YWRAP; in vfb_check_var()
129 var->xoffset = info->var.xoffset; in vfb_check_var()
130 var->yoffset = info->var.yoffset; in vfb_check_var()
136 if (!var->xres) in vfb_check_var()
137 var->xres = 1; in vfb_check_var()
138 if (!var->yres) in vfb_check_var()
139 var->yres = 1; in vfb_check_var()
140 if (var->xres > var->xres_virtual) in vfb_check_var()
141 var->xres_virtual = var->xres; in vfb_check_var()
142 if (var->yres > var->yres_virtual) in vfb_check_var()
143 var->yres_virtual = var->yres; in vfb_check_var()
144 if (var->bits_per_pixel <= 1) in vfb_check_var()
145 var->bits_per_pixel = 1; in vfb_check_var()
146 else if (var->bits_per_pixel <= 8) in vfb_check_var()
147 var->bits_per_pixel = 8; in vfb_check_var()
148 else if (var->bits_per_pixel <= 16) in vfb_check_var()
149 var->bits_per_pixel = 16; in vfb_check_var()
150 else if (var->bits_per_pixel <= 24) in vfb_check_var()
151 var->bits_per_pixel = 24; in vfb_check_var()
152 else if (var->bits_per_pixel <= 32) in vfb_check_var()
153 var->bits_per_pixel = 32; in vfb_check_var()
157 if (var->xres_virtual < var->xoffset + var->xres) in vfb_check_var()
158 var->xres_virtual = var->xoffset + var->xres; in vfb_check_var()
159 if (var->yres_virtual < var->yoffset + var->yres) in vfb_check_var()
160 var->yres_virtual = var->yoffset + var->yres; in vfb_check_var()
166 get_line_length(var->xres_virtual, var->bits_per_pixel); in vfb_check_var()
167 if (line_length * var->yres_virtual > videomemorysize) in vfb_check_var()
175 switch (var->bits_per_pixel) { in vfb_check_var()
178 var->red.offset = 0; in vfb_check_var()
179 var->red.length = 8; in vfb_check_var()
180 var->green.offset = 0; in vfb_check_var()
181 var->green.length = 8; in vfb_check_var()
182 var->blue.offset = 0; in vfb_check_var()
183 var->blue.length = 8; in vfb_check_var()
184 var->transp.offset = 0; in vfb_check_var()
185 var->transp.length = 0; in vfb_check_var()
188 if (var->transp.length) { in vfb_check_var()
189 var->red.offset = 0; in vfb_check_var()
190 var->red.length = 5; in vfb_check_var()
191 var->green.offset = 5; in vfb_check_var()
192 var->green.length = 5; in vfb_check_var()
193 var->blue.offset = 10; in vfb_check_var()
194 var->blue.length = 5; in vfb_check_var()
195 var->transp.offset = 15; in vfb_check_var()
196 var->transp.length = 1; in vfb_check_var()
198 var->red.offset = 0; in vfb_check_var()
199 var->red.length = 5; in vfb_check_var()
200 var->green.offset = 5; in vfb_check_var()
201 var->green.length = 6; in vfb_check_var()
202 var->blue.offset = 11; in vfb_check_var()
203 var->blue.length = 5; in vfb_check_var()
204 var->transp.offset = 0; in vfb_check_var()
205 var->transp.length = 0; in vfb_check_var()
209 var->red.offset = 0; in vfb_check_var()
210 var->red.length = 8; in vfb_check_var()
211 var->green.offset = 8; in vfb_check_var()
212 var->green.length = 8; in vfb_check_var()
213 var->blue.offset = 16; in vfb_check_var()
214 var->blue.length = 8; in vfb_check_var()
215 var->transp.offset = 0; in vfb_check_var()
216 var->transp.length = 0; in vfb_check_var()
219 var->red.offset = 0; in vfb_check_var()
220 var->red.length = 8; in vfb_check_var()
221 var->green.offset = 8; in vfb_check_var()
222 var->green.length = 8; in vfb_check_var()
223 var->blue.offset = 16; in vfb_check_var()
224 var->blue.length = 8; in vfb_check_var()
225 var->transp.offset = 24; in vfb_check_var()
226 var->transp.length = 8; in vfb_check_var()
229 var->red.msb_right = 0; in vfb_check_var()
230 var->green.msb_right = 0; in vfb_check_var()
231 var->blue.msb_right = 0; in vfb_check_var()
232 var->transp.msb_right = 0; in vfb_check_var()
243 switch (info->var.bits_per_pixel) { in vfb_set_par()
257 info->fix.line_length = get_line_length(info->var.xres_virtual, in vfb_set_par()
258 info->var.bits_per_pixel); in vfb_set_par()
279 if (info->var.grayscale) { in vfb_setcolreg()
313 red = CNVT_TOHW(red, info->var.red.length); in vfb_setcolreg()
314 green = CNVT_TOHW(green, info->var.green.length); in vfb_setcolreg()
315 blue = CNVT_TOHW(blue, info->var.blue.length); in vfb_setcolreg()
316 transp = CNVT_TOHW(transp, info->var.transp.length); in vfb_setcolreg()
334 v = (red << info->var.red.offset) | in vfb_setcolreg()
335 (green << info->var.green.offset) | in vfb_setcolreg()
336 (blue << info->var.blue.offset) | in vfb_setcolreg()
337 (transp << info->var.transp.offset); in vfb_setcolreg()
338 switch (info->var.bits_per_pixel) { in vfb_setcolreg()
360 static int vfb_pan_display(struct fb_var_screeninfo *var, in vfb_pan_display() argument
363 if (var->vmode & FB_VMODE_YWRAP) { in vfb_pan_display()
364 if (var->yoffset >= info->var.yres_virtual || in vfb_pan_display()
365 var->xoffset) in vfb_pan_display()
368 if (var->xoffset + info->var.xres > info->var.xres_virtual || in vfb_pan_display()
369 var->yoffset + info->var.yres > info->var.yres_virtual) in vfb_pan_display()
372 info->var.xoffset = var->xoffset; in vfb_pan_display()
373 info->var.yoffset = var->yoffset; in vfb_pan_display()
374 if (var->vmode & FB_VMODE_YWRAP) in vfb_pan_display()
375 info->var.vmode |= FB_VMODE_YWRAP; in vfb_pan_display()
377 info->var.vmode &= ~FB_VMODE_YWRAP; in vfb_pan_display()
446 if (!fb_find_mode(&info->var, info, mode_option, in vfb_probe()