[PATCH 06/18] glx: switch to byte counting functions
Peter Hutterer
peter.hutterer at who-t.net
Wed Jul 8 17:05:04 PDT 2009
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
glx/indirect_util.c | 4 ++--
glx/rensize.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/glx/indirect_util.c b/glx/indirect_util.c
index 58c194c..35b255b 100644
--- a/glx/indirect_util.c
+++ b/glx/indirect_util.c
@@ -126,7 +126,7 @@ __glXSendReply( ClientPtr client, const void * data, size_t elements,
elements = 0;
}
else if ( (elements > 1) || always_array ) {
- reply_ints = ((elements * element_size) + 3) >> 2;
+ reply_ints = num_dwords_for_bytes(elements * element_size);
}
__glXReply.length = reply_ints;
@@ -174,7 +174,7 @@ __glXSendReplySwap( ClientPtr client, const void * data, size_t elements,
elements = 0;
}
else if ( (elements > 1) || always_array ) {
- reply_ints = ((elements * element_size) + 3) >> 2;
+ reply_ints = num_dwords_for_bytes(elements * element_size);
}
__glXReply.length = bswap_32( reply_ints );
diff --git a/glx/rensize.c b/glx/rensize.c
index 5c6b150..c0b74c1 100644
--- a/glx/rensize.c
+++ b/glx/rensize.c
@@ -195,7 +195,7 @@ int __glXImageSize( GLenum format, GLenum type, GLenum target,
} else {
groupsPerRow = w;
}
- rowSize = (groupsPerRow + 7) >> 3;
+ rowSize = num_bytes_for_bits(groupsPerRow);
padding = (rowSize % alignment);
if (padding) {
rowSize += alignment - padding;
--
1.6.3.rc1.2.g0164.dirty
More information about the xorg-devel
mailing list