summaryrefslogtreecommitdiff
path: root/src/xvmc
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2010-08-21 17:32:24 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2010-08-22 09:52:42 +0100
commitb611bced15c30f7bcd03106ce90668b684c1ada6 (patch)
tree7cd855510996cb39dbe6a454d3e36dbb2ce75b45 /src/xvmc
parent8b04b350a983b89eb2d741f55baa297a933ac6ea (diff)
Use ALIGN macro instead of open coding it.
Signed-off-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/xvmc')
-rw-r--r--src/xvmc/i915_xvmc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/xvmc/i915_xvmc.c b/src/xvmc/i915_xvmc.c
index 9ad8d01a..21a11491 100644
--- a/src/xvmc/i915_xvmc.c
+++ b/src/xvmc/i915_xvmc.c
@@ -31,7 +31,9 @@
#include "i915_structs.h"
#include "i915_program.h"
-#define STRIDE(w) (((w) + 0x3ff) & ~0x3ff)
+#define ALIGN(i,m) (((i) + (m) - 1) & ~((m) - 1))
+
+#define STRIDE(w) (ALIGN((w), 1024))
#define SIZE_Y420(w, h) (h * STRIDE(w))
#define SIZE_UV420(w, h) ((h >> 1) * STRIDE(w >> 1))
#define SIZE_YUV420(w, h) (SIZE_Y420(w,h) + SIZE_UV420(w,h) * 2)