Skip to contentSkip to conversation

Prepare the way for performance counters in perfmon

PATCH New Samuel Pitoiset 1 participant 4 messages Sep 15, 2014 1 message not in the archive Library code

lore
Share & tools
lore
#0 lore raw

Hi folks,

This set of patches is just for clearing the way before introducing the infrastructure for performance counters in perfmon.

I'll try to publish a new version of my kernel interface based on nvif in a couple of days.

See you.

A message that is not in the archive (sent off-list or not yet received): 1410780342-2808-1-git-send-email-samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw

PATCH 1/3 lib: fix devices selection using -a

---
 lib/kern.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/kern.c +1 -1
index 930cd35..7e8f3e9 100644
@@ -173,7 +173,7 @@ drm_client_init(const char *name, u64 device, const char *cfg,
 	if (ret = -ENOMEM, !(drm = *ppriv = malloc(sizeof(*drm))))
 		goto fail;
 
-	for (minor = DRM_RENDER_MIN; minor <= DRM_RENDER_MAX; minor++) {
+	for (minor = DRM_RENDER_MIN + device; minor <= DRM_RENDER_MAX; minor++) {
 		snprintf(path, sizeof(path), "/dev/dri/renderD%d", minor);
 		if ((drm->fd = open(path, O_RDWR, 0)) < 0)
 			continue;
Signature · 1 line
2.0.0
#3 lore raw

PATCH 2/3 perfmon: remove unused nouveau_perfsig_wrap() function

In reply to a message not in the archive
---
 nvkm/engine/perfmon/base.c | 20 --------------------
 nvkm/engine/perfmon/priv.h |  3 ---
 2 files changed, 23 deletions(-)
nvkm/engine/perfmon/base.c +0 -20
index 5fa45e1..b74734e 100644
@@ -80,26 +80,6 @@ nouveau_perfsig_find(struct nouveau_perfmon *ppm, const char *name, u32 size,
 	return nouveau_perfsig_find_(dom, name, size);
 }
 
-struct nouveau_perfctr *
-nouveau_perfsig_wrap(struct nouveau_perfmon *ppm, const char *name,
-		     struct nouveau_perfdom **pdom)
-{
-	struct nouveau_perfsig *sig;
-	struct nouveau_perfctr *ctr;
-
-	sig = nouveau_perfsig_find(ppm, name, strlen(name), pdom);
-	if (!sig)
-		return NULL;
-
-	ctr = kzalloc(sizeof(*ctr), GFP_KERNEL);
-	if (ctr) {
-		ctr->signal[0] = sig;
-		ctr->logic_op = 0xaaaa;
-	}
-
-	return ctr;
-}
-
 /*******************************************************************************
  * Perfmon object classes
  ******************************************************************************/
nvkm/engine/perfmon/priv.h +0 -3
index 0ac8714..9e27ff5 100644
@@ -31,9 +31,6 @@ struct nouveau_perfsig {
 };
 
 struct nouveau_perfdom;
-struct nouveau_perfctr *
-nouveau_perfsig_wrap(struct nouveau_perfmon *, const char *,
-		     struct nouveau_perfdom **);
 
 struct nouveau_specdom {
 	u16 signal_nr;
Signature · 1 line
2.0.0
#4 lore raw

PATCH 3/3 perfmon: remove PDAEMON signals

In reply to a message not in the archive

As discussed with Martin Peres, PDAEMON signals should be exposed through sysfs and not managed by the perfmon engine which is only used for performance counters.

---
 drm/Kbuild                       |   1 -
 drm/core/engine/perfmon/daemon.c |   1 -
 nvkm/engine/perfmon/Makefile.am  |   1 -
 nvkm/engine/perfmon/daemon.c     | 109 ---------------------------------------
 nvkm/engine/perfmon/nva3.c       |  20 +------
 nvkm/engine/perfmon/nvc0.c       |   6 ---
 nvkm/engine/perfmon/nve0.c       |   7 ---
 nvkm/engine/perfmon/nvf0.c       |   5 --
 nvkm/engine/perfmon/priv.h       |   4 --
 nvkm/include/engine/perfmon.h    |   4 --
 10 files changed, 1 insertion(+), 157 deletions(-)
 delete mode 120000 drm/core/engine/perfmon/daemon.c
 delete mode 100644 nvkm/engine/perfmon/daemon.c
drm/Kbuild +0 -1
index 949a034..b63c0ed 100644
@@ -319,7 +319,6 @@ nouveau-y += core/engine/mpeg/nv44.o
 nouveau-y += core/engine/mpeg/nv50.o
 nouveau-y += core/engine/mpeg/nv84.o
 nouveau-y += core/engine/perfmon/base.o
-nouveau-y += core/engine/perfmon/daemon.o
 nouveau-y += core/engine/perfmon/nv40.o
 nouveau-y += core/engine/perfmon/nv50.o
 nouveau-y += core/engine/perfmon/nv84.o
drm/core/engine/perfmon/daemon.c deleted +0 -1
deleted file mode 120000
index 3351142..0000000
@@ -1 +0,0 @@
-../../../../nvkm/engine/perfmon/daemon.c
\ No newline at end of file
nvkm/engine/perfmon/Makefile.am +0 -1
index f6e2279..48e3801 100644
@@ -1,7 +1,6 @@
 noinst_LTLIBRARIES = libperfmon.la
 
 libperfmon_la_SOURCES = base.c \
-			daemon.c \
 			nv40.c \
 			nv50.c \
 			nv84.c \
nvkm/engine/perfmon/daemon.c deleted +0 -109

109 lines not on this page · raw message

nvkm/engine/perfmon/nva3.c +1 -19
index 6197ebd..43e17cd 100644
@@ -65,29 +65,11 @@ nva3_perfmon[] = {
 	{}
 };
 
-static int
-nva3_perfmon_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-		  struct nouveau_oclass *oclass, void *data, u32 size,
-		  struct nouveau_object **object)
-{
-	int ret = nv40_perfmon_ctor(parent, engine, oclass, data, size, object);
-	if (ret == 0) {
-		struct nv40_perfmon_priv *priv = (void *)*object;
-		ret = nouveau_perfdom_new(&priv->base, "pwr", 0, 0, 0, 0,
-					   nva3_perfmon_pwr);
-		if (ret)
-			return ret;
-
-		priv->base.last = 3;
-	}
-	return ret;
-}
-
 struct nouveau_oclass *
 nva3_perfmon_oclass = &(struct nv40_perfmon_oclass) {
 	.base.handle = NV_ENGINE(PERFMON, 0xa3),
 	.base.ofuncs = &(struct nouveau_ofuncs) {
-		.ctor = nva3_perfmon_ctor,
+		.ctor = nv40_perfmon_ctor,
 		.dtor = _nouveau_perfmon_dtor,
 		.init = _nouveau_perfmon_init,
 		.fini = _nouveau_perfmon_fini,
nvkm/engine/perfmon/nvc0.c +0 -6
index 74b2410..420d42f 100644
@@ -124,11 +124,6 @@ nvc0_perfmon_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 	if (ret)
 		return ret;
 
-	ret = nouveau_perfdom_new(&priv->base, "pwr", 0, 0, 0, 0,
-				   nvc0_perfmon_pwr);
-	if (ret)
-		return ret;
-
 	/* HUB */
 	ret = nouveau_perfdom_new(&priv->base, "hub", 0, 0x1b0000, 0, 0x200,
 				   nvc0_perfmon_hub);
@@ -157,7 +152,6 @@ nvc0_perfmon_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 
 	nv_engine(priv)->cclass = &nouveau_perfmon_cclass;
 	nv_engine(priv)->sclass =  nouveau_perfmon_sclass;
-	priv->base.last = 7;
 	return 0;
 }
 
nvkm/engine/perfmon/nve0.c +0 -7
index 71d718c..333a282 100644
@@ -112,12 +112,6 @@ nve0_perfmon_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 	if (ret)
 		return ret;
 
-	/* PDAEMON */
-	ret = nouveau_perfdom_new(&priv->base, "pwr", 0, 0, 0, 0,
-				   nve0_perfmon_pwr);
-	if (ret)
-		return ret;
-
 	/* HUB */
 	ret = nouveau_perfdom_new(&priv->base, "hub", 0, 0x1b0000, 0, 0x200,
 				   nve0_perfmon_hub);
@@ -146,7 +140,6 @@ nve0_perfmon_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 
 	nv_engine(priv)->cclass = &nouveau_perfmon_cclass;
 	nv_engine(priv)->sclass =  nouveau_perfmon_sclass;
-	priv->base.last = 7;
 	return 0;
 }
 
nvkm/engine/perfmon/nvf0.c +0 -5
index 47256f7..c3a0d30 100644
@@ -49,11 +49,6 @@ nvf0_perfmon_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
 	if (ret)
 		return ret;
 
-	ret = nouveau_perfdom_new(&priv->base, "pwr", 0, 0, 0, 0,
-				   nve0_perfmon_pwr);
-	if (ret)
-		return ret;
-
 	nv_engine(priv)->cclass = &nouveau_perfmon_cclass;
 	nv_engine(priv)->sclass =  nouveau_perfmon_sclass;
 	return 0;
nvkm/engine/perfmon/priv.h +0 -4
index 9e27ff5..f32fe71 100644
@@ -38,10 +38,6 @@ struct nouveau_specdom {
 	const struct nouveau_funcdom *func;
 };
 
-extern const struct nouveau_specdom nva3_perfmon_pwr[];
-extern const struct nouveau_specdom nvc0_perfmon_pwr[];
-extern const struct nouveau_specdom nve0_perfmon_pwr[];
-
 struct nouveau_perfdom {
 	struct list_head head;
 	struct list_head list;
nvkm/include/engine/perfmon.h +0 -4
index 88cc812..0cc2430 100644
@@ -15,10 +15,6 @@ struct nouveau_perfmon {
 
 	struct list_head domains;
 	u32 sequence;
-
-	/*XXX: temp for daemon backend */
-	u32 pwr[8];
-	u32 last;
 };
 
 static inline struct nouveau_perfmon *
Signature · 1 line
2.0.0