Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f3fb3bbc authored by Grazvydas Ignotas's avatar Grazvydas Ignotas Committed by Tomi Valkeinen
Browse files

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: default avatarGrazvydas Ignotas <notasas@gmail.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 2c83af49
Loading
Loading
Loading
Loading
+7 −6
Original line number Original line Diff line number Diff line
@@ -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);
	down_write_nested(&rg->lock, rg->id);
	atomic_inc(&rg->lock_count);
	atomic_inc(&rg->lock_count);


	if (rg->size == size && rg->type == mi->type)
		goto out;

	if (atomic_read(&rg->map_count)) {
	if (atomic_read(&rg->map_count)) {
		r = -EBUSY;
		r = -EBUSY;
		goto out;
		goto out;
@@ -247,13 +250,11 @@ 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);
	r = omapfb_realloc_fbmem(fbi, size, mi->type);
	if (r) {
	if (r) {
		dev_err(fbdev->dev, "realloc fbmem failed\n");
		dev_err(fbdev->dev, "realloc fbmem failed\n");
		goto out;
		goto out;
	}
	}
	}


 out:
 out:
	atomic_dec(&rg->lock_count);
	atomic_dec(&rg->lock_count);