Lines Matching full:var

71 static int vfb_check_var(struct fb_var_screeninfo *var,
76 static int vfb_pan_display(struct fb_var_screeninfo *var,
109 * to hardware, it should only verify and adjust var.
111 * data from it to check this var.
114 static int vfb_check_var(struct fb_var_screeninfo *var, in vfb_check_var() argument
124 if (var->vmode & FB_VMODE_CONUPDATE) { in vfb_check_var()
125 var->vmode |= FB_VMODE_YWRAP; in vfb_check_var()
126 var->xoffset = info->var.xoffset; in vfb_check_var()
127 var->yoffset = info->var.yoffset; in vfb_check_var()
133 if (!var->xres) in vfb_check_var()
134 var->xres = 1; in vfb_check_var()
135 if (!var->yres) in vfb_check_var()
136 var->yres = 1; in vfb_check_var()
137 if (var->xres > var->xres_virtual) in vfb_check_var()
138 var->xres_virtual = var->xres; in vfb_check_var()
139 if (var->yres > var->yres_virtual) in vfb_check_var()
140 var->yres_virtual = var->yres; in vfb_check_var()
141 if (var->bits_per_pixel <= 1) in vfb_check_var()
142 var->bits_per_pixel = 1; in vfb_check_var()
143 else if (var->bits_per_pixel <= 8) in vfb_check_var()
144 var->bits_per_pixel = 8; in vfb_check_var()
145 else if (var->bits_per_pixel <= 16) in vfb_check_var()
146 var->bits_per_pixel = 16; in vfb_check_var()
147 else if (var->bits_per_pixel <= 24) in vfb_check_var()
148 var->bits_per_pixel = 24; in vfb_check_var()
149 else if (var->bits_per_pixel <= 32) in vfb_check_var()
150 var->bits_per_pixel = 32; in vfb_check_var()
154 if (var->xres_virtual < var->xoffset + var->xres) in vfb_check_var()
155 var->xres_virtual = var->xoffset + var->xres; in vfb_check_var()
156 if (var->yres_virtual < var->yoffset + var->yres) in vfb_check_var()
157 var->yres_virtual = var->yoffset + var->yres; in vfb_check_var()
163 get_line_length(var->xres_virtual, var->bits_per_pixel); in vfb_check_var()
164 if (line_length * var->yres_virtual > videomemorysize) in vfb_check_var()
168 * Now that we checked it we alter var. The reason being is that the video in vfb_check_var()
172 switch (var->bits_per_pixel) { in vfb_check_var()
175 var->red.offset = 0; in vfb_check_var()
176 var->red.length = 8; in vfb_check_var()
177 var->green.offset = 0; in vfb_check_var()
178 var->green.length = 8; in vfb_check_var()
179 var->blue.offset = 0; in vfb_check_var()
180 var->blue.length = 8; in vfb_check_var()
181 var->transp.offset = 0; in vfb_check_var()
182 var->transp.length = 0; in vfb_check_var()
185 if (var->transp.length) { in vfb_check_var()
186 var->red.offset = 0; in vfb_check_var()
187 var->red.length = 5; in vfb_check_var()
188 var->green.offset = 5; in vfb_check_var()
189 var->green.length = 5; in vfb_check_var()
190 var->blue.offset = 10; in vfb_check_var()
191 var->blue.length = 5; in vfb_check_var()
192 var->transp.offset = 15; in vfb_check_var()
193 var->transp.length = 1; in vfb_check_var()
195 var->red.offset = 0; in vfb_check_var()
196 var->red.length = 5; in vfb_check_var()
197 var->green.offset = 5; in vfb_check_var()
198 var->green.length = 6; in vfb_check_var()
199 var->blue.offset = 11; in vfb_check_var()
200 var->blue.length = 5; in vfb_check_var()
201 var->transp.offset = 0; in vfb_check_var()
202 var->transp.length = 0; in vfb_check_var()
206 var->red.offset = 0; in vfb_check_var()
207 var->red.length = 8; in vfb_check_var()
208 var->green.offset = 8; in vfb_check_var()
209 var->green.length = 8; in vfb_check_var()
210 var->blue.offset = 16; in vfb_check_var()
211 var->blue.length = 8; in vfb_check_var()
212 var->transp.offset = 0; in vfb_check_var()
213 var->transp.length = 0; in vfb_check_var()
216 var->red.offset = 0; in vfb_check_var()
217 var->red.length = 8; in vfb_check_var()
218 var->green.offset = 8; in vfb_check_var()
219 var->green.length = 8; in vfb_check_var()
220 var->blue.offset = 16; in vfb_check_var()
221 var->blue.length = 8; in vfb_check_var()
222 var->transp.offset = 24; in vfb_check_var()
223 var->transp.length = 8; in vfb_check_var()
226 var->red.msb_right = 0; in vfb_check_var()
227 var->green.msb_right = 0; in vfb_check_var()
228 var->blue.msb_right = 0; in vfb_check_var()
229 var->transp.msb_right = 0; in vfb_check_var()
240 switch (info->var.bits_per_pixel) { in vfb_set_par()
254 info->fix.line_length = get_line_length(info->var.xres_virtual, in vfb_set_par()
255 info->var.bits_per_pixel); in vfb_set_par()
263 * entries in the var structure). Return != 0 for invalid regno.
276 if (info->var.grayscale) { in vfb_setcolreg()
283 * var->{color}.offset contains start of bitfield in vfb_setcolreg()
284 * var->{color}.length contains length of bitfield in vfb_setcolreg()
290 * var->{color}.offset is 0 unless the palette index takes less than in vfb_setcolreg()
293 * var->{color}.length is set so that 1 << length is the number of available in vfb_setcolreg()
300 * var->{color}.offset contains start of bitfield in vfb_setcolreg()
301 * var->{color}.length contains length of bitfield in vfb_setcolreg()
310 red = CNVT_TOHW(red, info->var.red.length); in vfb_setcolreg()
311 green = CNVT_TOHW(green, info->var.green.length); in vfb_setcolreg()
312 blue = CNVT_TOHW(blue, info->var.blue.length); in vfb_setcolreg()
313 transp = CNVT_TOHW(transp, info->var.transp.length); in vfb_setcolreg()
331 v = (red << info->var.red.offset) | in vfb_setcolreg()
332 (green << info->var.green.offset) | in vfb_setcolreg()
333 (blue << info->var.blue.offset) | in vfb_setcolreg()
334 (transp << info->var.transp.offset); in vfb_setcolreg()
335 switch (info->var.bits_per_pixel) { in vfb_setcolreg()
357 static int vfb_pan_display(struct fb_var_screeninfo *var, in vfb_pan_display() argument
360 if (var->vmode & FB_VMODE_YWRAP) { in vfb_pan_display()
361 if (var->yoffset >= info->var.yres_virtual || in vfb_pan_display()
362 var->xoffset) in vfb_pan_display()
365 if (var->xoffset + info->var.xres > info->var.xres_virtual || in vfb_pan_display()
366 var->yoffset + info->var.yres > info->var.yres_virtual) in vfb_pan_display()
369 info->var.xoffset = var->xoffset; in vfb_pan_display()
370 info->var.yoffset = var->yoffset; in vfb_pan_display()
371 if (var->vmode & FB_VMODE_YWRAP) in vfb_pan_display()
372 info->var.vmode |= FB_VMODE_YWRAP; in vfb_pan_display()
374 info->var.vmode &= ~FB_VMODE_YWRAP; in vfb_pan_display()
446 if (!fb_find_mode(&info->var, info, mode_option, in vfb_probe()