diff options
author | Gustavo Diaz Prado <a0273371@ti.com> | 2012-10-15 15:49:01 -0500 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-28 21:16:25 +0200 |
commit | b954f931e77d87c60522112cb5e15a22edbf75b9 (patch) | |
tree | 11a9f927dbcc20bb4dff2e0c36fefdadb5b71200 /hwc | |
parent | 3638f02591703be3f52f6b66f20ca56ce91eb692 (diff) | |
download | hardware_ti_omap4-b954f931e77d87c60522112cb5e15a22edbf75b9.zip hardware_ti_omap4-b954f931e77d87c60522112cb5e15a22edbf75b9.tar.gz hardware_ti_omap4-b954f931e77d87c60522112cb5e15a22edbf75b9.tar.bz2 |
hwc: rgz: Fix hang in sorting algorithm
This is a workaround for a issue that is happening with the regionizer
geometry change handling patch. The bubble sort algorithm is hanging,
avoiding the do-while solves the problem for now.
Change-Id: Iebdc7a516a93dfe85ba00f9e2e748e8323347cb4
Signed-off-by: Gustavo Diaz Prado <a0273371@ti.com>
Diffstat (limited to 'hwc')
-rw-r--r-- | hwc/rgz_2d.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/hwc/rgz_2d.c b/hwc/rgz_2d.c index 49d557c..bc13119 100644 --- a/hwc/rgz_2d.c +++ b/hwc/rgz_2d.c @@ -834,31 +834,21 @@ static float getscaleh(hwc_layer_t *layer) return ((float)HEIGHT(layer->displayFrame)) / (float)h; } -static int rgz_bswap(int *a, int *b) -{ - if (*a > *b) { - int tmp = *b; - *b = *a; - *a = tmp; - return 1; - } - return 0; -} - /* - * Simple bubble sort on an array + * Simple bubble sort on an array, ascending order */ static void rgz_bsort(int *a, int len) { - int i, s; - - do { - s=0; - for (i=0; i+1<len; i++) { - if (rgz_bswap(&a[i], &a[i+1])) - s = 1; + int i, j; + for (i = 0; i < len; i++) { + for (j = 0; j < i; j++) { + if (a[i] < a[j]) { + int temp = a[i]; + a[i] = a[j]; + a[j] = temp; + } } - } while (s); + } } /* |