]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
OMAPDSS: DSSCOMP: do not clone from disabled layer
authorSergiy Kibrik <sergiy.kibrik@globallogic.com>
Wed, 3 Apr 2013 20:11:08 +0000 (15:11 -0500)
committerPraneeth Bajjuri <praneeth@ti.com>
Fri, 12 Jul 2013 22:41:44 +0000 (17:41 -0500)
In case of cloning layer from other overlay, we should always check
whether overlay we want to clone from is valid, or we may run
into severe troubles. One example of failing case is when 1D mapping
of overlay fails, we can't clone from it, as it will be disabled and
we will eventually end up with memory violation.

Change-Id: Ic230d965b09df62e7a15e7b89364f169783bdb9e
Signed-off-by: Arthur Philpott <arthur.philpott@ti.com>
drivers/video/omap2/dsscomp/gralloc.c

index 7256be4e062ff0b052b46b009e9d8c4f514694ff..0e6b646a8b28976418ac763aa5f577da30f7d8e1 100755 (executable)
@@ -348,7 +348,7 @@ int dsscomp_gralloc_queue(struct dsscomp_setup_dispc_data *d,
                /* copy prior overlay to avoid mapping layers twice to 1D */
                if (oi->addressing == OMAP_DSS_BUFADDR_OVL_IX) {
                        unsigned int j = oi->ba;
-                       if (j >= i) {
+                       if (j >= i || !d->ovls[j].cfg.enabled) {
                                WARN(1, "Invalid clone layer (%u)", j);
                                goto skip_buffer;
                        }