diff options
author | Eric Anholt <[email protected]> | 2007-10-04 12:07:25 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2007-10-04 12:28:49 -0700 |
commit | 77e0523fb7769df4bf43747e136b1653b2421b97 (patch) | |
tree | 27337de5a5460aad8428969a504621c98e95fb16 /src/mesa/drivers/dri/i915/intel_context.h | |
parent | 0fc9efd8f0b1b6c4e3525a50e3478e5aef72531a (diff) |
[965] Replace various alignment code with a shared ALIGN() macro.
In the process, fix some alignment issues:
- Scratch space allocation was aligned into units of 1KB, while the allocation
wanted units of bytes, so we never allocated enough space for scratch.
- GRF register count was programmed as ALIGN(val - 1, 16) / 16 instead of
ALIGN(val, 16) / 16 - 1, which overcounted for val != 16n+1.
Diffstat (limited to 'src/mesa/drivers/dri/i915/intel_context.h')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_context.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_context.h b/src/mesa/drivers/dri/i915/intel_context.h index c8298dd9c43..ce9a362944b 100644 --- a/src/mesa/drivers/dri/i915/intel_context.h +++ b/src/mesa/drivers/dri/i915/intel_context.h @@ -292,6 +292,8 @@ extern char *__progname; #define SUBPIXEL_X 0.125 #define SUBPIXEL_Y 0.125 +#define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1)) + #define INTEL_FIREVERTICES(intel) \ do { \ if ((intel)->prim.flush) \ |