diff options
| -rw-r--r-- | drivers/video/auo_k190x.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/video/auo_k190x.c b/drivers/video/auo_k190x.c index e078e20d4ad6..a77513b0e18c 100644 --- a/drivers/video/auo_k190x.c +++ b/drivers/video/auo_k190x.c | |||
| @@ -377,16 +377,25 @@ static int auok190xfb_check_var(struct fb_var_screeninfo *var, | |||
| 377 | struct fb_info *info) | 377 | struct fb_info *info) |
| 378 | { | 378 | { |
| 379 | struct device *dev = info->device; | 379 | struct device *dev = info->device; |
| 380 | struct auok190xfb_par *par = info->par; | ||
| 381 | struct panel_info *panel = &panel_table[par->resolution]; | ||
| 380 | int size; | 382 | int size; |
| 381 | 383 | ||
| 382 | if (info->var.xres != var->xres || info->var.yres != var->yres || | 384 | /* |
| 383 | info->var.xres_virtual != var->xres_virtual || | 385 | * Dimensions |
| 384 | info->var.yres_virtual != var->yres_virtual) { | 386 | */ |
| 385 | pr_info("%s: Resolution not supported: X%u x Y%u\n", | 387 | |
| 386 | __func__, var->xres, var->yres); | 388 | if (par->rotation & 1) { |
| 387 | return -EINVAL; | 389 | var->xres = panel->h; |
| 390 | var->yres = panel->w; | ||
| 391 | } else { | ||
| 392 | var->xres = panel->w; | ||
| 393 | var->yres = panel->h; | ||
| 388 | } | 394 | } |
| 389 | 395 | ||
| 396 | var->xres_virtual = var->xres; | ||
| 397 | var->yres_virtual = var->yres; | ||
| 398 | |||
| 390 | /* | 399 | /* |
| 391 | * Memory limit | 400 | * Memory limit |
| 392 | */ | 401 | */ |
| @@ -900,21 +909,6 @@ int auok190x_common_probe(struct platform_device *pdev, | |||
| 900 | 909 | ||
| 901 | panel = &panel_table[board->resolution]; | 910 | panel = &panel_table[board->resolution]; |
| 902 | 911 | ||
| 903 | /* if 90 degree rotation, switch width and height */ | ||
| 904 | if (board->rotation & 1) { | ||
| 905 | info->var.xres = panel->h; | ||
| 906 | info->var.yres = panel->w; | ||
| 907 | info->var.xres_virtual = panel->h; | ||
| 908 | info->var.yres_virtual = panel->w; | ||
| 909 | info->fix.line_length = panel->h * info->var.bits_per_pixel / 8; | ||
| 910 | } else { | ||
| 911 | info->var.xres = panel->w; | ||
| 912 | info->var.yres = panel->h; | ||
| 913 | info->var.xres_virtual = panel->w; | ||
| 914 | info->var.yres_virtual = panel->h; | ||
| 915 | info->fix.line_length = panel->w * info->var.bits_per_pixel / 8; | ||
| 916 | } | ||
| 917 | |||
| 918 | par->resolution = board->resolution; | 912 | par->resolution = board->resolution; |
| 919 | par->rotation = board->rotation; | 913 | par->rotation = board->rotation; |
| 920 | 914 | ||
| @@ -935,6 +929,13 @@ int auok190x_common_probe(struct platform_device *pdev, | |||
| 935 | info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB; | 929 | info->flags = FBINFO_FLAG_DEFAULT | FBINFO_VIRTFB; |
| 936 | info->fbops = &auok190xfb_ops; | 930 | info->fbops = &auok190xfb_ops; |
| 937 | 931 | ||
| 932 | ret = auok190xfb_check_var(&info->var, info); | ||
| 933 | if (ret) | ||
| 934 | goto err_defio; | ||
| 935 | |||
| 936 | info->fix.line_length = info->var.xres_virtual * | ||
| 937 | info->var.bits_per_pixel / 8; | ||
| 938 | |||
| 938 | /* deferred io init */ | 939 | /* deferred io init */ |
| 939 | 940 | ||
| 940 | info->fbdefio = devm_kzalloc(info->device, | 941 | info->fbdefio = devm_kzalloc(info->device, |
