Lines Matching full:var
87 static int mc68x328fb_check_var(struct fb_var_screeninfo *var,
92 static int mc68x328fb_pan_display(struct fb_var_screeninfo *var,
124 * to hardware, it should only verify and adjust var.
126 * data from it to check this var.
129 static int mc68x328fb_check_var(struct fb_var_screeninfo *var, in mc68x328fb_check_var() argument
139 if (var->vmode & FB_VMODE_CONUPDATE) { in mc68x328fb_check_var()
140 var->vmode |= FB_VMODE_YWRAP; in mc68x328fb_check_var()
141 var->xoffset = info->var.xoffset; in mc68x328fb_check_var()
142 var->yoffset = info->var.yoffset; in mc68x328fb_check_var()
148 if (!var->xres) in mc68x328fb_check_var()
149 var->xres = 1; in mc68x328fb_check_var()
150 if (!var->yres) in mc68x328fb_check_var()
151 var->yres = 1; in mc68x328fb_check_var()
152 if (var->xres > var->xres_virtual) in mc68x328fb_check_var()
153 var->xres_virtual = var->xres; in mc68x328fb_check_var()
154 if (var->yres > var->yres_virtual) in mc68x328fb_check_var()
155 var->yres_virtual = var->yres; in mc68x328fb_check_var()
156 if (var->bits_per_pixel <= 1) in mc68x328fb_check_var()
157 var->bits_per_pixel = 1; in mc68x328fb_check_var()
158 else if (var->bits_per_pixel <= 8) in mc68x328fb_check_var()
159 var->bits_per_pixel = 8; in mc68x328fb_check_var()
160 else if (var->bits_per_pixel <= 16) in mc68x328fb_check_var()
161 var->bits_per_pixel = 16; in mc68x328fb_check_var()
162 else if (var->bits_per_pixel <= 24) in mc68x328fb_check_var()
163 var->bits_per_pixel = 24; in mc68x328fb_check_var()
164 else if (var->bits_per_pixel <= 32) in mc68x328fb_check_var()
165 var->bits_per_pixel = 32; in mc68x328fb_check_var()
169 if (var->xres_virtual < var->xoffset + var->xres) in mc68x328fb_check_var()
170 var->xres_virtual = var->xoffset + var->xres; in mc68x328fb_check_var()
171 if (var->yres_virtual < var->yoffset + var->yres) in mc68x328fb_check_var()
172 var->yres_virtual = var->yoffset + var->yres; in mc68x328fb_check_var()
178 get_line_length(var->xres_virtual, var->bits_per_pixel); in mc68x328fb_check_var()
179 if (line_length * var->yres_virtual > videomemorysize) in mc68x328fb_check_var()
183 * Now that we checked it we alter var. The reason being is that the video in mc68x328fb_check_var()
187 switch (var->bits_per_pixel) { in mc68x328fb_check_var()
189 var->red.offset = 0; in mc68x328fb_check_var()
190 var->red.length = 1; in mc68x328fb_check_var()
191 var->green.offset = 0; in mc68x328fb_check_var()
192 var->green.length = 1; in mc68x328fb_check_var()
193 var->blue.offset = 0; in mc68x328fb_check_var()
194 var->blue.length = 1; in mc68x328fb_check_var()
195 var->transp.offset = 0; in mc68x328fb_check_var()
196 var->transp.length = 0; in mc68x328fb_check_var()
199 var->red.offset = 0; in mc68x328fb_check_var()
200 var->red.length = 8; in mc68x328fb_check_var()
201 var->green.offset = 0; in mc68x328fb_check_var()
202 var->green.length = 8; in mc68x328fb_check_var()
203 var->blue.offset = 0; in mc68x328fb_check_var()
204 var->blue.length = 8; in mc68x328fb_check_var()
205 var->transp.offset = 0; in mc68x328fb_check_var()
206 var->transp.length = 0; in mc68x328fb_check_var()
209 if (var->transp.length) { in mc68x328fb_check_var()
210 var->red.offset = 0; in mc68x328fb_check_var()
211 var->red.length = 5; in mc68x328fb_check_var()
212 var->green.offset = 5; in mc68x328fb_check_var()
213 var->green.length = 5; in mc68x328fb_check_var()
214 var->blue.offset = 10; in mc68x328fb_check_var()
215 var->blue.length = 5; in mc68x328fb_check_var()
216 var->transp.offset = 15; in mc68x328fb_check_var()
217 var->transp.length = 1; in mc68x328fb_check_var()
219 var->red.offset = 0; in mc68x328fb_check_var()
220 var->red.length = 5; in mc68x328fb_check_var()
221 var->green.offset = 5; in mc68x328fb_check_var()
222 var->green.length = 6; in mc68x328fb_check_var()
223 var->blue.offset = 11; in mc68x328fb_check_var()
224 var->blue.length = 5; in mc68x328fb_check_var()
225 var->transp.offset = 0; in mc68x328fb_check_var()
226 var->transp.length = 0; in mc68x328fb_check_var()
230 var->red.offset = 0; in mc68x328fb_check_var()
231 var->red.length = 8; in mc68x328fb_check_var()
232 var->green.offset = 8; in mc68x328fb_check_var()
233 var->green.length = 8; in mc68x328fb_check_var()
234 var->blue.offset = 16; in mc68x328fb_check_var()
235 var->blue.length = 8; in mc68x328fb_check_var()
236 var->transp.offset = 0; in mc68x328fb_check_var()
237 var->transp.length = 0; in mc68x328fb_check_var()
240 var->red.offset = 0; in mc68x328fb_check_var()
241 var->red.length = 8; in mc68x328fb_check_var()
242 var->green.offset = 8; in mc68x328fb_check_var()
243 var->green.length = 8; in mc68x328fb_check_var()
244 var->blue.offset = 16; in mc68x328fb_check_var()
245 var->blue.length = 8; in mc68x328fb_check_var()
246 var->transp.offset = 24; in mc68x328fb_check_var()
247 var->transp.length = 8; in mc68x328fb_check_var()
250 var->red.msb_right = 0; in mc68x328fb_check_var()
251 var->green.msb_right = 0; in mc68x328fb_check_var()
252 var->blue.msb_right = 0; in mc68x328fb_check_var()
253 var->transp.msb_right = 0; in mc68x328fb_check_var()
264 info->fix.line_length = get_line_length(info->var.xres_virtual, in mc68x328fb_set_par()
265 info->var.bits_per_pixel); in mc68x328fb_set_par()
272 * entries in the var structure). Return != 0 for invalid regno.
285 if (info->var.grayscale) { in mc68x328fb_setcolreg()
292 * var->{color}.offset contains start of bitfield in mc68x328fb_setcolreg()
293 * var->{color}.length contains length of bitfield in mc68x328fb_setcolreg()
300 * var->{color}.offset is 0 in mc68x328fb_setcolreg()
301 * var->{color}.length contains width of DAC in mc68x328fb_setcolreg()
306 * var->{color}.offset contains start of bitfield in mc68x328fb_setcolreg()
307 * var->{color}.length contains length of bitfield in mc68x328fb_setcolreg()
316 red = CNVT_TOHW(red, info->var.red.length); in mc68x328fb_setcolreg()
317 green = CNVT_TOHW(green, info->var.green.length); in mc68x328fb_setcolreg()
318 blue = CNVT_TOHW(blue, info->var.blue.length); in mc68x328fb_setcolreg()
319 transp = CNVT_TOHW(transp, info->var.transp.length); in mc68x328fb_setcolreg()
337 v = (red << info->var.red.offset) | in mc68x328fb_setcolreg()
338 (green << info->var.green.offset) | in mc68x328fb_setcolreg()
339 (blue << info->var.blue.offset) | in mc68x328fb_setcolreg()
340 (transp << info->var.transp.offset); in mc68x328fb_setcolreg()
341 switch (info->var.bits_per_pixel) { in mc68x328fb_setcolreg()
363 static int mc68x328fb_pan_display(struct fb_var_screeninfo *var, in mc68x328fb_pan_display() argument
366 if (var->vmode & FB_VMODE_YWRAP) { in mc68x328fb_pan_display()
367 if (var->yoffset < 0 in mc68x328fb_pan_display()
368 || var->yoffset >= info->var.yres_virtual in mc68x328fb_pan_display()
369 || var->xoffset) in mc68x328fb_pan_display()
372 if (var->xoffset + info->var.xres > info->var.xres_virtual || in mc68x328fb_pan_display()
373 var->yoffset + info->var.yres > info->var.yres_virtual) in mc68x328fb_pan_display()
376 info->var.xoffset = var->xoffset; in mc68x328fb_pan_display()
377 info->var.yoffset = var->yoffset; in mc68x328fb_pan_display()
378 if (var->vmode & FB_VMODE_YWRAP) in mc68x328fb_pan_display()
379 info->var.vmode |= FB_VMODE_YWRAP; in mc68x328fb_pan_display()
381 info->var.vmode &= ~FB_VMODE_YWRAP; in mc68x328fb_pan_display()
437 fb_info.var = mc68x328fb_default; in mc68x328fb_init()
445 if (fb_info.var.bits_per_pixel == 1) { in mc68x328fb_init()
446 fb_info.var.red.length = fb_info.var.green.length = fb_info.var.blue.length = 1; in mc68x328fb_init()
447 fb_info.var.red.offset = fb_info.var.green.offset = fb_info.var.blue.offset = 0; in mc68x328fb_init()