• Home
  • Raw
  • Download

Lines Matching refs:var

67 	struct fb_var_screeninfo *var = &fbi->var;  in draw_pixel()  local
70 const unsigned bytespp = var->bits_per_pixel >> 3; in draw_pixel()
77 if (var->bits_per_pixel == 16) { in draw_pixel()
86 } else if (var->bits_per_pixel == 24) { in draw_pixel()
93 } else if (var->bits_per_pixel == 32) { in draw_pixel()
102 struct fb_var_screeninfo *var = &fbi->var; in fill_fb() local
103 const short w = var->xres_virtual; in fill_fb()
104 const short h = var->yres_virtual; in fill_fb()
136 if (var->bits_per_pixel == 16) { in fill_fb()
276 static bool cmp_var_to_colormode(struct fb_var_screeninfo *var, in cmp_var_to_colormode() argument
286 if (var->bits_per_pixel == 0 || in cmp_var_to_colormode()
287 var->red.length == 0 || in cmp_var_to_colormode()
288 var->blue.length == 0 || in cmp_var_to_colormode()
289 var->green.length == 0) in cmp_var_to_colormode()
292 return var->bits_per_pixel == color->bits_per_pixel && in cmp_var_to_colormode()
293 cmp_component(&var->red, &color->red) && in cmp_var_to_colormode()
294 cmp_component(&var->green, &color->green) && in cmp_var_to_colormode()
295 cmp_component(&var->blue, &color->blue) && in cmp_var_to_colormode()
296 cmp_component(&var->transp, &color->transp); in cmp_var_to_colormode()
299 static void assign_colormode_to_var(struct fb_var_screeninfo *var, in assign_colormode_to_var() argument
302 var->bits_per_pixel = color->bits_per_pixel; in assign_colormode_to_var()
303 var->nonstd = color->nonstd; in assign_colormode_to_var()
304 var->red = color->red; in assign_colormode_to_var()
305 var->green = color->green; in assign_colormode_to_var()
306 var->blue = color->blue; in assign_colormode_to_var()
307 var->transp = color->transp; in assign_colormode_to_var()
310 static int fb_mode_to_dss_mode(struct fb_var_screeninfo *var, in fb_mode_to_dss_mode() argument
317 if (var->nonstd) { in fb_mode_to_dss_mode()
320 if (var->nonstd == m->nonstd) { in fb_mode_to_dss_mode()
321 assign_colormode_to_var(var, m); in fb_mode_to_dss_mode()
333 if (cmp_var_to_colormode(var, m)) { in fb_mode_to_dss_mode()
334 assign_colormode_to_var(var, m); in fb_mode_to_dss_mode()
342 switch (var->bits_per_pixel) { in fb_mode_to_dss_mode()
374 assign_colormode_to_var(var, m); in fb_mode_to_dss_mode()
383 static int check_fb_res_bounds(struct fb_var_screeninfo *var) in check_fb_res_bounds() argument
391 if (var->xres_virtual == 0) in check_fb_res_bounds()
392 var->xres_virtual = var->xres; in check_fb_res_bounds()
394 if (var->yres_virtual == 0) in check_fb_res_bounds()
395 var->yres_virtual = var->yres; in check_fb_res_bounds()
397 if (var->xres_virtual < xres_min || var->yres_virtual < yres_min) in check_fb_res_bounds()
400 if (var->xres < xres_min) in check_fb_res_bounds()
401 var->xres = xres_min; in check_fb_res_bounds()
402 if (var->yres < yres_min) in check_fb_res_bounds()
403 var->yres = yres_min; in check_fb_res_bounds()
404 if (var->xres > xres_max) in check_fb_res_bounds()
405 var->xres = xres_max; in check_fb_res_bounds()
406 if (var->yres > yres_max) in check_fb_res_bounds()
407 var->yres = yres_max; in check_fb_res_bounds()
409 if (var->xres > var->xres_virtual) in check_fb_res_bounds()
410 var->xres = var->xres_virtual; in check_fb_res_bounds()
411 if (var->yres > var->yres_virtual) in check_fb_res_bounds()
412 var->yres = var->yres_virtual; in check_fb_res_bounds()
418 struct fb_var_screeninfo *var) in shrink_height() argument
421 var->yres_virtual = max_frame_size / in shrink_height()
422 (var->xres_virtual * var->bits_per_pixel >> 3); in shrink_height()
424 if (var->yres_virtual < OMAPFB_PLANE_YRES_MIN) in shrink_height()
425 var->yres_virtual = OMAPFB_PLANE_YRES_MIN; in shrink_height()
427 if (var->yres > var->yres_virtual) in shrink_height()
428 var->yres = var->yres_virtual; in shrink_height()
432 struct fb_var_screeninfo *var) in shrink_width() argument
435 var->xres_virtual = max_frame_size / var->yres_virtual / in shrink_width()
436 (var->bits_per_pixel >> 3); in shrink_width()
438 if (var->xres_virtual < OMAPFB_PLANE_XRES_MIN) in shrink_width()
439 var->xres_virtual = OMAPFB_PLANE_XRES_MIN; in shrink_width()
441 if (var->xres > var->xres_virtual) in shrink_width()
442 var->xres = var->xres_virtual; in shrink_width()
446 const struct fb_var_screeninfo *var) in check_vrfb_fb_size() argument
448 unsigned long min_phys_size = omap_vrfb_min_phys_size(var->xres_virtual, in check_vrfb_fb_size()
449 var->yres_virtual, var->bits_per_pixel >> 3); in check_vrfb_fb_size()
455 struct fb_var_screeninfo *var) in check_fb_size() argument
458 int bytespp = var->bits_per_pixel >> 3; in check_fb_size()
459 unsigned long line_size = var->xres_virtual * bytespp; in check_fb_size()
463 if (check_vrfb_fb_size(max_frame_size, var)) in check_fb_size()
465 max_frame_size, var->xres_virtual, bytespp) * in check_fb_size()
466 line_size, var); in check_fb_size()
468 if (check_vrfb_fb_size(max_frame_size, var)) { in check_fb_size()
478 if (line_size * var->yres_virtual > max_frame_size) in check_fb_size()
479 shrink_height(max_frame_size, var); in check_fb_size()
481 if (line_size * var->yres_virtual > max_frame_size) { in check_fb_size()
482 shrink_width(max_frame_size, var); in check_fb_size()
483 line_size = var->xres_virtual * bytespp; in check_fb_size()
486 if (line_size * var->yres_virtual > max_frame_size) { in check_fb_size()
506 struct fb_var_screeninfo *var = &fbi->var; in setup_vrfb_rotation() local
519 r = fb_mode_to_dss_mode(var, &mode); in setup_vrfb_rotation()
523 bytespp = var->bits_per_pixel >> 3; in setup_vrfb_rotation()
538 else if (vrfb->xres != var->xres_virtual || in setup_vrfb_rotation()
539 vrfb->yres != var->yres_virtual) in setup_vrfb_rotation()
555 var->xres_virtual, in setup_vrfb_rotation()
556 var->yres_virtual, in setup_vrfb_rotation()
560 r = omap_vrfb_map_angle(vrfb, var->yres_virtual, 0); in setup_vrfb_rotation()
569 switch (var->nonstd) { in setup_vrfb_rotation()
573 (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 2; in setup_vrfb_rotation()
577 (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3; in setup_vrfb_rotation()
581 fix->smem_len = var->yres_virtual * fix->line_length; in setup_vrfb_rotation()
587 struct fb_var_screeninfo *var) in dss_mode_to_fb_mode() argument
594 assign_colormode_to_var(var, mode); in dss_mode_to_fb_mode()
604 struct fb_var_screeninfo *var = &fbi->var; in set_fb_fix() local
615 switch (var->nonstd) { in set_fb_fix()
619 (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 2; in set_fb_fix()
623 (OMAP_VRFB_LINE_LEN * var->bits_per_pixel) >> 3; in set_fb_fix()
627 fix->smem_len = var->yres_virtual * fix->line_length; in set_fb_fix()
630 (var->xres_virtual * var->bits_per_pixel) >> 3; in set_fb_fix()
638 if (var->nonstd) in set_fb_fix()
641 switch (var->bits_per_pixel) { in set_fb_fix()
665 int check_fb_var(struct fb_info *fbi, struct fb_var_screeninfo *var) in check_fb_var() argument
677 r = fb_mode_to_dss_mode(var, &mode); in check_fb_var()
690 if (var->rotate > 3) in check_fb_var()
693 if (check_fb_res_bounds(var)) in check_fb_var()
697 if (ofbi->region->size != 0 && check_fb_size(ofbi, var)) in check_fb_var()
700 if (var->xres + var->xoffset > var->xres_virtual) in check_fb_var()
701 var->xoffset = var->xres_virtual - var->xres; in check_fb_var()
702 if (var->yres + var->yoffset > var->yres_virtual) in check_fb_var()
703 var->yoffset = var->yres_virtual - var->yres; in check_fb_var()
706 var->xres, var->yres, in check_fb_var()
707 var->xres_virtual, var->yres_virtual); in check_fb_var()
712 var->width = DIV_ROUND_CLOSEST(w, 1000); in check_fb_var()
713 var->height = DIV_ROUND_CLOSEST(h, 1000); in check_fb_var()
715 var->height = -1; in check_fb_var()
716 var->width = -1; in check_fb_var()
719 var->grayscale = 0; in check_fb_var()
726 var->pixclock = timings.pixel_clock != 0 ? in check_fb_var()
729 var->left_margin = timings.hbp; in check_fb_var()
730 var->right_margin = timings.hfp; in check_fb_var()
731 var->upper_margin = timings.vbp; in check_fb_var()
732 var->lower_margin = timings.vfp; in check_fb_var()
733 var->hsync_len = timings.hsw; in check_fb_var()
734 var->vsync_len = timings.vsw; in check_fb_var()
735 var->sync |= timings.hsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? in check_fb_var()
737 var->sync |= timings.vsync_level == OMAPDSS_SIG_ACTIVE_HIGH ? in check_fb_var()
739 var->vmode = timings.interlace ? in check_fb_var()
742 var->pixclock = 0; in check_fb_var()
743 var->left_margin = 0; in check_fb_var()
744 var->right_margin = 0; in check_fb_var()
745 var->upper_margin = 0; in check_fb_var()
746 var->lower_margin = 0; in check_fb_var()
747 var->hsync_len = 0; in check_fb_var()
748 var->vsync_len = 0; in check_fb_var()
749 var->sync = 0; in check_fb_var()
750 var->vmode = FB_VMODE_NONINTERLACED; in check_fb_var()
771 static unsigned calc_rotation_offset_dma(const struct fb_var_screeninfo *var, in calc_rotation_offset_dma() argument
776 offset = var->yoffset * fix->line_length + in calc_rotation_offset_dma()
777 var->xoffset * (var->bits_per_pixel >> 3); in calc_rotation_offset_dma()
782 static unsigned calc_rotation_offset_vrfb(const struct fb_var_screeninfo *var, in calc_rotation_offset_vrfb() argument
788 offset = (var->yres_virtual - var->yres) * in calc_rotation_offset_vrfb()
791 offset = (var->yres_virtual - var->yres) * in calc_rotation_offset_vrfb()
792 (var->bits_per_pixel >> 3); in calc_rotation_offset_vrfb()
797 offset += var->yoffset * fix->line_length + in calc_rotation_offset_vrfb()
798 var->xoffset * (var->bits_per_pixel >> 3); in calc_rotation_offset_vrfb()
800 offset -= var->yoffset * fix->line_length + in calc_rotation_offset_vrfb()
801 var->xoffset * (var->bits_per_pixel >> 3); in calc_rotation_offset_vrfb()
803 offset -= var->xoffset * fix->line_length + in calc_rotation_offset_vrfb()
804 var->yoffset * (var->bits_per_pixel >> 3); in calc_rotation_offset_vrfb()
806 offset += var->xoffset * fix->line_length + in calc_rotation_offset_vrfb()
807 var->yoffset * (var->bits_per_pixel >> 3); in calc_rotation_offset_vrfb()
813 const struct fb_var_screeninfo *var, in omapfb_calc_addr() argument
826 offset = calc_rotation_offset_vrfb(var, fix, rotation); in omapfb_calc_addr()
828 offset = calc_rotation_offset_dma(var, fix, rotation); in omapfb_calc_addr()
834 var->xoffset, var->yoffset, offset); in omapfb_calc_addr()
847 struct fb_var_screeninfo *var = &fbi->var; in omapfb_setup_overlay() local
855 int rotation = var->rotate; in omapfb_setup_overlay()
872 xres = var->yres; in omapfb_setup_overlay()
873 yres = var->xres; in omapfb_setup_overlay()
875 xres = var->xres; in omapfb_setup_overlay()
876 yres = var->yres; in omapfb_setup_overlay()
880 omapfb_calc_addr(ofbi, var, fix, rotation, &data_start_p); in omapfb_setup_overlay()
882 r = fb_mode_to_dss_mode(var, &mode); in omapfb_setup_overlay()
888 switch (var->nonstd) { in omapfb_setup_overlay()
893 / (var->bits_per_pixel >> 2); in omapfb_setup_overlay()
897 screen_width = fix->line_length / (var->bits_per_pixel >> 3); in omapfb_setup_overlay()
940 struct fb_var_screeninfo *var = &fbi->var; in omapfb_apply_changes() local
967 int rotation = (var->rotate + ofbi->rotation[i]) % 4; in omapfb_apply_changes()
970 outw = var->yres; in omapfb_apply_changes()
971 outh = var->xres; in omapfb_apply_changes()
973 outw = var->xres; in omapfb_apply_changes()
974 outh = var->yres; in omapfb_apply_changes()
1008 static int omapfb_check_var(struct fb_var_screeninfo *var, struct fb_info *fbi) in omapfb_check_var() argument
1017 r = check_fb_var(fbi, var); in omapfb_check_var()
1048 static int omapfb_pan_display(struct fb_var_screeninfo *var, in omapfb_pan_display() argument
1057 if (var->xoffset == fbi->var.xoffset && in omapfb_pan_display()
1058 var->yoffset == fbi->var.yoffset) in omapfb_pan_display()
1061 new_var = fbi->var; in omapfb_pan_display()
1062 new_var.xoffset = var->xoffset; in omapfb_pan_display()
1063 new_var.yoffset = var->yoffset; in omapfb_pan_display()
1065 fbi->var = new_var; in omapfb_pan_display()
1146 struct fb_var_screeninfo *var = &fbi->var; in _setcolreg() local
1179 pal = ((red >> (16 - var->red.length)) << in _setcolreg()
1180 var->red.offset) | in _setcolreg()
1181 ((green >> (16 - var->green.length)) << in _setcolreg()
1182 var->green.offset) | in _setcolreg()
1183 (blue >> (16 - var->blue.length)); in _setcolreg()
1346 memset(&fbi->var, 0, sizeof(fbi->var)); in clear_fb_info()
1585 .width = fbi->var.xres_virtual, in omapfb_clear_fb()
1586 .height = fbi->var.yres_virtual, in omapfb_clear_fb()
1648 memcpy(&new_var, &fbi->var, sizeof(new_var)); in omapfb_realloc_fbmem()
1652 memcpy(&fbi->var, &new_var, sizeof(fbi->var)); in omapfb_realloc_fbmem()
1743 struct fb_var_screeninfo *var = &fbi->var; in omapfb_fb_init() local
1757 var->nonstd = 0; in omapfb_fb_init()
1758 var->bits_per_pixel = 0; in omapfb_fb_init()
1760 var->rotate = def_rotate; in omapfb_fb_init()
1764 int rotation = (var->rotate + ofbi->rotation[0]) % 4; in omapfb_fb_init()
1770 var->xres = h; in omapfb_fb_init()
1771 var->yres = w; in omapfb_fb_init()
1773 var->xres = w; in omapfb_fb_init()
1774 var->yres = h; in omapfb_fb_init()
1777 var->xres_virtual = var->xres; in omapfb_fb_init()
1778 var->yres_virtual = var->yres; in omapfb_fb_init()
1780 if (!var->bits_per_pixel) { in omapfb_fb_init()
1783 var->bits_per_pixel = 16; in omapfb_fb_init()
1786 var->bits_per_pixel = 32; in omapfb_fb_init()
1796 var->xres = 320; in omapfb_fb_init()
1797 var->yres = 240; in omapfb_fb_init()
1798 var->xres_virtual = var->xres; in omapfb_fb_init()
1799 var->yres_virtual = var->yres; in omapfb_fb_init()
1800 if (!var->bits_per_pixel) in omapfb_fb_init()
1801 var->bits_per_pixel = 16; in omapfb_fb_init()
1804 r = check_fb_var(fbi, var); in omapfb_fb_init()
2010 struct fb_var_screeninfo *var; in omapfb_mode_to_timings() local
2031 var = NULL; in omapfb_mode_to_timings()
2040 var = kzalloc(sizeof(*var), GFP_KERNEL); in omapfb_mode_to_timings()
2041 if (var == NULL) { in omapfb_mode_to_timings()
2054 r = fb_find_mode(var, fbi, mode_str, NULL, 0, NULL, 24); in omapfb_mode_to_timings()
2068 timings->pixel_clock = PICOS2KHZ(var->pixclock); in omapfb_mode_to_timings()
2069 timings->hbp = var->left_margin; in omapfb_mode_to_timings()
2070 timings->hfp = var->right_margin; in omapfb_mode_to_timings()
2071 timings->vbp = var->upper_margin; in omapfb_mode_to_timings()
2072 timings->vfp = var->lower_margin; in omapfb_mode_to_timings()
2073 timings->hsw = var->hsync_len; in omapfb_mode_to_timings()
2074 timings->vsw = var->vsync_len; in omapfb_mode_to_timings()
2075 timings->x_res = var->xres; in omapfb_mode_to_timings()
2076 timings->y_res = var->yres; in omapfb_mode_to_timings()
2077 timings->hsync_level = var->sync & FB_SYNC_HOR_HIGH_ACT ? in omapfb_mode_to_timings()
2080 timings->vsync_level = var->sync & FB_SYNC_VERT_HIGH_ACT ? in omapfb_mode_to_timings()
2083 timings->interlace = var->vmode & FB_VMODE_INTERLACED; in omapfb_mode_to_timings()
2085 switch (var->bits_per_pixel) { in omapfb_mode_to_timings()
2100 kfree(var); in omapfb_mode_to_timings()