• Home
  • Raw
  • Download

Lines Matching refs:var

37 static int determine_best_pix_fmt(struct fb_var_screeninfo *var)  in determine_best_pix_fmt()  argument
42 if (var->bits_per_pixel == 8) in determine_best_pix_fmt()
48 if (var->bits_per_pixel == 16 && var->red.length <= 5 && in determine_best_pix_fmt()
49 var->green.length <= 6 && var->blue.length <= 5) { in determine_best_pix_fmt()
50 if (var->transp.length == 0) { in determine_best_pix_fmt()
51 if (var->red.offset >= var->blue.offset) in determine_best_pix_fmt()
57 if (var->transp.length == 1 && var->green.length <= 5) { in determine_best_pix_fmt()
58 if (var->red.offset >= var->blue.offset) in determine_best_pix_fmt()
70 if (var->bits_per_pixel <= 32 && var->red.length <= 8 && in determine_best_pix_fmt()
71 var->green.length <= 8 && var->blue.length <= 8) { in determine_best_pix_fmt()
72 if (var->bits_per_pixel == 24 && var->transp.length == 0) { in determine_best_pix_fmt()
73 if (var->red.offset >= var->blue.offset) in determine_best_pix_fmt()
79 if (var->bits_per_pixel == 32 && var->transp.length == 8) { in determine_best_pix_fmt()
80 if (var->red.offset >= var->blue.offset) in determine_best_pix_fmt()
85 if (var->red.offset >= var->blue.offset) in determine_best_pix_fmt()
97 static void set_pix_fmt(struct fb_var_screeninfo *var, int pix_fmt) in set_pix_fmt() argument
101 var->bits_per_pixel = 16; in set_pix_fmt()
102 var->red.offset = 11; var->red.length = 5; in set_pix_fmt()
103 var->green.offset = 5; var->green.length = 6; in set_pix_fmt()
104 var->blue.offset = 0; var->blue.length = 5; in set_pix_fmt()
105 var->transp.offset = 0; var->transp.length = 0; in set_pix_fmt()
108 var->bits_per_pixel = 16; in set_pix_fmt()
109 var->red.offset = 0; var->red.length = 5; in set_pix_fmt()
110 var->green.offset = 5; var->green.length = 6; in set_pix_fmt()
111 var->blue.offset = 11; var->blue.length = 5; in set_pix_fmt()
112 var->transp.offset = 0; var->transp.length = 0; in set_pix_fmt()
115 var->bits_per_pixel = 16; in set_pix_fmt()
116 var->red.offset = 10; var->red.length = 5; in set_pix_fmt()
117 var->green.offset = 5; var->green.length = 5; in set_pix_fmt()
118 var->blue.offset = 0; var->blue.length = 5; in set_pix_fmt()
119 var->transp.offset = 15; var->transp.length = 1; in set_pix_fmt()
122 var->bits_per_pixel = 16; in set_pix_fmt()
123 var->red.offset = 0; var->red.length = 5; in set_pix_fmt()
124 var->green.offset = 5; var->green.length = 5; in set_pix_fmt()
125 var->blue.offset = 10; var->blue.length = 5; in set_pix_fmt()
126 var->transp.offset = 15; var->transp.length = 1; in set_pix_fmt()
129 var->bits_per_pixel = 24; in set_pix_fmt()
130 var->red.offset = 16; var->red.length = 8; in set_pix_fmt()
131 var->green.offset = 8; var->green.length = 8; in set_pix_fmt()
132 var->blue.offset = 0; var->blue.length = 8; in set_pix_fmt()
133 var->transp.offset = 0; var->transp.length = 0; in set_pix_fmt()
136 var->bits_per_pixel = 24; in set_pix_fmt()
137 var->red.offset = 0; var->red.length = 8; in set_pix_fmt()
138 var->green.offset = 8; var->green.length = 8; in set_pix_fmt()
139 var->blue.offset = 16; var->blue.length = 8; in set_pix_fmt()
140 var->transp.offset = 0; var->transp.length = 0; in set_pix_fmt()
143 var->bits_per_pixel = 32; in set_pix_fmt()
144 var->red.offset = 16; var->red.length = 8; in set_pix_fmt()
145 var->green.offset = 8; var->green.length = 8; in set_pix_fmt()
146 var->blue.offset = 0; var->blue.length = 8; in set_pix_fmt()
147 var->transp.offset = 24; var->transp.length = 8; in set_pix_fmt()
150 var->bits_per_pixel = 32; in set_pix_fmt()
151 var->red.offset = 0; var->red.length = 8; in set_pix_fmt()
152 var->green.offset = 8; var->green.length = 8; in set_pix_fmt()
153 var->blue.offset = 16; var->blue.length = 8; in set_pix_fmt()
154 var->transp.offset = 24; var->transp.length = 8; in set_pix_fmt()
157 var->bits_per_pixel = 8; in set_pix_fmt()
158 var->red.offset = 0; var->red.length = 8; in set_pix_fmt()
159 var->green.offset = 0; var->green.length = 8; in set_pix_fmt()
160 var->blue.offset = 0; var->blue.length = 8; in set_pix_fmt()
161 var->transp.offset = 0; var->transp.length = 0; in set_pix_fmt()
166 static void set_mode(struct pxa168fb_info *fbi, struct fb_var_screeninfo *var, in set_mode() argument
171 set_pix_fmt(var, pix_fmt); in set_mode()
173 var->xres = mode->xres; in set_mode()
174 var->yres = mode->yres; in set_mode()
175 var->xres_virtual = max(var->xres, var->xres_virtual); in set_mode()
177 var->yres_virtual = info->fix.smem_len / in set_mode()
178 (var->xres_virtual * (var->bits_per_pixel >> 3)); in set_mode()
180 var->yres_virtual = max(var->yres, var->yres_virtual); in set_mode()
181 var->grayscale = 0; in set_mode()
182 var->accel_flags = FB_ACCEL_NONE; in set_mode()
183 var->pixclock = mode->pixclock; in set_mode()
184 var->left_margin = mode->left_margin; in set_mode()
185 var->right_margin = mode->right_margin; in set_mode()
186 var->upper_margin = mode->upper_margin; in set_mode()
187 var->lower_margin = mode->lower_margin; in set_mode()
188 var->hsync_len = mode->hsync_len; in set_mode()
189 var->vsync_len = mode->vsync_len; in set_mode()
190 var->sync = mode->sync; in set_mode()
191 var->vmode = FB_VMODE_NONINTERLACED; in set_mode()
192 var->rotate = FB_ROTATE_UR; in set_mode()
195 static int pxa168fb_check_var(struct fb_var_screeninfo *var, in pxa168fb_check_var() argument
204 pix_fmt = determine_best_pix_fmt(var); in pxa168fb_check_var()
207 set_pix_fmt(var, pix_fmt); in pxa168fb_check_var()
213 if (var->xoffset + var->xres > var->xres_virtual) in pxa168fb_check_var()
215 if (var->yoffset + var->yres > var->yres_virtual) in pxa168fb_check_var()
217 if (var->xres + var->right_margin + in pxa168fb_check_var()
218 var->hsync_len + var->left_margin > 2048) in pxa168fb_check_var()
220 if (var->yres + var->lower_margin + in pxa168fb_check_var()
221 var->vsync_len + var->upper_margin > 2048) in pxa168fb_check_var()
227 if (var->xres_virtual * var->yres_virtual * in pxa168fb_check_var()
228 (var->bits_per_pixel >> 3) > info->fix.smem_len) in pxa168fb_check_var()
354 struct fb_var_screeninfo *var = &info->var; in set_graphics_start() local
358 pixel_offset = (yoffset * var->xres_virtual) + xoffset; in set_graphics_start()
360 addr = fbi->fb_start_dma + (pixel_offset * (var->bits_per_pixel >> 3)); in set_graphics_start()
380 x |= (info->var.sync & FB_SYNC_COMP_HIGH_ACT) ? 0x00000020 : 0; in set_dumb_panel_control()
382 x |= (info->var.sync & FB_SYNC_VERT_HIGH_ACT) ? 0 : 0x00000008; in set_dumb_panel_control()
383 x |= (info->var.sync & FB_SYNC_HOR_HIGH_ACT) ? 0 : 0x00000004; in set_dumb_panel_control()
392 struct fb_var_screeninfo *v = &info->var; in set_dumb_screen_dimensions()
405 struct fb_var_screeninfo *var = &info->var; in pxa168fb_set_par() local
419 info->fix.line_length = var->xres_virtual * var->bits_per_pixel / 8; in pxa168fb_set_par()
420 info->fix.ypanstep = var->yres; in pxa168fb_set_par()
431 writel((var->yres << 16) | var->xres, in pxa168fb_set_par()
437 fb_var_to_videomode(&mode, &info->var); in pxa168fb_set_par()
444 set_dma_control1(fbi, info->var.sync); in pxa168fb_set_par()
450 x = (x & ~0xFFFF) | ((var->xres_virtual * var->bits_per_pixel) >> 3); in pxa168fb_set_par()
452 writel((var->yres << 16) | var->xres, in pxa168fb_set_par()
454 writel((var->yres << 16) | var->xres, in pxa168fb_set_par()
463 writel((var->left_margin << 16) | var->right_margin, in pxa168fb_set_par()
465 writel((var->upper_margin << 16) | var->lower_margin, in pxa168fb_set_par()
498 if (info->var.grayscale) in pxa168fb_setcolreg()
503 val = chan_to_field(red, &info->var.red); in pxa168fb_setcolreg()
504 val |= chan_to_field(green, &info->var.green); in pxa168fb_setcolreg()
505 val |= chan_to_field(blue , &info->var.blue); in pxa168fb_setcolreg()
528 static int pxa168fb_pan_display(struct fb_var_screeninfo *var, in pxa168fb_pan_display() argument
531 set_graphics_start(info, var->xoffset, var->yoffset); in pxa168fb_pan_display()
567 struct fb_var_screeninfo *var = &info->var; in pxa168fb_init_mode() local
579 m = fb_find_best_mode(&info->var, &info->modelist); in pxa168fb_init_mode()
581 fb_videomode_to_var(&info->var, m); in pxa168fb_init_mode()
584 var->xres_virtual = var->xres; in pxa168fb_init_mode()
585 var->yres_virtual = info->fix.smem_len / in pxa168fb_init_mode()
586 (var->xres_virtual * (var->bits_per_pixel >> 3)); in pxa168fb_init_mode()
588 var->xres, var->yres); in pxa168fb_init_mode()
591 total_w = var->xres + var->left_margin + var->right_margin + in pxa168fb_init_mode()
592 var->hsync_len; in pxa168fb_init_mode()
593 total_h = var->yres + var->upper_margin + var->lower_margin + in pxa168fb_init_mode()
594 var->vsync_len; in pxa168fb_init_mode()
598 var->pixclock = (u32)div_result; in pxa168fb_init_mode()
699 set_mode(fbi, &info->var, mi->modes, mi->pix_fmt, 1); in pxa168fb_probe()
711 ret = pxa168fb_check_var(&info->var, info); in pxa168fb_probe()