Lines Matching refs:var

266 			  const struct fb_var_screeninfo *var)  in ps3fb_cmp_mode()  argument
272 if (var->xres > vmode->xres || var->yres > vmode->yres || in ps3fb_cmp_mode()
273 var->pixclock > vmode->pixclock || in ps3fb_cmp_mode()
274 var->hsync_len > vmode->hsync_len || in ps3fb_cmp_mode()
275 var->vsync_len > vmode->vsync_len) in ps3fb_cmp_mode()
279 if ((var->vmode & FB_VMODE_MASK) != vmode->vmode) in ps3fb_cmp_mode()
283 xres = max(var->xres, 1U); in ps3fb_cmp_mode()
284 yres = max(var->yres, 1U); in ps3fb_cmp_mode()
287 left_margin = max(var->left_margin, vmode->left_margin); in ps3fb_cmp_mode()
288 right_margin = max(var->right_margin, vmode->right_margin); in ps3fb_cmp_mode()
289 upper_margin = max(var->upper_margin, vmode->upper_margin); in ps3fb_cmp_mode()
290 lower_margin = max(var->lower_margin, vmode->lower_margin); in ps3fb_cmp_mode()
333 static unsigned int ps3fb_find_mode(struct fb_var_screeninfo *var, in ps3fb_find_mode() argument
344 var->left_margin, var->xres, var->right_margin, in ps3fb_find_mode()
345 var->upper_margin, var->yres, var->lower_margin); in ps3fb_find_mode()
348 diff = ps3fb_cmp_mode(vmode, var); in ps3fb_find_mode()
374 if (!var->xres) in ps3fb_find_mode()
375 var->xres = 1; in ps3fb_find_mode()
376 if (!var->yres) in ps3fb_find_mode()
377 var->yres = 1; in ps3fb_find_mode()
380 if (var->xres_virtual < var->xres) in ps3fb_find_mode()
381 var->xres_virtual = var->xres; in ps3fb_find_mode()
382 if (var->yres_virtual < var->yres) in ps3fb_find_mode()
383 var->yres_virtual = var->yres; in ps3fb_find_mode()
386 if (var->left_margin < vmode->left_margin) in ps3fb_find_mode()
387 var->left_margin = vmode->left_margin; in ps3fb_find_mode()
388 if (var->right_margin < vmode->right_margin) in ps3fb_find_mode()
389 var->right_margin = vmode->right_margin; in ps3fb_find_mode()
390 if (var->upper_margin < vmode->upper_margin) in ps3fb_find_mode()
391 var->upper_margin = vmode->upper_margin; in ps3fb_find_mode()
392 if (var->lower_margin < vmode->lower_margin) in ps3fb_find_mode()
393 var->lower_margin = vmode->lower_margin; in ps3fb_find_mode()
398 ((long)var->left_margin + (long)var->xres + in ps3fb_find_mode()
399 (long)var->right_margin); in ps3fb_find_mode()
401 var->left_margin += gap/2; in ps3fb_find_mode()
402 var->right_margin += (gap+1)/2; in ps3fb_find_mode()
404 var->left_margin, var->xres, var->right_margin); in ps3fb_find_mode()
409 ((long)var->upper_margin + (long)var->yres + in ps3fb_find_mode()
410 (long)var->lower_margin); in ps3fb_find_mode()
412 var->upper_margin += gap/2; in ps3fb_find_mode()
413 var->lower_margin += (gap+1)/2; in ps3fb_find_mode()
415 var->upper_margin, var->yres, var->lower_margin); in ps3fb_find_mode()
419 var->pixclock = vmode->pixclock; in ps3fb_find_mode()
420 var->hsync_len = vmode->hsync_len; in ps3fb_find_mode()
421 var->vsync_len = vmode->vsync_len; in ps3fb_find_mode()
422 var->sync = vmode->sync; in ps3fb_find_mode()
425 *xdr_line_length = GPU_ALIGN_UP(var->xres_virtual * BPP); in ps3fb_find_mode()
433 if (vmode->xres == var->xres && vmode->yres == var->yres) in ps3fb_find_mode()
533 static int ps3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) in ps3fb_check_var() argument
538 mode = ps3fb_find_mode(var, &ddr_line_length, &xdr_line_length); in ps3fb_check_var()
543 if (var->xres_virtual > xdr_line_length / BPP) { in ps3fb_check_var()
549 if (var->xoffset + var->xres > var->xres_virtual || in ps3fb_check_var()
550 var->yoffset + var->yres > var->yres_virtual) { in ps3fb_check_var()
556 if (var->bits_per_pixel > 32 || var->grayscale || in ps3fb_check_var()
557 var->red.offset > 16 || var->green.offset > 8 || in ps3fb_check_var()
558 var->blue.offset > 0 || var->transp.offset > 24 || in ps3fb_check_var()
559 var->red.length > 8 || var->green.length > 8 || in ps3fb_check_var()
560 var->blue.length > 8 || var->transp.length > 8 || in ps3fb_check_var()
561 var->red.msb_right || var->green.msb_right || in ps3fb_check_var()
562 var->blue.msb_right || var->transp.msb_right || var->nonstd) { in ps3fb_check_var()
567 var->bits_per_pixel = 32; in ps3fb_check_var()
568 var->red.offset = 16; in ps3fb_check_var()
569 var->green.offset = 8; in ps3fb_check_var()
570 var->blue.offset = 0; in ps3fb_check_var()
571 var->transp.offset = 24; in ps3fb_check_var()
572 var->red.length = 8; in ps3fb_check_var()
573 var->green.length = 8; in ps3fb_check_var()
574 var->blue.length = 8; in ps3fb_check_var()
575 var->transp.length = 8; in ps3fb_check_var()
576 var->red.msb_right = 0; in ps3fb_check_var()
577 var->green.msb_right = 0; in ps3fb_check_var()
578 var->blue.msb_right = 0; in ps3fb_check_var()
579 var->transp.msb_right = 0; in ps3fb_check_var()
582 if (var->rotate) { in ps3fb_check_var()
588 if (var->yres_virtual * xdr_line_length > info->fix.smem_len) { in ps3fb_check_var()
593 var->height = -1; in ps3fb_check_var()
594 var->width = -1; in ps3fb_check_var()
611 mode = ps3fb_find_mode(&info->var, &ddr_line_length, &xdr_line_length); in ps3fb_set_par()
617 info->fix.xpanstep = info->var.xres_virtual > info->var.xres ? 1 : 0; in ps3fb_set_par()
618 info->fix.ypanstep = info->var.yres_virtual > info->var.yres ? 1 : 0; in ps3fb_set_par()
623 par->xdr_frame_size = info->var.yres_virtual * xdr_line_length; in ps3fb_set_par()
631 par->width = info->var.xres; in ps3fb_set_par()
632 par->height = info->var.yres; in ps3fb_set_par()
635 ddr_xoff = info->var.left_margin - vmode->left_margin; in ps3fb_set_par()
636 ddr_yoff = info->var.upper_margin - vmode->upper_margin; in ps3fb_set_par()
641 par->pan_offset = info->var.yoffset * xdr_line_length + in ps3fb_set_par()
642 info->var.xoffset * BPP; in ps3fb_set_par()
693 static int ps3fb_pan_display(struct fb_var_screeninfo *var, in ps3fb_pan_display() argument
698 par->pan_offset = var->yoffset * info->fix.line_length + in ps3fb_pan_display()
699 var->xoffset * BPP; in ps3fb_pan_display()
811 struct fb_var_screeninfo var; in ps3fb_ioctl() local
825 var = info->var; in ps3fb_ioctl()
826 fb_videomode_to_var(&var, vmode); in ps3fb_ioctl()
829 var.activate |= FB_ACTIVATE_FORCE; in ps3fb_ioctl()
831 retval = fb_set_var(info, &var); in ps3fb_ioctl()
833 fbcon_update_vcs(info, var.activate & FB_ACTIVATE_ALL); in ps3fb_ioctl()
852 res.yres = info->var.yres_virtual; in ps3fb_ioctl()
853 res.xoff = (res.xres - info->var.xres) / 2; in ps3fb_ioctl()
854 res.yoff = (res.yres - info->var.yres) / 2; in ps3fb_ioctl()
1155 if (!fb_find_mode(&info->var, info, mode_option, ps3fb_modedb, in ps3fb_probe()