Lines Matching full:var

36 static inline int h_total(struct fb_var_screeninfo *var)  in h_total()  argument
38 return var->xres + var->left_margin + in h_total()
39 var->right_margin + var->hsync_len; in h_total()
42 static inline int v_total(struct fb_var_screeninfo *var) in v_total() argument
44 return var->yres + var->upper_margin + in v_total()
45 var->lower_margin + var->vsync_len; in v_total()
48 static inline int hsp(struct fb_var_screeninfo *var) in hsp() argument
50 return var->xres + var->right_margin - 1; in hsp()
53 static inline int vsp(struct fb_var_screeninfo *var) in vsp() argument
55 return var->yres + var->lower_margin - 1; in vsp()
58 static inline int d_pitch(struct fb_var_screeninfo *var) in d_pitch() argument
60 return var->xres * var->bits_per_pixel / 8; in d_pitch()
81 val = chan_to_field(red, &info->var.red); in mb862xxfb_setcolreg()
82 val |= chan_to_field(green, &info->var.green); in mb862xxfb_setcolreg()
83 val |= chan_to_field(blue, &info->var.blue); in mb862xxfb_setcolreg()
101 static int mb862xxfb_check_var(struct fb_var_screeninfo *var, in mb862xxfb_check_var() argument
109 if (var->hsync_len > 255 || var->vsync_len > 255) in mb862xxfb_check_var()
112 if ((var->xres + var->right_margin) >= 4096) in mb862xxfb_check_var()
115 if ((var->yres + var->lower_margin) > 4096) in mb862xxfb_check_var()
118 if (h_total(var) > 4096 || v_total(var) > 4096) in mb862xxfb_check_var()
121 if (var->xres_virtual > 4096 || var->yres_virtual > 4096) in mb862xxfb_check_var()
124 if (var->bits_per_pixel <= 8) in mb862xxfb_check_var()
125 var->bits_per_pixel = 8; in mb862xxfb_check_var()
126 else if (var->bits_per_pixel <= 16) in mb862xxfb_check_var()
127 var->bits_per_pixel = 16; in mb862xxfb_check_var()
128 else if (var->bits_per_pixel <= 32) in mb862xxfb_check_var()
129 var->bits_per_pixel = 32; in mb862xxfb_check_var()
135 if (d_pitch(&fbi->var) % GC_L0M_L0W_UNIT) { in mb862xxfb_check_var()
138 var->bits_per_pixel = 0; in mb862xxfb_check_var()
140 var->bits_per_pixel += 8; in mb862xxfb_check_var()
141 r = d_pitch(&fbi->var) % GC_L0M_L0W_UNIT; in mb862xxfb_check_var()
142 } while (r && var->bits_per_pixel <= 32); in mb862xxfb_check_var()
144 if (d_pitch(&fbi->var) % GC_L0M_L0W_UNIT) in mb862xxfb_check_var()
149 tmp = (var->xres * var->bits_per_pixel) / 8; in mb862xxfb_check_var()
154 switch (var->bits_per_pixel) { in mb862xxfb_check_var()
156 var->red.length = var->bits_per_pixel; in mb862xxfb_check_var()
157 var->green.length = var->bits_per_pixel; in mb862xxfb_check_var()
158 var->blue.length = var->bits_per_pixel; in mb862xxfb_check_var()
159 var->red.offset = 0; in mb862xxfb_check_var()
160 var->green.offset = 0; in mb862xxfb_check_var()
161 var->blue.offset = 0; in mb862xxfb_check_var()
162 var->transp.length = 0; in mb862xxfb_check_var()
165 var->red.length = 5; in mb862xxfb_check_var()
166 var->green.length = 5; in mb862xxfb_check_var()
167 var->blue.length = 5; in mb862xxfb_check_var()
168 var->red.offset = 10; in mb862xxfb_check_var()
169 var->green.offset = 5; in mb862xxfb_check_var()
170 var->blue.offset = 0; in mb862xxfb_check_var()
171 var->transp.length = 0; in mb862xxfb_check_var()
175 var->transp.length = 8; in mb862xxfb_check_var()
176 var->red.length = 8; in mb862xxfb_check_var()
177 var->green.length = 8; in mb862xxfb_check_var()
178 var->blue.length = 8; in mb862xxfb_check_var()
179 var->transp.offset = 24; in mb862xxfb_check_var()
180 var->red.offset = 16; in mb862xxfb_check_var()
181 var->green.offset = 8; in mb862xxfb_check_var()
182 var->blue.offset = 0; in mb862xxfb_check_var()
202 mb862xxfb_init_accel(fbi, &mb862xxfb_ops, fbi->var.xres); in mb862xxfb_set_par()
213 sc = par->refclk / (1000000 / fbi->var.pixclock) - 1; in mb862xxfb_set_par()
221 reg = pack(d_pitch(&fbi->var) / GC_L0M_L0W_UNIT, in mb862xxfb_set_par()
222 (fbi->var.yres - 1)); in mb862xxfb_set_par()
223 if (fbi->var.bits_per_pixel == 16) in mb862xxfb_set_par()
227 if (fbi->var.bits_per_pixel == 32) { in mb862xxfb_set_par()
232 reg = pack(fbi->var.yres - 1, fbi->var.xres); in mb862xxfb_set_par()
246 reg = pack(fbi->var.xres - 1, fbi->var.xres - 1); in mb862xxfb_set_par()
248 reg = pack((fbi->var.yres - 1), vsp(&fbi->var)); in mb862xxfb_set_par()
250 reg = ((fbi->var.vsync_len - 1) << 24) | in mb862xxfb_set_par()
251 pack((fbi->var.hsync_len - 1), hsp(&fbi->var)); in mb862xxfb_set_par()
253 outreg(disp, GC_HTP, pack(h_total(&fbi->var) - 1, 0)); in mb862xxfb_set_par()
254 outreg(disp, GC_VTR, pack(v_total(&fbi->var) - 1, 0)); in mb862xxfb_set_par()
264 static int mb862xxfb_pan(struct fb_var_screeninfo *var, in mb862xxfb_pan() argument
270 reg = pack(var->yoffset, var->xoffset); in mb862xxfb_pan()
273 reg = pack(info->var.yres_virtual, info->var.xres_virtual); in mb862xxfb_pan()
441 fbi->var.pixclock = (sc * 1000000) / par->refclk; in mb862xxfb_init_fbinfo()
442 fbi->var.xres = (inreg(disp, GC_HDB_HDP) & 0x0fff) + 1; in mb862xxfb_init_fbinfo()
444 fbi->var.yres = ((reg >> 16) & 0x0fff) + 1; in mb862xxfb_init_fbinfo()
446 fbi->var.xres_virtual = fbi->var.xres; in mb862xxfb_init_fbinfo()
447 fbi->var.yres_virtual = fbi->var.yres; in mb862xxfb_init_fbinfo()
450 fbi->var.bits_per_pixel = 32; in mb862xxfb_init_fbinfo()
454 fbi->var.bits_per_pixel = 16; in mb862xxfb_init_fbinfo()
456 fbi->var.bits_per_pixel = 8; in mb862xxfb_init_fbinfo()
459 fbi->var.hsync_len = ((reg & 0xff0000) >> 16) + 1; in mb862xxfb_init_fbinfo()
460 fbi->var.vsync_len = ((reg & 0x3f000000) >> 24) + 1; in mb862xxfb_init_fbinfo()
463 fbi->var.right_margin = hsp - fbi->var.xres; in mb862xxfb_init_fbinfo()
464 fbi->var.left_margin = ht - hsp - fbi->var.hsync_len; in mb862xxfb_init_fbinfo()
466 fbi->var.lower_margin = vsp - fbi->var.yres; in mb862xxfb_init_fbinfo()
467 fbi->var.upper_margin = vt - vsp - fbi->var.vsync_len; in mb862xxfb_init_fbinfo()
470 fb_videomode_to_var(&fbi->var, (struct fb_videomode *)mode); in mb862xxfb_init_fbinfo()
471 fbi->var.bits_per_pixel = mode->def_bpp ? mode->def_bpp : 8; in mb862xxfb_init_fbinfo()
475 ret = fb_find_mode(&fbi->var, fbi, "640x480-16@60", in mb862xxfb_init_fbinfo()
484 fbi->var.xoffset = 0; in mb862xxfb_init_fbinfo()
485 fbi->var.yoffset = 0; in mb862xxfb_init_fbinfo()
486 fbi->var.grayscale = 0; in mb862xxfb_init_fbinfo()
487 fbi->var.nonstd = 0; in mb862xxfb_init_fbinfo()
488 fbi->var.height = -1; in mb862xxfb_init_fbinfo()
489 fbi->var.width = -1; in mb862xxfb_init_fbinfo()
490 fbi->var.accel_flags = 0; in mb862xxfb_init_fbinfo()
491 fbi->var.vmode = FB_VMODE_NONINTERLACED; in mb862xxfb_init_fbinfo()
492 fbi->var.activate = FB_ACTIVATE_NOW; in mb862xxfb_init_fbinfo()
501 if ((fbi->fbops->fb_check_var)(&fbi->var, fbi)) in mb862xxfb_init_fbinfo()
504 fbi->fix.visual = fbi->var.bits_per_pixel == 8 ? in mb862xxfb_init_fbinfo()
506 fbi->fix.line_length = (fbi->var.xres_virtual * in mb862xxfb_init_fbinfo()
507 fbi->var.bits_per_pixel) / 8; in mb862xxfb_init_fbinfo()
508 fbi->fix.smem_len = fbi->fix.line_length * fbi->var.yres_virtual; in mb862xxfb_init_fbinfo()
524 stride = par->l1_cfg.sw * (fbi->var.bits_per_pixel / 8); in mb862xxfb_init_fbinfo()