Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6234fc0f authored by Eric Anholt's avatar Eric Anholt
Browse files

drm/vc4: Make sure that the v3d ident debugfs has vc4's power on.



Otherwise, you sometimes decode the ident fields based on 0xdeadbeef
register reads.

Signed-off-by: default avatarEric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190220210343.28157-7-eric@anholt.net


Reviewed-by: default avatarPaul Kocialkowski <paul.kocialkowski@bootlin.com>
parent cb74f6ee
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -121,6 +121,9 @@ int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused)
	struct drm_info_node *node = (struct drm_info_node *)m->private;
	struct drm_device *dev = node->minor->dev;
	struct vc4_dev *vc4 = to_vc4_dev(dev);
	int ret = vc4_v3d_pm_get(vc4);

	if (ret == 0) {
		uint32_t ident1 = V3D_READ(V3D_IDENT1);
		uint32_t nslc = VC4_GET_FIELD(ident1, V3D_IDENT1_NSLC);
		uint32_t tups = VC4_GET_FIELD(ident1, V3D_IDENT1_TUPS);
@@ -133,6 +136,8 @@ int vc4_v3d_debugfs_ident(struct seq_file *m, void *unused)
		seq_printf(m, "QPUs:       %d\n", nslc * qups);
		seq_printf(m, "Semaphores: %d\n",
			   VC4_GET_FIELD(ident1, V3D_IDENT1_NSEM));
		vc4_v3d_pm_put(vc4);
	}

	return 0;
}