AUO-K190x: move var resolution-handling into check_var
From: Heiko Stuebner <heiko@...> Date: Sun, 24 Jun 2012 21:46:31 +0200
Commit-Message
Patch-Comment
drivers/video/auo_k190x.c | 43 ++++++++++++++++++++++--------------------- 1 files changed, 22 insertions(+), 21 deletions(-)
Statistics
- 22 lines added
- 21 lines removed
Changes
-------------------------- drivers/video/auo_k190x.c ---------------------------
index 9cd9b7e..7f4c4ef 100644
@@ -376,16 +376,25 @@ static int auok190xfb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info)
{
struct device *dev = info->device;
+ struct auok190xfb_par *par = info->par;
+ struct panel_info *panel = &panel_table[par->resolution];
int size;
+ /*
+ * Dimensions
+ */
+
+ if (par->rotation & 1) {
+ var->xres = panel->h;
+ var->yres = panel->w;
+ } else {
+ var->xres = panel->w;
+ var->yres = panel->h;
}
+ var->xres_virtual = var->xres;
+ var->yres_virtual = var->yres;
+
/*
* Memory limit
*/
@@ -899,21 +908,6 @@ int __devinit auok190x_common_probe(struct platform_device *pdev,
panel = &panel_table[board->resolution];
par->resolution = board->resolution;
par->rotation = board->rotation;
@@ -934,6 +928,13 @@ int __devinit auok190x_common_probe(struct platform_device *pdev,
info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB;
info->fbops = &auok190xfb_ops;
+ ret = auok190xfb_check_var(&info->var, info);
+ if (ret)
+ goto err_defio;
+
+ info->fix.line_length = info->var.xres_virtual *
+ info->var.bits_per_pixel / 8;
+
/* deferred io init */
info->fbdefio = devm_kzalloc(info->device,