diff options
author | Jason Sams <jsams@google.com> | 2012-11-30 18:03:54 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-11-30 18:03:54 -0800 |
commit | 2539203284ec7079edb6ecc35d32e79f3385c73c (patch) | |
tree | 7121943c36adf7e0e5769872eefec242741f3329 | |
parent | 63d37605191b90c63d1ebe342713996ef6b5abc3 (diff) | |
parent | c4b6b3af8ea67c6ce86a4e44e9432f2887107cff (diff) | |
download | rs-2539203284ec7079edb6ecc35d32e79f3385c73c.tar.gz |
am c4b6b3af: Fix kernel launch clipping.
* commit 'c4b6b3af8ea67c6ce86a4e44e9432f2887107cff':
Fix kernel launch clipping.
-rw-r--r-- | driver/rsdIntrinsicBlend.cpp | 3 | ||||
-rw-r--r-- | driver/rsdIntrinsicBlur.cpp | 21 | ||||
-rw-r--r-- | driver/rsdIntrinsicConvolve5x5.cpp | 2 | ||||
-rw-r--r-- | driver/rsdIntrinsicLUT.cpp | 3 |
4 files changed, 18 insertions, 11 deletions
diff --git a/driver/rsdIntrinsicBlend.cpp b/driver/rsdIntrinsicBlend.cpp index 22ad108a..c35c3796 100644 --- a/driver/rsdIntrinsicBlend.cpp +++ b/driver/rsdIntrinsicBlend.cpp @@ -103,9 +103,6 @@ static void ColorMatrix_uchar4(const RsForEachStubParamStruct *p, uint32_t x1 = xstart; uint32_t x2 = xend; - in += xstart; - out += xstart; - switch (p->slot) { case BLEND_CLEAR: for (;x1 < x2; x1++, out++) { diff --git a/driver/rsdIntrinsicBlur.cpp b/driver/rsdIntrinsicBlur.cpp index 8919df80..5cd671e3 100644 --- a/driver/rsdIntrinsicBlur.cpp +++ b/driver/rsdIntrinsicBlur.cpp @@ -188,14 +188,27 @@ static void Blur_uchar4(const RsForEachStubParamStruct *p, float4 *fout = (float4 *)buf; int y = p->y; + uint32_t vx1 = x1; + uint32_t vx2 = x2; + + if (vx1 > (uint32_t)cp->iradius) { + vx1 -= cp->iradius; + } else { + vx1 = 0; + } + vx2 += cp->iradius; + if (vx2 >= p->dimX) { + vx2 = p->dimX - 1; + } + if ((y > cp->iradius) && (y < ((int)p->dimY - cp->iradius))) { const uchar *pi = pin + (y - cp->iradius) * din->lod[0].stride; - OneVF(fout, pi, din->lod[0].stride, cp->fp, cp->iradius * 2 + 1, x1, x2); + OneVF(fout + vx1, pi, din->lod[0].stride, cp->fp, cp->iradius * 2 + 1, vx1, vx2); } else { - while(x2 > x1) { - OneV(p, fout, x1, y, pin, din->lod[0].stride, cp->fp, cp->iradius); + while(vx2 > vx1) { + OneV(p, fout, vx1, y, pin, din->lod[0].stride, cp->fp, cp->iradius); fout++; - x1++; + vx1++; } } diff --git a/driver/rsdIntrinsicConvolve5x5.cpp b/driver/rsdIntrinsicConvolve5x5.cpp index fc6b029e..ac063040 100644 --- a/driver/rsdIntrinsicConvolve5x5.cpp +++ b/driver/rsdIntrinsicConvolve5x5.cpp @@ -134,7 +134,7 @@ static void Convolve5x5_uchar4(const RsForEachStubParamStruct *p, #if defined(ARCH_ARM_HAVE_NEON) if((x1 + 3) < x2) { uint32_t len = (x2 - x1 - 3) >> 1; - rsdIntrinsicConvolve5x5_K(out, py0, py1, py2, py3, py4, cp->ip, len); + rsdIntrinsicConvolve5x5_K(out, py0+x1-2, py1+x1-2, py2+x1-2, py3+x1-2, py4+x1-2, cp->ip, len); out += len << 1; x1 += len << 1; } diff --git a/driver/rsdIntrinsicLUT.cpp b/driver/rsdIntrinsicLUT.cpp index a75534ed..818a132d 100644 --- a/driver/rsdIntrinsicLUT.cpp +++ b/driver/rsdIntrinsicLUT.cpp @@ -44,9 +44,6 @@ static void LUT_uchar4(const RsForEachStubParamStruct *p, uint32_t x1 = xstart; uint32_t x2 = xend; - in += xstart; - out += xstart; - DrvAllocation *din = (DrvAllocation *)cp->lut->mHal.drv; const uchar *tr = (const uchar *)din->lod[0].mallocPtr; const uchar *tg = &tr[256]; |