summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv30
diff options
context:
space:
mode:
authorPekka Paalanen <[email protected]>2008-12-13 23:24:39 +0200
committerPekka Paalanen <[email protected]>2008-12-13 23:24:39 +0200
commitf72848a09a9d3069705fbe8e4daa29b9918ea56e (patch)
tree2aa40f4523fa5c55a0680e59fc052bd188fc4a34 /src/gallium/drivers/nv30
parent079116e6a487988c7f0411f60c652bb29d69b488 (diff)
Nouveau: move the definition of log2i() to header
Also make the type unsigned instead of signed, since negative values do not make sense. Signed-off-by: Pekka Paalanen <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nv30')
-rw-r--r--src/gallium/drivers/nv30/nv30_fragtex.c27
-rw-r--r--src/gallium/drivers/nv30/nv30_state_fb.c27
2 files changed, 2 insertions, 52 deletions
diff --git a/src/gallium/drivers/nv30/nv30_fragtex.c b/src/gallium/drivers/nv30/nv30_fragtex.c
index efba8db86d8..b1d2663af38 100644
--- a/src/gallium/drivers/nv30/nv30_fragtex.c
+++ b/src/gallium/drivers/nv30/nv30_fragtex.c
@@ -1,30 +1,5 @@
#include "nv30_context.h"
-
-static INLINE int log2i(int i)
-{
- int r = 0;
-
- if (i & 0xffff0000) {
- i >>= 16;
- r += 16;
- }
- if (i & 0x0000ff00) {
- i >>= 8;
- r += 8;
- }
- if (i & 0x000000f0) {
- i >>= 4;
- r += 4;
- }
- if (i & 0x0000000c) {
- i >>= 2;
- r += 2;
- }
- if (i & 0x00000002) {
- r += 1;
- }
- return r;
-}
+#include "nouveau/nouveau_util.h"
#define _(m,tf,ts0x,ts0y,ts0z,ts0w,ts1x,ts1y,ts1z,ts1w) \
{ \
diff --git a/src/gallium/drivers/nv30/nv30_state_fb.c b/src/gallium/drivers/nv30/nv30_state_fb.c
index c549b17656e..73bdf7e56c5 100644
--- a/src/gallium/drivers/nv30/nv30_state_fb.c
+++ b/src/gallium/drivers/nv30/nv30_state_fb.c
@@ -1,30 +1,5 @@
#include "nv30_context.h"
-
-static INLINE int log2i(int i)
-{
- int r = 0;
-
- if (i & 0xffff0000) {
- i >>= 16;
- r += 16;
- }
- if (i & 0x0000ff00) {
- i >>= 8;
- r += 8;
- }
- if (i & 0x000000f0) {
- i >>= 4;
- r += 4;
- }
- if (i & 0x0000000c) {
- i >>= 2;
- r += 2;
- }
- if (i & 0x00000002) {
- r += 1;
- }
- return r;
-}
+#include "nouveau/nouveau_util.h"
static boolean
nv30_state_framebuffer_validate(struct nv30_context *nv30)