diff options
author | Jack Yen <jyen@ti.com> | 2012-08-20 13:38:57 -0500 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 13:00:57 +0200 |
commit | baa91a1fb44fda29da760e02d6b36c8d8249e9bc (patch) | |
tree | 6891629da97cabcbd6a4bf9acbd0d5ba9ba8d084 /drivers/misc | |
parent | 7673b25b7b0d2d4b3d9888eb2eb2dcdaadafae63 (diff) | |
download | kernel_samsung_tuna-baa91a1fb44fda29da760e02d6b36c8d8249e9bc.zip kernel_samsung_tuna-baa91a1fb44fda29da760e02d6b36c8d8249e9bc.tar.gz kernel_samsung_tuna-baa91a1fb44fda29da760e02d6b36c8d8249e9bc.tar.bz2 |
gcx: adjust cache rect based on orientation
Change-Id: If18483ae6a054f3fbdc036cedca10b3178cd16b0
Signed-off-by: Jack Yen <jyen@ti.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/gcx/gcbv/gcbv.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/misc/gcx/gcbv/gcbv.c b/drivers/misc/gcx/gcbv/gcbv.c index 16d63cc..5e3d80e 100644 --- a/drivers/misc/gcx/gcbv/gcbv.c +++ b/drivers/misc/gcx/gcbv/gcbv.c @@ -1460,6 +1460,7 @@ enum bverror bv_cache(struct bvcopparams *copparams) enum bverror bverror = BVERR_NONE; unsigned int bytespp = 0; /* bytes per pixel */ unsigned long vert_offset, horiz_offset; + unsigned int true_width, true_height; struct c2dmrgn rgn[3]; int container_size = 0; @@ -1481,6 +1482,14 @@ enum bverror bv_cache(struct bvcopparams *copparams) goto exit; } + if (copparams->geom->orientation % 180 != 0) { + true_width = copparams->rect->height; + true_height = copparams->rect->width; + } else { + true_width = copparams->rect->width; + true_height = copparams->rect->height; + } + switch (container) { case OCDFMTDEF_CONTAINER_8BIT: container_size = 8; @@ -1529,8 +1538,8 @@ enum bverror bv_cache(struct bvcopparams *copparams) goto exit; } - rgn[0].span = copparams->rect->width * bytespp; - rgn[0].lines = copparams->rect->height; + rgn[0].span = true_width * bytespp; + rgn[0].lines = true_height; rgn[0].stride = copparams->geom->virtstride; horiz_offset = copparams->rect->left * bytespp; vert_offset = copparams->rect->top; @@ -1545,16 +1554,16 @@ enum bverror bv_cache(struct bvcopparams *copparams) case OCDFMTDEF_2_PLANE_YCbCr: /* 1 byte per pixel */ - rgn[0].span = copparams->rect->width; - rgn[0].lines = copparams->rect->height; + rgn[0].span = true_width; + rgn[0].lines = true_height; rgn[0].stride = copparams->geom->virtstride; rgn[0].start = (void *) ((unsigned long) copparams->desc->virtaddr + copparams->rect->top * rgn[0].stride + copparams->rect->left); - rgn[1].span = copparams->rect->width; - rgn[1].lines = copparams->rect->height / 2; + rgn[1].span = true_width; + rgn[1].lines = true_height / 2; rgn[1].stride = copparams->geom->virtstride; rgn[1].start = rgn[0].start + copparams->geom->height * rgn[0].stride; |