Lines Matching refs:var
51 static int tx3912fb_get_var(struct fb_var_screeninfo *var, int con,
53 static int tx3912fb_set_var(struct fb_var_screeninfo *var, int con,
133 static int tx3912fb_get_var(struct fb_var_screeninfo *var, int con, in tx3912fb_get_var() argument
137 *var = tx3912fb_info; in tx3912fb_get_var()
139 *var = fb_display[con].var; in tx3912fb_get_var()
147 static int tx3912fb_set_var(struct fb_var_screeninfo *var, int con, in tx3912fb_set_var() argument
150 int err, activate = var->activate; in tx3912fb_set_var()
164 if (var->vmode & FB_VMODE_CONUPDATE) { in tx3912fb_set_var()
165 var->xoffset = display->var.xoffset; in tx3912fb_set_var()
166 var->yoffset = display->var.yoffset; in tx3912fb_set_var()
167 var->vmode |= FB_VMODE_YWRAP; in tx3912fb_set_var()
173 if (!var->xres) in tx3912fb_set_var()
174 var->xres = 1; in tx3912fb_set_var()
175 if (!var->yres) in tx3912fb_set_var()
176 var->yres = 1; in tx3912fb_set_var()
177 if (var->xres > var->xres_virtual) in tx3912fb_set_var()
178 var->xres_virtual = var->xres; in tx3912fb_set_var()
179 if (var->yres > var->yres_virtual) in tx3912fb_set_var()
180 var->yres_virtual = var->yres; in tx3912fb_set_var()
181 if (var->bits_per_pixel <= 1) in tx3912fb_set_var()
182 var->bits_per_pixel = 1; in tx3912fb_set_var()
183 else if (var->bits_per_pixel <= 2) in tx3912fb_set_var()
184 var->bits_per_pixel = 2; in tx3912fb_set_var()
185 else if (var->bits_per_pixel <= 4) in tx3912fb_set_var()
186 var->bits_per_pixel = 4; in tx3912fb_set_var()
187 else if (var->bits_per_pixel <= 8) in tx3912fb_set_var()
188 var->bits_per_pixel = 8; in tx3912fb_set_var()
195 line_length = get_line_length(var->xres_virtual, var->bits_per_pixel); in tx3912fb_set_var()
196 if ((line_length * var->yres_virtual) > tx3912fb_size) in tx3912fb_set_var()
202 if (var->bits_per_pixel) { in tx3912fb_set_var()
204 var->red.offset = 5; in tx3912fb_set_var()
205 var->red.length = 3; in tx3912fb_set_var()
206 var->green.offset = 2; in tx3912fb_set_var()
207 var->green.length = 3; in tx3912fb_set_var()
208 var->blue.offset = 0; in tx3912fb_set_var()
209 var->blue.length = 2; in tx3912fb_set_var()
210 var->transp.offset = 0; in tx3912fb_set_var()
211 var->transp.length = 0; in tx3912fb_set_var()
213 var->red.msb_right = 0; in tx3912fb_set_var()
214 var->green.msb_right = 0; in tx3912fb_set_var()
215 var->blue.msb_right = 0; in tx3912fb_set_var()
216 var->transp.msb_right = 0; in tx3912fb_set_var()
223 oldxres = display->var.xres; in tx3912fb_set_var()
224 oldyres = display->var.yres; in tx3912fb_set_var()
225 oldvxres = display->var.xres_virtual; in tx3912fb_set_var()
226 oldvyres = display->var.yres_virtual; in tx3912fb_set_var()
227 oldbpp = display->var.bits_per_pixel; in tx3912fb_set_var()
228 display->var = *var; in tx3912fb_set_var()
230 if (oldxres != var->xres || oldyres != var->yres || in tx3912fb_set_var()
231 oldvxres != var->xres_virtual || in tx3912fb_set_var()
232 oldvyres != var->yres_virtual || in tx3912fb_set_var()
233 oldbpp != var->bits_per_pixel) { in tx3912fb_set_var()
237 switch (var->bits_per_pixel) { in tx3912fb_set_var()
255 get_line_length(var->xres_virtual, in tx3912fb_set_var()
256 var->bits_per_pixel); in tx3912fb_set_var()
260 switch (var->bits_per_pixel) { in tx3912fb_set_var()
291 if (oldbpp != var->bits_per_pixel) { in tx3912fb_set_var()
312 fb_copy_cmap(fb_default_cmap(1<<fb_display[con].var.bits_per_pixel), cmap, kspc ? 0 : 2); in tx3912fb_get_cmap()
327 1<<fb_display[con].var.bits_per_pixel, 0))) in tx3912fb_set_cmap()
545 …fb_set_cmap(fb_default_cmap(1 << fb_display[con].var.bits_per_pixel), 1, tx3912fb_setcolreg, info); in tx3912fb_install_cmap()