summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/omapfb
diff options
context:
space:
mode:
authorGrazvydas Ignotas <notasas@gmail.com>2012-03-09 01:42:49 +0100
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-04-23 09:48:06 +0200
commitf3fb3bbc7f71d573be40213af4a90751a81b2379 (patch)
treeda7047c8d3490f86dc20a6efac2d97e0cd22788e /drivers/video/omap2/omapfb
parentOMAPDSS: TPO-TD03MTEA1: Correct comment for power on delay (diff)
downloadlinux-f3fb3bbc7f71d573be40213af4a90751a81b2379.tar.xz
linux-f3fb3bbc7f71d573be40213af4a90751a81b2379.zip
OMAPDSS: OMAPFB: check for matching memory size early
If the size of memory region that is being set up is the same as before, we don't have to do memory and layer busy checks. Signed-off-by: Grazvydas Ignotas <notasas@gmail.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/omapfb')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-ioctl.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-ioctl.c b/drivers/video/omap2/omapfb/omapfb-ioctl.c
index 6a09ef87e14f..27a85813c600 100644
--- a/drivers/video/omap2/omapfb/omapfb-ioctl.c
+++ b/drivers/video/omap2/omapfb/omapfb-ioctl.c
@@ -225,6 +225,9 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
down_write_nested(&rg->lock, rg->id);
atomic_inc(&rg->lock_count);
+ if (rg->size == size && rg->type == mi->type)
+ goto out;
+
if (atomic_read(&rg->map_count)) {
r = -EBUSY;
goto out;
@@ -247,12 +250,10 @@ static int omapfb_setup_mem(struct fb_info *fbi, struct omapfb_mem_info *mi)
}
}
- if (rg->size != size || rg->type != mi->type) {
- r = omapfb_realloc_fbmem(fbi, size, mi->type);
- if (r) {
- dev_err(fbdev->dev, "realloc fbmem failed\n");
- goto out;
- }
+ r = omapfb_realloc_fbmem(fbi, size, mi->type);
+ if (r) {
+ dev_err(fbdev->dev, "realloc fbmem failed\n");
+ goto out;
}
out: