aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAlexei Shlychkov <x0177296@ti.com>2012-10-11 13:50:18 -0700
committerZiyann <jaraidaniel@gmail.com>2014-10-01 13:01:05 +0200
commit1fbd2937d6dc3639d3d851c418942716acbc52de (patch)
treebf4ec5b98e12169f01a89e703081ff2a7cc089c4 /drivers/misc
parentb0e93e9906b03a3661d0d29d63015e15565d3216 (diff)
downloadkernel_samsung_tuna-1fbd2937d6dc3639d3d851c418942716acbc52de.zip
kernel_samsung_tuna-1fbd2937d6dc3639d3d851c418942716acbc52de.tar.gz
kernel_samsung_tuna-1fbd2937d6dc3639d3d851c418942716acbc52de.tar.bz2
gcx: two pass filter fixes.
Use the destination format (RGB) for the temporary buffer if destination angle is not 0 degree due to a hardware limitation for 4:2:2 rotated destination. Performance is optimized for temporary buffer by setting proper buffer geomerty. Change-Id: Ie53da18fe854adeaaf3d568605bb8630288aee5d Signed-off-by: Alexei Shlychkov <x0177296@ti.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/gcx/gcbv/gcblit.c6
-rw-r--r--drivers/misc/gcx/gcbv/gcbv.c80
-rw-r--r--drivers/misc/gcx/gcbv/gcfilter.c28
3 files changed, 62 insertions, 52 deletions
diff --git a/drivers/misc/gcx/gcbv/gcblit.c b/drivers/misc/gcx/gcbv/gcblit.c
index f8a768e..9f65aa2 100644
--- a/drivers/misc/gcx/gcbv/gcblit.c
+++ b/drivers/misc/gcx/gcbv/gcblit.c
@@ -311,7 +311,8 @@ enum bverror do_blit(struct bvbltparams *bvbltparams,
srcinfo->bytealign);
/* Compute U/V plane offsets. */
- if (srcinfo->format.type == BVFMT_YUV)
+ if ((srcinfo->format.type == BVFMT_YUV) &&
+ (srcinfo->format.cs.yuv.planecount > 1))
set_computeyuv(srcinfo, srcshiftX, srcshiftY);
/* Determine the destination surface shift. */
@@ -366,7 +367,8 @@ enum bverror do_blit(struct bvbltparams *bvbltparams,
dstinfo->bytealign);
/* Compute U/V plane offsets. */
- if (srcinfo->format.type == BVFMT_YUV)
+ if ((srcinfo->format.type == BVFMT_YUV) &&
+ (srcinfo->format.cs.yuv.planecount > 1))
set_computeyuv(srcinfo, 0, 0);
switch (srcinfo->angle) {
diff --git a/drivers/misc/gcx/gcbv/gcbv.c b/drivers/misc/gcx/gcbv/gcbv.c
index c5da5f7..dc51920 100644
--- a/drivers/misc/gcx/gcbv/gcbv.c
+++ b/drivers/misc/gcx/gcbv/gcbv.c
@@ -736,75 +736,69 @@ void set_computeyuv(struct surfaceinfo *srcinfo, int x, int y)
GCENTER(GCZONE_SRC);
- switch (srcinfo->format.cs.yuv.planecount) {
- case 2:
- /* Compute base address alignment. */
- pixalign = get_pixel_offset(srcinfo, 0);
- bytealign = (pixalign * (int) srcinfo->format.bitspp) / 8;
+ /* Compute base address alignment. */
+ pixalign = get_pixel_offset(srcinfo, 0);
+ bytealign = (pixalign * (int) srcinfo->format.bitspp) / 8;
+
+ /* Determine the physical height of the first plane. */
+ height1 = ((srcinfo->angle % 2) == 0)
+ ? srcinfo->geom->height
+ : srcinfo->geom->width;
- /* Determine physical height. */
- height1 = ((srcinfo->angle % 2) == 0)
- ? srcinfo->geom->height
- : srcinfo->geom->width;
+ /* Determine the size of the first plane. */
+ size1 = srcinfo->geom->virtstride * height1;
- /* Determine the second plane stride. */
- srcinfo->stride2 = srcinfo->geom->virtstride
- / srcinfo->format.cs.yuv.xsample;
+ /* Determine the stride of the second plane. */
+ srcinfo->stride2 = srcinfo->geom->virtstride
+ / srcinfo->format.cs.yuv.xsample;
- /* Determine subsample pixel position. */
- ssX = x / srcinfo->format.cs.yuv.xsample;
- ssY = y / srcinfo->format.cs.yuv.ysample;
+ /* Determine subsample pixel position. */
+ ssX = x / srcinfo->format.cs.yuv.xsample;
+ ssY = y / srcinfo->format.cs.yuv.ysample;
+ switch (srcinfo->format.cs.yuv.planecount) {
+ case 2:
/* U and V are interleaved in one plane. */
ssX *= 2;
srcinfo->stride2 *= 2;
- /* Determine the size of the first plane. */
- size1 = srcinfo->geom->virtstride * height1;
-
/* Determnine the origin offset. */
origin = ssY * srcinfo->stride2 + ssX;
- /* Compute the second plane alignment. */
+ /* Compute the alignment of the second plane. */
srcinfo->bytealign2 = bytealign + size1 + origin;
+
GCDBG(GCZONE_SRC, "plane2 offset (bytes) = 0x%08X\n",
srcinfo->bytealign2);
+ GCDBG(GCZONE_SRC, "plane2 stride = %d\n",
+ srcinfo->stride2);
break;
case 3:
- /* Compute base address alignment. */
- pixalign = get_pixel_offset(srcinfo, 0);
- bytealign = (pixalign * (int) srcinfo->format.bitspp) / 8;
-
- /* Determine physical height. */
- height1 = ((srcinfo->angle % 2) == 0)
- ? srcinfo->geom->height
- : srcinfo->geom->width;
+ /* Determine the physical height of the U/V planes. */
height2 = height1 / srcinfo->format.cs.yuv.ysample;
- /* Determine the U and V stride. */
- srcinfo->stride2 =
- srcinfo->stride3 = srcinfo->geom->virtstride
- / srcinfo->format.cs.yuv.xsample;
-
- /* Determine subsample pixel position. */
- ssX = x / srcinfo->format.cs.yuv.xsample;
- ssY = y / srcinfo->format.cs.yuv.ysample;
-
- /* Determine the size of the planes. */
- size1 = srcinfo->geom->virtstride * height1;
+ /* Determine the size of the U/V planes. */
size2 = srcinfo->stride2 * height2;
/* Determnine the origin offset. */
origin = ssY * srcinfo->stride2 + ssX;
- /* Compute the second plane alignment. */
+ /* Compute the alignment of the U/V planes. */
srcinfo->bytealign2 = bytealign + size1 + origin;
srcinfo->bytealign3 = bytealign + size1 + size2 + origin;
- GCDBG(GCZONE_SRC, " plane2 offset (bytes) = 0x%08X\n",
+
+ /* Determine the stride of the U/V planes. */
+ srcinfo->stride3 = srcinfo->stride2;
+
+ GCDBG(GCZONE_SRC, "plane2 offset (bytes) = 0x%08X\n",
srcinfo->bytealign2);
- GCDBG(GCZONE_SRC, " plane3 offset (bytes) = 0x%08X\n",
+ GCDBG(GCZONE_SRC, "plane2 stride = %d\n",
+ srcinfo->stride2);
+ GCDBG(GCZONE_SRC, "plane3 offset (bytes) = 0x%08X\n",
srcinfo->bytealign3);
+ GCDBG(GCZONE_SRC, "plane3 stride = %d\n",
+ srcinfo->stride3);
break;
}
@@ -896,7 +890,7 @@ enum bverror set_yuvsrc(struct bvbltparams *bvbltparams,
gcmoyuv3->uplaneaddress = GET_MAP_HANDLE(srcmap);
gcmoyuv3->uplanestride = srcinfo->stride2;
gcmoyuv3->vplaneaddress = GET_MAP_HANDLE(srcmap);
- gcmoyuv3->vplanestride = srcinfo->stride2;
+ gcmoyuv3->vplanestride = srcinfo->stride3;
break;
default:
@@ -1009,7 +1003,7 @@ enum bverror set_yuvsrc_index(struct bvbltparams *bvbltparams,
gcmoxsrcyuv3->vplaneaddress = GET_MAP_HANDLE(srcmap);
gcmoxsrcyuv3->vplanestride_ldst
= gcmoxsrcyuv_vplanestride_ldst[index];
- gcmoxsrcyuv3->vplanestride = srcinfo->stride2;
+ gcmoxsrcyuv3->vplanestride = srcinfo->stride3;
break;
default:
diff --git a/drivers/misc/gcx/gcbv/gcfilter.c b/drivers/misc/gcx/gcbv/gcfilter.c
index 1dd7a29..d5cbee6 100644
--- a/drivers/misc/gcx/gcbv/gcfilter.c
+++ b/drivers/misc/gcx/gcbv/gcfilter.c
@@ -1254,7 +1254,8 @@ enum bverror do_filter(struct bvbltparams *bvbltparams,
srcinfo->bytealign);
/* Compute U/V plane offsets. */
- if (srcinfo->format.type == BVFMT_YUV)
+ if ((srcinfo->format.type == BVFMT_YUV) &&
+ (srcinfo->format.cs.yuv.planecount > 1))
set_computeyuv(srcinfo, 0, 0);
/* Determine physical size. */
@@ -1513,11 +1514,20 @@ enum bverror do_filter(struct bvbltparams *bvbltparams,
/* Determine temporary surface format. */
if (srcinfo->format.type == BVFMT_YUV) {
- GCDBG(GCZONE_FILTER, "tmp format = 4:2:2\n");
- tmpgeom.format = OCDFMT_YUYV;
- parse_format(bvbltparams, &tmpinfo);
+ if (tmpinfo.angle == ROT_ANGLE_0) {
+ GCDBG(GCZONE_FILTER,
+ "tmp format = 4:2:2\n");
+ tmpgeom.format = OCDFMT_YUYV;
+ parse_format(bvbltparams, &tmpinfo);
+ } else {
+ GCDBG(GCZONE_FILTER,
+ "tmp format = dst format\n");
+ tmpgeom.format = dstinfo->geom->format;
+ tmpinfo.format = dstinfo->format;
+ }
} else {
- GCDBG(GCZONE_FILTER, "tmp format = src format\n");
+ GCDBG(GCZONE_FILTER,
+ "tmp format = src format\n");
tmpgeom.format = srcinfo->geom->format;
tmpinfo.format = srcinfo->format;
}
@@ -1575,14 +1585,18 @@ enum bverror do_filter(struct bvbltparams *bvbltparams,
/* Determine the physical size of the surface. */
if ((tmpinfo.angle % 2) == 0) {
+ tmpgeom.width = (tmpgeom.width + tmpalignmask)
+ & ~tmpalignmask;
tmpinfo.physwidth = tmpgeom.width;
tmpinfo.physheight = tmpgeom.height;
} else {
+ tmpgeom.height = (tmpgeom.height + tmpalignmask)
+ & ~tmpalignmask;
tmpinfo.physwidth = tmpgeom.height;
tmpinfo.physheight = tmpgeom.width;
}
- tmpinfo.physwidth = (tmpinfo.physwidth + tmpalignmask)
- & ~tmpalignmask;
+ GCDBG(GCZONE_FILTER, "tmp aligned dims: %dx%d\n",
+ tmpgeom.width, tmpgeom.height);
GCDBG(GCZONE_FILTER, "tmp physical dims: %dx%d\n",
tmpinfo.physwidth, tmpinfo.physheight);