From ad7f1aa0d3d6160b1b242218d0dd7c420f8699b4 Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Mon, 17 Sep 2012 00:05:51 +0100 Subject: [PATCH] liboverlay: Make sure the crop rectangles' dimensions are even Even out the values for both dimensions and position on both src and destination rects. This fixes both over and underrun issues, especially with HD panels Change-Id: I781792d69cad83f76c3c0a45a5179a731661c3cf --- liboverlay/overlayMdp.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/liboverlay/overlayMdp.h b/liboverlay/overlayMdp.h index 1ccd64b..c667e22 100644 --- a/liboverlay/overlayMdp.h +++ b/liboverlay/overlayMdp.h @@ -333,6 +333,10 @@ inline void MdpCtrl::setSrcRectDim(const overlay::utils::Dim d) { mOVInfo.src_rect.y = d.y; mOVInfo.src_rect.w = d.w; mOVInfo.src_rect.h = d.h; + utils::even_ceil(mOVInfo.src_rect.x); + utils::even_ceil(mOVInfo.src_rect.y); + utils::even_floor(mOVInfo.src_rect.w); + utils::even_floor(mOVInfo.src_rect.h); } inline overlay::utils::Dim MdpCtrl::getDstRectDim() const { @@ -347,6 +351,10 @@ inline void MdpCtrl::setDstRectDim(const overlay::utils::Dim d) { mOVInfo.dst_rect.y = d.y; mOVInfo.dst_rect.w = d.w; mOVInfo.dst_rect.h = d.h; + utils::even_ceil(mOVInfo.dst_rect.x); + utils::even_ceil(mOVInfo.dst_rect.y); + utils::even_floor(mOVInfo.dst_rect.w); + utils::even_floor(mOVInfo.dst_rect.h); } inline int MdpCtrl::getUserData() const { return mOVInfo.user_data[0]; }