should help [2223746] qsd8k MDP locks up, logs show copyBits failed (Connection timed out) in Passion camera zoom level 1

make sure to return an error when mdp limits are exceeded
This commit is contained in:
Mathias Agopian 2009-11-09 20:14:02 -08:00
parent a6675bb910
commit ef686c51fd

View File

@ -42,8 +42,10 @@
#if defined(COPYBIT_MSM7K)
#define MAX_SCALE_FACTOR (4)
#define MAX_DIMENSION (4096)
#elif defined(COPYBIT_QSD8K)
#define MAX_SCALE_FACTOR (8)
#define MAX_DIMENSION (2048)
#else
#error "Unsupported MDP version"
#endif
@ -366,6 +368,12 @@ static int stretch_copybit(
return -EINVAL;
}
if (src->w > MAX_DIMENSION || src->h > MAX_DIMENSION)
return -EINVAL;
if (dst->w > MAX_DIMENSION || dst->h > MAX_DIMENSION)
return -EINVAL;
const uint32_t maxCount = sizeof(list.req)/sizeof(list.req[0]);
const struct copybit_rect_t bounds = { 0, 0, dst->w, dst->h };
struct copybit_rect_t clip;