From patchwork Thu Feb 25 04:28:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Turner X-Patchwork-Id: 81889 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o1P4TefA007667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 25 Feb 2010 04:30:17 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NkVKw-0007Ry-3Q; Thu, 25 Feb 2010 04:28:30 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1NkVKv-0007Rr-J6 for dri-devel@lists.sourceforge.net; Thu, 25 Feb 2010 04:28:29 +0000 Received-SPF: pass (sfi-mx-1.v28.ch3.sourceforge.com: domain of gmail.com designates 74.125.83.47 as permitted sender) client-ip=74.125.83.47; envelope-from=mattst88@gmail.com; helo=mail-gw0-f47.google.com; Received: from mail-gw0-f47.google.com ([74.125.83.47]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtp (Exim 4.69) id 1NkVKu-0005z7-Qv for dri-devel@lists.sourceforge.net; Thu, 25 Feb 2010 04:28:29 +0000 Received: by gwaa20 with SMTP id a20so1690472gwa.34 for ; Wed, 24 Feb 2010 20:28:23 -0800 (PST) Received: by 10.150.119.33 with SMTP id r33mr776573ybc.304.1267072103528; Wed, 24 Feb 2010 20:28:23 -0800 (PST) Received: from mattst88@gmail.com ([204.84.232.251]) by mx.google.com with ESMTPS id 7sm2293002ywf.40.2010.02.24.20.28.21 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 24 Feb 2010 20:28:22 -0800 (PST) Received: by mattst88@gmail.com (sSMTP sendmail emulation); Wed, 24 Feb 2010 23:29:12 -0500 From: Matt Turner To: dri-devel@lists.sourceforge.net 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> X-Mailer: git-send-email 1.6.4.4 X-Spam-Score: -0.3 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 1.1 RCVD_IN_SORBS_WEB RBL: SORBS: sender is a abuseable web server [204.84.232.251 listed in dnsbl.sorbs.net] -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain -0.0 SPF_PASS SPF: sender matches SPF record -0.0 DKIM_VERIFIED Domain Keys Identified Mail: signature passes verification 0.0 DKIM_SIGNED Domain Keys Identified Mail: message has a signature 0.1 AWL AWL: From: address is in the auto white-list X-Headers-End: 1NkVKu-0005z7-Qv X-BeenThere: dri-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.sourceforge.net X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 25 Feb 2010 04:30:17 +0000 (UTC) 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;