diff options
| author | Ilia Mirkin <imirkin@alum.mit.edu> | 2013-07-27 00:27:00 -0400 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2013-09-03 23:46:09 -0400 |
| commit | 57be046e5af098ab2ff972269799ef495a7f8a2b (patch) | |
| tree | 2b900d380d70b9d084c33b8b21be3b2b1990706a | |
| parent | ef25bd84edba73f78ce7397ef3d7b97e2774ed07 (diff) | |
drm/nouveau/core: get rid of math.h, replace log2i with order_base_2
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/core/ramht.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c | 3 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/include/core/math.h | 16 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/core/os.h | 3 |
7 files changed, 7 insertions, 27 deletions
diff --git a/drivers/gpu/drm/nouveau/core/core/ramht.c b/drivers/gpu/drm/nouveau/core/core/ramht.c index 86a64045dd60..f3b9bddc3875 100644 --- a/drivers/gpu/drm/nouveau/core/core/ramht.c +++ b/drivers/gpu/drm/nouveau/core/core/ramht.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | 22 | ||
| 23 | #include <core/object.h> | 23 | #include <core/object.h> |
| 24 | #include <core/ramht.h> | 24 | #include <core/ramht.h> |
| 25 | #include <core/math.h> | ||
| 26 | 25 | ||
| 27 | #include <subdev/bar.h> | 26 | #include <subdev/bar.h> |
| 28 | 27 | ||
| @@ -104,6 +103,6 @@ nouveau_ramht_new(struct nouveau_object *parent, struct nouveau_object *pargpu, | |||
| 104 | if (ret) | 103 | if (ret) |
| 105 | return ret; | 104 | return ret; |
| 106 | 105 | ||
| 107 | ramht->bits = log2i(nv_gpuobj(ramht)->size >> 3); | 106 | ramht->bits = order_base_2(nv_gpuobj(ramht)->size >> 3); |
| 108 | return 0; | 107 | return 0; |
| 109 | } | 108 | } |
diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c index e9b8217d0075..7e5dff51d3c5 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <core/engctx.h> | 26 | #include <core/engctx.h> |
| 27 | #include <core/ramht.h> | 27 | #include <core/ramht.h> |
| 28 | #include <core/class.h> | 28 | #include <core/class.h> |
| 29 | #include <core/math.h> | ||
| 30 | 29 | ||
| 31 | #include <subdev/timer.h> | 30 | #include <subdev/timer.h> |
| 32 | #include <subdev/bar.h> | 31 | #include <subdev/bar.h> |
| @@ -278,7 +277,7 @@ nv50_fifo_chan_ctor_ind(struct nouveau_object *parent, | |||
| 278 | return ret; | 277 | return ret; |
| 279 | 278 | ||
| 280 | ioffset = args->ioffset; | 279 | ioffset = args->ioffset; |
| 281 | ilength = log2i(args->ilength / 8); | 280 | ilength = order_base_2(args->ilength / 8); |
| 282 | 281 | ||
| 283 | nv_wo32(base->ramfc, 0x3c, 0x403f6078); | 282 | nv_wo32(base->ramfc, 0x3c, 0x403f6078); |
| 284 | nv_wo32(base->ramfc, 0x44, 0x01003fff); | 283 | nv_wo32(base->ramfc, 0x44, 0x01003fff); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c index 7f53196cff52..433b2d8b73b2 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c | |||
| @@ -28,7 +28,6 @@ | |||
| 28 | #include <core/ramht.h> | 28 | #include <core/ramht.h> |
| 29 | #include <core/event.h> | 29 | #include <core/event.h> |
| 30 | #include <core/class.h> | 30 | #include <core/class.h> |
| 31 | #include <core/math.h> | ||
| 32 | 31 | ||
| 33 | #include <subdev/timer.h> | 32 | #include <subdev/timer.h> |
| 34 | #include <subdev/bar.h> | 33 | #include <subdev/bar.h> |
| @@ -258,7 +257,7 @@ nv84_fifo_chan_ctor_ind(struct nouveau_object *parent, | |||
| 258 | nv_parent(chan)->object_detach = nv50_fifo_object_detach; | 257 | nv_parent(chan)->object_detach = nv50_fifo_object_detach; |
| 259 | 258 | ||
| 260 | ioffset = args->ioffset; | 259 | ioffset = args->ioffset; |
| 261 | ilength = log2i(args->ilength / 8); | 260 | ilength = order_base_2(args->ilength / 8); |
| 262 | 261 | ||
| 263 | nv_wo32(base->ramfc, 0x3c, 0x403f6078); | 262 | nv_wo32(base->ramfc, 0x3c, 0x403f6078); |
| 264 | nv_wo32(base->ramfc, 0x44, 0x01003fff); | 263 | nv_wo32(base->ramfc, 0x44, 0x01003fff); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c index 46dfa68c47bb..ce92f289e751 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #include <core/engctx.h> | 29 | #include <core/engctx.h> |
| 30 | #include <core/event.h> | 30 | #include <core/event.h> |
| 31 | #include <core/class.h> | 31 | #include <core/class.h> |
| 32 | #include <core/math.h> | ||
| 33 | #include <core/enum.h> | 32 | #include <core/enum.h> |
| 34 | 33 | ||
| 35 | #include <subdev/timer.h> | 34 | #include <subdev/timer.h> |
| @@ -200,7 +199,7 @@ nvc0_fifo_chan_ctor(struct nouveau_object *parent, | |||
| 200 | 199 | ||
| 201 | usermem = chan->base.chid * 0x1000; | 200 | usermem = chan->base.chid * 0x1000; |
| 202 | ioffset = args->ioffset; | 201 | ioffset = args->ioffset; |
| 203 | ilength = log2i(args->ilength / 8); | 202 | ilength = order_base_2(args->ilength / 8); |
| 204 | 203 | ||
| 205 | for (i = 0; i < 0x1000; i += 4) | 204 | for (i = 0; i < 0x1000; i += 4) |
| 206 | nv_wo32(priv->user.mem, usermem + i, 0x00000000); | 205 | nv_wo32(priv->user.mem, usermem + i, 0x00000000); |
diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c index 09644fa9602c..8e8121abe31b 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c | |||
| @@ -29,7 +29,6 @@ | |||
| 29 | #include <core/engctx.h> | 29 | #include <core/engctx.h> |
| 30 | #include <core/event.h> | 30 | #include <core/event.h> |
| 31 | #include <core/class.h> | 31 | #include <core/class.h> |
| 32 | #include <core/math.h> | ||
| 33 | #include <core/enum.h> | 32 | #include <core/enum.h> |
| 34 | 33 | ||
| 35 | #include <subdev/timer.h> | 34 | #include <subdev/timer.h> |
| @@ -240,7 +239,7 @@ nve0_fifo_chan_ctor(struct nouveau_object *parent, | |||
| 240 | 239 | ||
| 241 | usermem = chan->base.chid * 0x200; | 240 | usermem = chan->base.chid * 0x200; |
| 242 | ioffset = args->ioffset; | 241 | ioffset = args->ioffset; |
| 243 | ilength = log2i(args->ilength / 8); | 242 | ilength = order_base_2(args->ilength / 8); |
| 244 | 243 | ||
| 245 | for (i = 0; i < 0x200; i += 4) | 244 | for (i = 0; i < 0x200; i += 4) |
| 246 | nv_wo32(priv->user.mem, usermem + i, 0x00000000); | 245 | nv_wo32(priv->user.mem, usermem + i, 0x00000000); |
diff --git a/drivers/gpu/drm/nouveau/core/include/core/math.h b/drivers/gpu/drm/nouveau/core/include/core/math.h deleted file mode 100644 index f808131c5cd8..000000000000 --- a/drivers/gpu/drm/nouveau/core/include/core/math.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | #ifndef __NOUVEAU_MATH_H__ | ||
| 2 | #define __NOUVEAU_MATH_H__ | ||
| 3 | |||
| 4 | static inline int | ||
| 5 | log2i(u64 base) | ||
| 6 | { | ||
| 7 | u64 temp = base >> 1; | ||
| 8 | int log2; | ||
| 9 | |||
| 10 | for (log2 = 0; temp; log2++, temp >>= 1) { | ||
| 11 | } | ||
| 12 | |||
| 13 | return (base & (base - 1)) ? log2 + 1: log2; | ||
| 14 | } | ||
| 15 | |||
| 16 | #endif | ||
diff --git a/drivers/gpu/drm/nouveau/core/os.h b/drivers/gpu/drm/nouveau/core/os.h index 3bd9be2ab37f..d48683a82585 100644 --- a/drivers/gpu/drm/nouveau/core/os.h +++ b/drivers/gpu/drm/nouveau/core/os.h | |||
| @@ -13,11 +13,12 @@ | |||
| 13 | #include <linux/i2c-algo-bit.h> | 13 | #include <linux/i2c-algo-bit.h> |
| 14 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
| 15 | #include <linux/io-mapping.h> | 15 | #include <linux/io-mapping.h> |
| 16 | #include <linux/vmalloc.h> | ||
| 17 | #include <linux/acpi.h> | 16 | #include <linux/acpi.h> |
| 17 | #include <linux/vmalloc.h> | ||
| 18 | #include <linux/dmi.h> | 18 | #include <linux/dmi.h> |
| 19 | #include <linux/reboot.h> | 19 | #include <linux/reboot.h> |
| 20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
| 21 | #include <linux/log2.h> | ||
| 21 | 22 | ||
| 22 | #include <asm/unaligned.h> | 23 | #include <asm/unaligned.h> |
| 23 | 24 | ||
