Skip to contentSkip to conversation

drm/nv50: include vp in the fb error reporting mask

PATCH New Ilia Mirkin 1 participant 3 messages Jul 27, 2013 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/nv50: include vp in the fb error reporting mask

---

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(-)
drivers/gpu/drm/nouveau/core/subdev/mc/nv50.c +1 -1
index 0cb322a..f25fc5f 100644
@@ -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 },
 	{},
 };
 
Signature · 1 line
1.8.1.5

A message that is not in the archive (sent off-list or not yet received): 1374899221-11511-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

#2 lore raw

PATCH 2/3 drm/nouveau: get rid of math.h, replace log2i with order_base_2

---

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
drivers/gpu/drm/nouveau/core/core/ramht.c +3 -2
index 86a6404..5596ebe 100644
@@ -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;
 }
drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c +3 -2
index e9b8217..267532e 100644
@@ -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);
drivers/gpu/drm/nouveau/core/engine/fifo/nv84.c +3 -2
index d4ed3b4..4cd4e14 100644
@@ -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);
drivers/gpu/drm/nouveau/core/engine/fifo/nvc0.c +3 -2
index 46dfa68..51a5226 100644
@@ -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);
drivers/gpu/drm/nouveau/core/engine/fifo/nve0.c +3 -2
index 09644fa..a821ca3 100644
@@ -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);
drivers/gpu/drm/nouveau/core/include/core/math.h deleted +0 -16
deleted file mode 100644
index f808131..0000000
@@ -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
Signature · 1 line
1.8.1.5
#3 lore raw

PATCH 3/3 drm/nv31/mpeg: fix mpeg engine initialization

In reply to a message not in the archive

object->engine is null, which leads to a null deref down the line

---

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(-)
drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c +2 -2
index 49ecbb8..9f7c7d5 100644
@@ -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;
 
Signature · 1 line
1.8.1.5