summaryrefslogtreecommitdiffstats
path: root/liboverlay
diff options
context:
space:
mode:
authorSimon Wilson <simonwilson@google.com>2010-11-01 18:01:53 -0700
committerSimon Wilson <simonwilson@google.com>2010-11-01 18:41:28 -0700
commit69a6211f5c98784f0d9a1337d94074f401663745 (patch)
tree5c898f5941e136646f3936613b6af57d5e5ed683 /liboverlay
parent4f68907464b0c45333516faa000c9aa077f2748f (diff)
downloaddevice_samsung_crespo-69a6211f5c98784f0d9a1337d94074f401663745.zip
device_samsung_crespo-69a6211f5c98784f0d9a1337d94074f401663745.tar.gz
device_samsung_crespo-69a6211f5c98784f0d9a1337d94074f401663745.tar.bz2
liboverlay: fix overlay constraints
Round up overlay sizes to nearest multiple of 2 (or 8) and allow destinations of less than 16x16 to be used, since the hardware actually supports a minimum of 8x8. For sizes less than this, treat as 8x8 for now. Fixes a known issue with the Instant Heart Rate app. Change-Id: Ia039e82799d80ce82ea8e58917c02faf6bebdf77 Id: Ieb6e4c68902c38de263093719bc9ec0095a91fb0
Diffstat (limited to 'liboverlay')
-rw-r--r--liboverlay/overlay.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/liboverlay/overlay.cpp b/liboverlay/overlay.cpp
index 1946a24..9964271 100644
--- a/liboverlay/overlay.cpp
+++ b/liboverlay/overlay.cpp
@@ -716,11 +716,13 @@ static int overlay_setPosition(struct overlay_control_device_t *dev,
* the display.
*/
- /*quire a minimum size */
- if (temp_w < 16 || temp_h < 16) {
- /* Return an error */
- rc = -1;
- } else if (!shared->controlReady) {
+ /* Require a minimum size */
+ if (temp_x < 8)
+ temp_x = 8;
+ if (temp_y < 8)
+ temp_y = 8;
+
+ if (!shared->controlReady) {
if ( temp_x < 0 ) temp_x = 0;
if ( temp_y < 0 ) temp_y = 0;
if ( temp_w > shared->dispW ) temp_w = shared->dispW;
@@ -989,7 +991,7 @@ static int check_fimc_dst_constraints(s5p_fimc_t *s5p_fimc,
if(s5p_fimc->hw_ver == 0x50) {
if(s5p_fimc->params.dst.width%2 != 0) {
- tmp = s5p_fimc->params.dst.width - (s5p_fimc->params.dst.width%2);
+ tmp = s5p_fimc->params.dst.width + (s5p_fimc->params.dst.width%2);
if(tmp <= 0)
return -1;
else
@@ -997,7 +999,7 @@ static int check_fimc_dst_constraints(s5p_fimc_t *s5p_fimc,
}
} else {
if(s5p_fimc->params.dst.width%8 != 0) {
- tmp = s5p_fimc->params.dst.width - (s5p_fimc->params.dst.width%8);
+ tmp = s5p_fimc->params.dst.width + (s5p_fimc->params.dst.width%8);
if(tmp <= 0)
return -1;
else
@@ -1025,17 +1027,17 @@ static int check_fimc_src_constraints(s5p_fimc_t *s5p_fimc)
case PFT_YUV420:
if (s5p_fimc->params.src.height%2 != 0)
s5p_fimc->params.src.height = s5p_fimc->params.src.height
- - (s5p_fimc->params.src.height)%2;
+ + (s5p_fimc->params.src.height)%2;
if (s5p_fimc->params.src.width%2 != 0)
s5p_fimc->params.src.width = s5p_fimc->params.src.width
- - (s5p_fimc->params.src.width)%2;
+ + (s5p_fimc->params.src.width)%2;
break;
case PFT_YUV422:
if (s5p_fimc->params.src.width%2 != 0)
s5p_fimc->params.src.width = s5p_fimc->params.src.width
- - (s5p_fimc->params.src.width)%2;
+ + (s5p_fimc->params.src.width)%2;
}
} else {
if (s5p_fimc->params.src.height < 8) {
@@ -1044,7 +1046,7 @@ static int check_fimc_src_constraints(s5p_fimc_t *s5p_fimc)
if (s5p_fimc->params.src.width%16 != 0) {
s5p_fimc->params.src.width = s5p_fimc->params.src.width
- - (s5p_fimc->params.src.width)%16;
+ + (s5p_fimc->params.src.width)%16;
}
}