From: Matt Turner Subject: [PATCH] drm/vmwgfx: use ALIGN instead of open coding it Date: Wed, 24 Feb 2010 23:28:59 -0500 Message-ID: <1267072139-23225-1-git-send-email-mattst88@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.sourceforge.net To: dri-devel@lists.sourceforge.net List-Id: dri-devel@lists.freedesktop.org CC: Jakob Bornecrantz Signed-off-by: Matt Turner --- drivers/gpu/drm/vmwgfx/svga_overlay.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/svga_overlay.h b/drivers/gpu/drm/vmwgfx/svga_overlay.h index f753d73..55b7627 100644 --- a/drivers/gpu/drm/vmwgfx/svga_overlay.h +++ b/drivers/gpu/drm/vmwgfx/svga_overlay.h @@ -143,7 +143,7 @@ VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN { int tmp; - *width = (*width + 1) & ~1; + *width = ALIGN(*width, 2) if (offsets) { offsets[0] = 0; @@ -151,8 +151,8 @@ VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN switch (format) { case VMWARE_FOURCC_YV12: - *height = (*height + 1) & ~1; - *size = (*width + 3) & ~3; + *height = ALIGN(*height, 2); + *size = ALIGN(*width, 4); if (pitches) { pitches[0] = *size; @@ -164,7 +164,7 @@ VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN offsets[1] = *size; } - tmp = ((*width >> 1) + 3) & ~3; + tmp = ALIGN(*width >> 1, 4); if (pitches) { pitches[1] = pitches[2] = tmp; -- 1.6.4.4 ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev --