kernels/linux-2.4.0/drivers/video/fbgen.c
/*
     *  Set the User Defined Part of the Display
     */
Set the User Defined Part of the Display
Set the User Defined Part of the Display
int fbgen_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info)
{
    struct fb_info_gen *info2 = (struct fb_info_gen *)info;
    int err;
    int oldxres, oldyres, oldbpp, oldxres_virtual, oldyres_virtual, oldyoffset;
    if ((err = fbgen_do_set_var(var, con == currcon, info2)))
	return err;
    if ((var->activate & FB_ACTIVATE_MASK) == FB_ACTIVATE_NOW) {
	oldxres = fb_display[con].var.xres;
	oldyres = fb_display[con].var.yres;
	oldxres_virtual = fb_display[con].var.xres_virtual;
	oldyres_virtual = fb_display[con].var.yres_virtual;
	oldbpp = fb_display[con].var.bits_per_pixel;
	oldyoffset = fb_display[con].var.yoffset;
	fb_display[con].var = *var;
	if (oldxres != var->xres || oldyres != var->yres ||
	    oldxres_virtual != var->xres_virtual ||
	    oldyres_virtual != var->yres_virtual ||
	    oldbpp != var->bits_per_pixel ||
	    oldyoffset != var->yoffset) {
	    fbgen_set_disp(con, info2);
	    if (info->changevar)
		(*info->changevar)(con);
	    if ((err = fb_alloc_cmap(&fb_display[con].cmap, 0, 0)))
		return err;
	    fbgen_install_cmap(con, info2);
	}
    }
    var->activate = 0;
    return 0;
}
int fbgen_set_var ( struct fb_var_screeninfo * var , int con , struct fb_info * info ) { struct fb_info_gen * info2 = ( struct fb_info_gen * ) info ; int err ; int oldxres , oldyres , oldbpp , oldxres_virtual , oldyres_virtual , oldyoffset ; if ( ( err = fbgen_do_set_var ( var , con == currcon , info2 ) ) ) return err ; if ( ( var -> activate & FB_ACTIVATE_MASK ) == FB_ACTIVATE_NOW ) { oldxres = fb_display [ con ] . var . xres ; oldyres = fb_display [ con ] . var . yres ; oldxres_virtual = fb_display [ con ] . var . xres_virtual ; oldyres_virtual = fb_display [ con ] . var . yres_virtual ; oldbpp = fb_display [ con ] . var . bits_per_pixel ; oldyoffset = fb_display [ con ] . var . yoffset ; fb_display [ con ] . var = * var ; if ( oldxres != var -> xres || oldyres != var -> yres || oldxres_virtual != var -> xres_virtual || oldyres_virtual != var -> yres_virtual || oldbpp != var -> bits_per_pixel || oldyoffset != var -> yoffset ) { fbgen_set_disp ( con , info2 ) ; if ( info -> changevar ) ( * info -> changevar ) ( con ) ; if ( ( err = fb_alloc_cmap ( & fb_display [ con ] . cmap , 0 , 0 ) ) ) return err ; fbgen_install_cmap ( con , info2 ) ; } } var -> activate = 0 ; return 0 ; }
Set the User Defined Part of the Display
Set the User Defined Part of the Display