summaryrefslogtreecommitdiffstats
path: root/hwc
diff options
context:
space:
mode:
authorGustavo Diaz Prado <a0273371@ti.com>2012-10-03 11:47:47 -0500
committerDaniel Levin <dendy@ti.com>2012-11-28 21:16:25 +0200
commitf5142f536846e9a26182af7c0b2b0578fb72dc10 (patch)
tree0657cd3140341d8075f518b9b272de4dbc487518 /hwc
parente763b8d3be62f5fb3777af371866e7fe1d11ee1c (diff)
downloadandroid_hardware_ti_omap4-f5142f536846e9a26182af7c0b2b0578fb72dc10.tar.gz
android_hardware_ti_omap4-f5142f536846e9a26182af7c0b2b0578fb72dc10.tar.bz2
android_hardware_ti_omap4-f5142f536846e9a26182af7c0b2b0578fb72dc10.zip
hwc: rgz: Fix using an invalid array index when there are no blits
When the regionizer decides there are no blits as a result of a given hwc geometry a -1 array index was being used to set the last blit async, this needs to be avoided if there are no blits. Change-Id: I3ce2f60a46096559c2ba308cf1d617a79731751e Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
Diffstat (limited to 'hwc')
-rw-r--r--hwc/rgz_2d.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hwc/rgz_2d.c b/hwc/rgz_2d.c
index 5c4d1a9..96c4374 100644
--- a/hwc/rgz_2d.c
+++ b/hwc/rgz_2d.c
@@ -1510,9 +1510,11 @@ static int rgz_out_region(rgz_t *rgz, rgz_out_params_t *params)
params->data.bvc.out_nhndls++;
}
- /* Last blit is made sync to act like a fence for the previous async blits */
- struct rgz_blt_entry* e = &blts.bvcmds[blts.idx-1];
- rgz_set_async(e, 0);
+ if (blts.idx > 0) {
+ /* Last blit is made sync to act like a fence for the previous async blits */
+ struct rgz_blt_entry* e = &blts.bvcmds[blts.idx-1];
+ rgz_set_async(e, 0);
+ }
/* FIXME: we want to be able to call rgz_blts_free and populate the actual
* composition data structure ourselves */