Commit 03fc1499 authored by Heiko Stübner's avatar Heiko Stübner Committed by Tomi Valkeinen

AUO-K190x: make memory check in check_var more flexible

Use only information from the new var to calculate the amount
of memory needed.
Signed-off-by: default avatarHeiko Stübner <heiko@sntech.de>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 4e0ab85b
...@@ -376,6 +376,9 @@ static void auok190xfb_imageblit(struct fb_info *info, ...@@ -376,6 +376,9 @@ static void auok190xfb_imageblit(struct fb_info *info,
static int auok190xfb_check_var(struct fb_var_screeninfo *var, static int auok190xfb_check_var(struct fb_var_screeninfo *var,
struct fb_info *info) struct fb_info *info)
{ {
struct device *dev = info->device;
int size;
if (info->var.xres != var->xres || info->var.yres != var->yres || if (info->var.xres != var->xres || info->var.yres != var->yres ||
info->var.xres_virtual != var->xres_virtual || info->var.xres_virtual != var->xres_virtual ||
info->var.yres_virtual != var->yres_virtual) { info->var.yres_virtual != var->yres_virtual) {
...@@ -388,9 +391,10 @@ static int auok190xfb_check_var(struct fb_var_screeninfo *var, ...@@ -388,9 +391,10 @@ static int auok190xfb_check_var(struct fb_var_screeninfo *var,
* Memory limit * Memory limit
*/ */
if ((info->fix.line_length * var->yres_virtual) > info->fix.smem_len) { size = var->xres_virtual * var->yres_virtual * var->bits_per_pixel / 8;
pr_info("%s: Memory Limit requested yres_virtual = %u\n", if (size > info->fix.smem_len) {
__func__, var->yres_virtual); dev_err(dev, "Memory limit exceeded, requested %dK\n",
size >> 10);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment