From patchwork Sat Aug 21 21:32:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Turner X-Patchwork-Id: 122031 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7LLVsrl028470 for ; Sat, 21 Aug 2010 21:32:30 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 565079E978 for ; Sat, 21 Aug 2010 14:31:54 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gw0-f49.google.com (mail-gw0-f49.google.com [74.125.83.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 81D539E9C3 for ; Sat, 21 Aug 2010 14:31:19 -0700 (PDT) Received: by mail-gw0-f49.google.com with SMTP id 10so1999701gwb.36 for ; Sat, 21 Aug 2010 14:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=2KyFxTShnIJtDb0i/U9LEY0YAiXXYrRaYfd4nr6DzsA=; b=A/XeUu/m8m7T76cpdzvXD8Zbciho6E+vhl7AdBLpbPLY4T5ibb48bgXptAmFsMV6xZ WRbgLkhQhnxt74iJtasWyjpxRhxjGmHyprPStkw/nxu/CF4bYTdlmBsIcRzLAZk8fGmz H3Ey4yjb5MN0agaYEN4otKIF2iSm9zZCAgz9M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=cr474/ILRvoTq8eUDSMOSdxwws8gEeQUs19pwc4qjSdBtN5+M/j8f2ZvOQzIk1L24r G4V++DUBwkROacvTePsfVUUsvcx4K85kEjnFmuoiN3ljxY0bjxHDbby6DlI6VDTaFO9/ /VmmBmroyQKOWTfWH8Qo0r8TvtCrGnk0GlDLM= Received: by 10.151.6.9 with SMTP id j9mr1708728ybi.232.1282426279406; Sat, 21 Aug 2010 14:31:19 -0700 (PDT) Received: from mattst88@gmail.com (cpe-173-095-152-044.nc.res.rr.com [173.95.152.44]) by mx.google.com with ESMTPS id v32sm1857261yba.18.2010.08.21.14.31.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 21 Aug 2010 14:31:18 -0700 (PDT) Received: by mattst88@gmail.com (sSMTP sendmail emulation); Sat, 21 Aug 2010 17:32:38 -0400 From: mattst88@gmail.com To: intel-gfx@lists.freedesktop.org Date: Sat, 21 Aug 2010 17:32:25 -0400 Message-Id: <1282426345-15853-2-git-send-email-mattst88@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1282426345-15853-1-git-send-email-mattst88@gmail.com> References: <1282426345-15853-1-git-send-email-mattst88@gmail.com> Subject: [Intel-gfx] [PATCH 2/2] Replace ROUND_* macros with ALIGN. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 21 Aug 2010 21:32:31 +0000 (UTC) diff --git a/src/common.h b/src/common.h index f244e08..f7e4923 100644 --- a/src/common.h +++ b/src/common.h @@ -160,10 +160,6 @@ static inline void memcpy_volatile(volatile void *dst, const void *src, #define I810_REG_SIZE 0x80000 #define GTT_PAGE_SIZE KB(4) -#define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y)) -#define ROUND_DOWN_TO(x, y) ((x) / (y) * (y)) -#define ROUND_TO_PAGE(x) ROUND_TO((x), GTT_PAGE_SIZE) -#define ROUND_TO_MB(x) ROUND_TO((x), MB(1)) #define PRIMARY_RINGBUFFER_SIZE KB(128) #define MIN_SCRATCH_BUFFER_SIZE KB(16) #define MAX_SCRATCH_BUFFER_SIZE KB(64) diff --git a/src/intel_memory.c b/src/intel_memory.c index b42e6d7..091e3d0 100644 --- a/src/intel_memory.c +++ b/src/intel_memory.c @@ -128,7 +128,7 @@ intel_get_fence_pitch(intel_screen_private *intel, unsigned long pitch, /* 965 is flexible */ if (IS_I965G(intel)) - return ROUND_TO(pitch, tile_width); + return ALIGN(pitch, tile_width); /* Pre-965 needs power of two tile width */ for (i = tile_width; i < pitch; i <<= 1) ; diff --git a/src/intel_uxa.c b/src/intel_uxa.c index 3c03ca7..b51c4eb 100644 --- a/src/intel_uxa.c +++ b/src/intel_uxa.c @@ -142,7 +142,7 @@ intel_uxa_pixmap_compute_size(PixmapPtr pixmap, if (*tiling != I915_TILING_NONE) { /* First check whether tiling is necessary. */ pitch = (w * pixmap->drawable.bitsPerPixel + 7) / 8; - pitch = ROUND_TO(pitch, intel->accel_pixmap_pitch_alignment); + pitch = ALIGN(pitch, intel->accel_pixmap_pitch_alignment); size = pitch * ALIGN (h, 2); if (!IS_I965G(intel)) { /* Older hardware requires fences to be pot size @@ -179,7 +179,7 @@ intel_uxa_pixmap_compute_size(PixmapPtr pixmap, aligned_h = ALIGN(h, 32); *stride = intel_get_fence_pitch(intel, - ROUND_TO(pitch, 512), + ALIGN(pitch, 512), *tiling); /* Round the object up to the size of the fence it will live in @@ -199,7 +199,7 @@ intel_uxa_pixmap_compute_size(PixmapPtr pixmap, * subspan doesn't address an invalid page offset beyond the * end of the GTT. */ - *stride = ROUND_TO(pitch, intel->accel_pixmap_pitch_alignment); + *stride = ALIGN(pitch, intel->accel_pixmap_pitch_alignment); size = *stride * ALIGN(h, 2); } diff --git a/src/legacy/i810/i810_common.h b/src/legacy/i810/i810_common.h index a526f73..14b2993 100644 --- a/src/legacy/i810/i810_common.h +++ b/src/legacy/i810/i810_common.h @@ -138,10 +138,6 @@ extern int I810_DEBUG; #define I810_REG_SIZE 0x80000 #define GTT_PAGE_SIZE KB(4) -#define ROUND_TO(x, y) (((x) + (y) - 1) / (y) * (y)) -#define ROUND_DOWN_TO(x, y) ((x) / (y) * (y)) -#define ROUND_TO_PAGE(x) ROUND_TO((x), GTT_PAGE_SIZE) -#define ROUND_TO_MB(x) ROUND_TO((x), MB(1)) #define PRIMARY_RINGBUFFER_SIZE KB(128) #define MIN_SCRATCH_BUFFER_SIZE KB(16) #define MAX_SCRATCH_BUFFER_SIZE KB(64)