Ilia Mirkin
2013-Jul-27 04:26 UTC
[Nouveau] [PATCH 1/3] drm/nv50: include vp in the fb error reporting mask
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
Not 100% sure that this is needed, but BSP/MPEG are in the mask.
drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c
b/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c
index 0cb322a..f25fc5f 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c
@@ -41,7 +41,7 @@ nv50_mc_intr[] = {
{ 0x04000000, NVDEV_ENGINE_DISP },
{ 0x10000000, NVDEV_SUBDEV_BUS },
{ 0x80000000, NVDEV_ENGINE_SW },
- { 0x0000d101, NVDEV_SUBDEV_FB },
+ { 0x0002d101, NVDEV_SUBDEV_FB },
{},
};
--
1.8.1.5
Ilia Mirkin
2013-Jul-27 04:27 UTC
[Nouveau] [PATCH 2/3] drm/nouveau: get rid of math.h, replace log2i with order_base_2
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
Fairly sure that the functions are the same, I pulled both
implementations into a standalone C program and compared. It's nice to
use the shared implementations, IMO.
drivers/gpu/drm/nouveau/core/core/ramht.c | 5 +++--
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c | 5 +++--
drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c | 5 +++--
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c | 5 +++--
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c | 5 +++--
drivers/gpu/drm/nouveau/core/include/core/math.h | 16 ----------------
6 files changed, 15 insertions(+), 26 deletions(-)
delete mode 100644 drivers/gpu/drm/nouveau/core/include/core/math.h
diff --git a/drivers/gpu/drm/nouveau/core/core/ramht.c
b/drivers/gpu/drm/nouveau/core/core/ramht.c
index 86a6404..5596ebe 100644
--- a/drivers/gpu/drm/nouveau/core/core/ramht.c
+++ b/drivers/gpu/drm/nouveau/core/core/ramht.c
@@ -20,9 +20,10 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
+#include <linux/log2.h>
+
#include <core/object.h>
#include <core/ramht.h>
-#include <core/math.h>
#include <subdev/bar.h>
@@ -104,6 +105,6 @@ nouveau_ramht_new(struct nouveau_object *parent, struct
nouveau_object *pargpu,
if (ret)
return ret;
- ramht->bits = log2i(nv_gpuobj(ramht)->size >> 3);
+ ramht->bits = order_base_2(nv_gpuobj(ramht)->size >> 3);
return 0;
}
diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
index e9b8217..267532e 100644
--- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c
@@ -22,11 +22,12 @@
* Authors: Ben Skeggs
*/
+#include <linux/log2.h>
+
#include <core/client.h>
#include <core/engctx.h>
#include <core/ramht.h>
#include <core/class.h>
-#include <core/math.h>
#include <subdev/timer.h>
#include <subdev/bar.h>
@@ -278,7 +279,7 @@ nv50_fifo_chan_ctor_ind(struct nouveau_object *parent,
return ret;
ioffset = args->ioffset;
- ilength = log2i(args->ilength / 8);
+ ilength = order_base_2(args->ilength / 8);
nv_wo32(base->ramfc, 0x3c, 0x403f6078);
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 d4ed3b4..4cd4e14 100644
--- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
+++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c
@@ -22,13 +22,14 @@
* Authors: Ben Skeggs
*/
+#include <linux/log2.h>
+
#include <core/os.h>
#include <core/client.h>
#include <core/engctx.h>
#include <core/ramht.h>
#include <core/event.h>
#include <core/class.h>
-#include <core/math.h>
#include <subdev/timer.h>
#include <subdev/bar.h>
@@ -260,7 +261,7 @@ nv84_fifo_chan_ctor_ind(struct nouveau_object *parent,
nv_parent(chan)->object_detach = nv50_fifo_object_detach;
ioffset = args->ioffset;
- ilength = log2i(args->ilength / 8);
+ ilength = order_base_2(args->ilength / 8);
nv_wo32(base->ramfc, 0x3c, 0x403f6078);
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 46dfa68..51a5226 100644
--- a/drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c
@@ -22,6 +22,8 @@
* Authors: Ben Skeggs
*/
+#include <linux/log2.h>
+
#include <core/client.h>
#include <core/handle.h>
#include <core/namedb.h>
@@ -29,7 +31,6 @@
#include <core/engctx.h>
#include <core/event.h>
#include <core/class.h>
-#include <core/math.h>
#include <core/enum.h>
#include <subdev/timer.h>
@@ -200,7 +201,7 @@ nvc0_fifo_chan_ctor(struct nouveau_object *parent,
usermem = chan->base.chid * 0x1000;
ioffset = args->ioffset;
- ilength = log2i(args->ilength / 8);
+ ilength = order_base_2(args->ilength / 8);
for (i = 0; i < 0x1000; i += 4)
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 09644fa..a821ca3 100644
--- a/drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
+++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c
@@ -22,6 +22,8 @@
* Authors: Ben Skeggs
*/
+#include <linux/log2.h>
+
#include <core/client.h>
#include <core/handle.h>
#include <core/namedb.h>
@@ -29,7 +31,6 @@
#include <core/engctx.h>
#include <core/event.h>
#include <core/class.h>
-#include <core/math.h>
#include <core/enum.h>
#include <subdev/timer.h>
@@ -240,7 +241,7 @@ nve0_fifo_chan_ctor(struct nouveau_object *parent,
usermem = chan->base.chid * 0x200;
ioffset = args->ioffset;
- ilength = log2i(args->ilength / 8);
+ ilength = order_base_2(args->ilength / 8);
for (i = 0; i < 0x200; i += 4)
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 f808131..0000000
--- a/drivers/gpu/drm/nouveau/core/include/core/math.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef __NOUVEAU_MATH_H__
-#define __NOUVEAU_MATH_H__
-
-static inline int
-log2i(u64 base)
-{
- u64 temp = base >> 1;
- int log2;
-
- for (log2 = 0; temp; log2++, temp >>= 1) {
- }
-
- return (base & (base - 1)) ? log2 + 1: log2;
-}
-
-#endif
--
1.8.1.5
Ilia Mirkin
2013-Jul-27 04:27 UTC
[Nouveau] [PATCH 3/3] drm/nv31/mpeg: fix mpeg engine initialization
object->engine is null, which leads to a null deref down the line
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
This fixes loading the mpeg class on my nv44 card, although things
still don't work. (Likely due to a mesa-related bug.)
I guess this should apply to stable branches starting with 3.7...
drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
index 49ecbb8..9f7c7d5 100644
--- a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
+++ b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
@@ -265,8 +265,8 @@ nv31_mpeg_ctor(struct nouveau_object *parent, struct
nouveau_object *engine,
int
nv31_mpeg_init(struct nouveau_object *object)
{
- struct nouveau_engine *engine = nv_engine(object->engine);
- struct nv31_mpeg_priv *priv = (void *)engine;
+ struct nouveau_engine *engine = nv_engine(object);
+ struct nv31_mpeg_priv *priv = (void *)object;
struct nouveau_fb *pfb = nouveau_fb(object);
int ret, i;
--
1.8.1.5
Possibly Parallel Threads
- [PATCH] drm/nouveau: don't hold spin lock while calling kzalloc with GFP_KERNEL
- [PATCH 0/6] drm/nouveau: Preparatory work for GV11B support
- [PATCH] nouveau: Load firmware for BSP/VP engines on NV84-NV96, NVA0
- [PATCH 1/5] drm/nv31/mpeg: no need to set compat mode differently for nv44 gr
- [PATCH 10/21] nouveau: Add support for ARB_sampler_object