Lines Matching full:var
42 static inline int h_total(struct fb_var_screeninfo *var) in h_total() argument
44 return var->xres + var->left_margin + in h_total()
45 var->right_margin + var->hsync_len; in h_total()
48 static inline int v_total(struct fb_var_screeninfo *var) in v_total() argument
50 return var->yres + var->upper_margin + in v_total()
51 var->lower_margin + var->vsync_len; in v_total()
54 static inline int hsp(struct fb_var_screeninfo *var) in hsp() argument
56 return var->xres + var->right_margin - 1; in hsp()
59 static inline int vsp(struct fb_var_screeninfo *var) in vsp() argument
61 return var->yres + var->lower_margin - 1; in vsp()
64 static inline int d_pitch(struct fb_var_screeninfo *var) in d_pitch() argument
66 return var->xres * var->bits_per_pixel / 8; in d_pitch()
87 val = chan_to_field(red, &info->var.red); in mb862xxfb_setcolreg()
88 val |= chan_to_field(green, &info->var.green); in mb862xxfb_setcolreg()
89 val |= chan_to_field(blue, &info->var.blue); in mb862xxfb_setcolreg()
107 static int mb862xxfb_check_var(struct fb_var_screeninfo *var, in mb862xxfb_check_var() argument
116 if (var->hsync_len > 255 || var->vsync_len > 255) in mb862xxfb_check_var()
119 if ((var->xres + var->right_margin) >= 4096) in mb862xxfb_check_var()
122 if ((var->yres + var->lower_margin) > 4096) in mb862xxfb_check_var()
125 if (h_total(var) > 4096 || v_total(var) > 4096) in mb862xxfb_check_var()
128 if (var->xres_virtual > 4096 || var->yres_virtual > 4096) in mb862xxfb_check_var()
131 if (var->bits_per_pixel <= 8) in mb862xxfb_check_var()
132 var->bits_per_pixel = 8; in mb862xxfb_check_var()
133 else if (var->bits_per_pixel <= 16) in mb862xxfb_check_var()
134 var->bits_per_pixel = 16; in mb862xxfb_check_var()
135 else if (var->bits_per_pixel <= 32) in mb862xxfb_check_var()
136 var->bits_per_pixel = 32; in mb862xxfb_check_var()
142 if (d_pitch(&fbi->var) % GC_L0M_L0W_UNIT) { in mb862xxfb_check_var()
145 var->bits_per_pixel = 0; in mb862xxfb_check_var()
147 var->bits_per_pixel += 8; in mb862xxfb_check_var()
148 r = d_pitch(&fbi->var) % GC_L0M_L0W_UNIT; in mb862xxfb_check_var()
149 } while (r && var->bits_per_pixel <= 32); in mb862xxfb_check_var()
151 if (d_pitch(&fbi->var) % GC_L0M_L0W_UNIT) in mb862xxfb_check_var()
156 tmp = (var->xres * var->bits_per_pixel) / 8; in mb862xxfb_check_var()
161 switch (var->bits_per_pixel) { in mb862xxfb_check_var()
163 var->red.length = var->bits_per_pixel; in mb862xxfb_check_var()
164 var->green.length = var->bits_per_pixel; in mb862xxfb_check_var()
165 var->blue.length = var->bits_per_pixel; in mb862xxfb_check_var()
166 var->red.offset = 0; in mb862xxfb_check_var()
167 var->green.offset = 0; in mb862xxfb_check_var()
168 var->blue.offset = 0; in mb862xxfb_check_var()
169 var->transp.length = 0; in mb862xxfb_check_var()
172 var->red.length = 5; in mb862xxfb_check_var()
173 var->green.length = 5; in mb862xxfb_check_var()
174 var->blue.length = 5; in mb862xxfb_check_var()
175 var->red.offset = 10; in mb862xxfb_check_var()
176 var->green.offset = 5; in mb862xxfb_check_var()
177 var->blue.offset = 0; in mb862xxfb_check_var()
178 var->transp.length = 0; in mb862xxfb_check_var()
182 var->transp.length = 8; in mb862xxfb_check_var()
183 var->red.length = 8; in mb862xxfb_check_var()
184 var->green.length = 8; in mb862xxfb_check_var()
185 var->blue.length = 8; in mb862xxfb_check_var()
186 var->transp.offset = 24; in mb862xxfb_check_var()
187 var->red.offset = 16; in mb862xxfb_check_var()
188 var->green.offset = 8; in mb862xxfb_check_var()
189 var->blue.offset = 0; in mb862xxfb_check_var()
209 mb862xxfb_init_accel(fbi, &mb862xxfb_ops, fbi->var.xres); in mb862xxfb_set_par()
220 sc = par->refclk / (1000000 / fbi->var.pixclock) - 1; in mb862xxfb_set_par()
228 reg = pack(d_pitch(&fbi->var) / GC_L0M_L0W_UNIT, in mb862xxfb_set_par()
229 (fbi->var.yres - 1)); in mb862xxfb_set_par()
230 if (fbi->var.bits_per_pixel == 16) in mb862xxfb_set_par()
234 if (fbi->var.bits_per_pixel == 32) { in mb862xxfb_set_par()
239 reg = pack(fbi->var.yres - 1, fbi->var.xres); in mb862xxfb_set_par()
253 reg = pack(fbi->var.xres - 1, fbi->var.xres - 1); in mb862xxfb_set_par()
255 reg = pack((fbi->var.yres - 1), vsp(&fbi->var)); in mb862xxfb_set_par()
257 reg = ((fbi->var.vsync_len - 1) << 24) | in mb862xxfb_set_par()
258 pack((fbi->var.hsync_len - 1), hsp(&fbi->var)); in mb862xxfb_set_par()
260 outreg(disp, GC_HTP, pack(h_total(&fbi->var) - 1, 0)); in mb862xxfb_set_par()
261 outreg(disp, GC_VTR, pack(v_total(&fbi->var) - 1, 0)); in mb862xxfb_set_par()
271 static int mb862xxfb_pan(struct fb_var_screeninfo *var, in mb862xxfb_pan() argument
277 reg = pack(var->yoffset, var->xoffset); in mb862xxfb_pan()
280 reg = pack(info->var.yres_virtual, info->var.xres_virtual); in mb862xxfb_pan()
450 fbi->var.pixclock = (sc * 1000000) / par->refclk; in mb862xxfb_init_fbinfo()
451 fbi->var.xres = (inreg(disp, GC_HDB_HDP) & 0x0fff) + 1; in mb862xxfb_init_fbinfo()
453 fbi->var.yres = ((reg >> 16) & 0x0fff) + 1; in mb862xxfb_init_fbinfo()
455 fbi->var.xres_virtual = fbi->var.xres; in mb862xxfb_init_fbinfo()
456 fbi->var.yres_virtual = fbi->var.yres; in mb862xxfb_init_fbinfo()
459 fbi->var.bits_per_pixel = 32; in mb862xxfb_init_fbinfo()
463 fbi->var.bits_per_pixel = 16; in mb862xxfb_init_fbinfo()
465 fbi->var.bits_per_pixel = 8; in mb862xxfb_init_fbinfo()
468 fbi->var.hsync_len = ((reg & 0xff0000) >> 16) + 1; in mb862xxfb_init_fbinfo()
469 fbi->var.vsync_len = ((reg & 0x3f000000) >> 24) + 1; in mb862xxfb_init_fbinfo()
472 fbi->var.right_margin = hsp - fbi->var.xres; in mb862xxfb_init_fbinfo()
473 fbi->var.left_margin = ht - hsp - fbi->var.hsync_len; in mb862xxfb_init_fbinfo()
475 fbi->var.lower_margin = vsp - fbi->var.yres; in mb862xxfb_init_fbinfo()
476 fbi->var.upper_margin = vt - vsp - fbi->var.vsync_len; in mb862xxfb_init_fbinfo()
479 fb_videomode_to_var(&fbi->var, (struct fb_videomode *)mode); in mb862xxfb_init_fbinfo()
480 fbi->var.bits_per_pixel = mode->def_bpp ? mode->def_bpp : 8; in mb862xxfb_init_fbinfo()
484 ret = fb_find_mode(&fbi->var, fbi, "640x480-16@60", in mb862xxfb_init_fbinfo()
493 fbi->var.xoffset = 0; in mb862xxfb_init_fbinfo()
494 fbi->var.yoffset = 0; in mb862xxfb_init_fbinfo()
495 fbi->var.grayscale = 0; in mb862xxfb_init_fbinfo()
496 fbi->var.nonstd = 0; in mb862xxfb_init_fbinfo()
497 fbi->var.height = -1; in mb862xxfb_init_fbinfo()
498 fbi->var.width = -1; in mb862xxfb_init_fbinfo()
499 fbi->var.accel_flags = 0; in mb862xxfb_init_fbinfo()
500 fbi->var.vmode = FB_VMODE_NONINTERLACED; in mb862xxfb_init_fbinfo()
501 fbi->var.activate = FB_ACTIVATE_NOW; in mb862xxfb_init_fbinfo()
510 if ((fbi->fbops->fb_check_var)(&fbi->var, fbi)) in mb862xxfb_init_fbinfo()
513 fbi->fix.visual = fbi->var.bits_per_pixel == 8 ? in mb862xxfb_init_fbinfo()
515 fbi->fix.line_length = (fbi->var.xres_virtual * in mb862xxfb_init_fbinfo()
516 fbi->var.bits_per_pixel) / 8; in mb862xxfb_init_fbinfo()
517 fbi->fix.smem_len = fbi->fix.line_length * fbi->var.yres_virtual; in mb862xxfb_init_fbinfo()
533 stride = par->l1_cfg.sw * (fbi->var.bits_per_pixel / 8); in mb862xxfb_init_fbinfo()