Skip to contentSkip to conversation

Some minor reclocking fixes

PATCH New Karol Herbst 1 participant 3 messages Jul 14, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover Some minor reclocking fixes

First patch fixes a potential vbios parsing bug on Fermi GPUs, but it may also affect Kepler ones.

Second patch wakes the GPU up whenever the user tries to reclock to prevent the write to the pstate file from freezing.

Karol Herbst (2):
bios/vpstate: There are some fermi vbios with no boost or tdp entry
debugfs: Wake up GPU before doing any reclocking

 drm/nouveau/nouveau_debugfs.c          |  4 ++++
 drm/nouveau/nvkm/subdev/bios/vpstate.c | 10 ++++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
Signature · 6 lines
2.17.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 20180714105209.2528-1-kherbst-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org

#2 lore raw

PATCH 1/2 bios/vpstate: There are some fermi vbios with no boost or tdp entry

From: Karol Herbst <[email protected]>

If the entry size is too small, default to invalid values for both boost_id and tdp_id, so as to default to the base clock in both cases.

---
 drm/nouveau/nvkm/subdev/bios/vpstate.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drm/nouveau/nvkm/subdev/bios/vpstate.c +8 -2
index 20b6fc82..71524548 100644
@@ -58,8 +58,14 @@ nvbios_vpstate_parse(struct nvkm_bios *b, struct nvbios_vpstate_header *h)
 		h->ecount   = nvbios_rd08(b, h->offset + 0x5);
 
 		h->base_id  = nvbios_rd08(b, h->offset + 0x0f);
-		h->boost_id = nvbios_rd08(b, h->offset + 0x10);
-		h->tdp_id   = nvbios_rd08(b, h->offset + 0x11);
+		if (h->hlen > 0x10)
+			h->boost_id = nvbios_rd08(b, h->offset + 0x10);
+		else
+			h->boost_id = 0xff;
+		if (h->hlen > 0x11)
+			h->tdp_id = nvbios_rd08(b, h->offset + 0x11);
+		else
+			h->tdp_id = 0xff;
 		return 0;
 	default:
 		return -EINVAL;
Signature · 6 lines
2.17.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau
#3 lore raw

PATCH 2/2 debugfs: Wake up GPU before doing any reclocking

In reply to a message not in the archive

From: Karol Herbst <[email protected]>

Fixes various reclocking related issues on prime systems.

---
 drm/nouveau/nouveau_debugfs.c | 4 ++++
 1 file changed, 4 insertions(+)
drm/nouveau/nouveau_debugfs.c +4 -0
index 963a4dba..9109b69c 100644
@@ -160,7 +160,11 @@ nouveau_debugfs_pstate_set(struct file *file, const char __user *ubuf,
 		args.ustate = value;
 	}
 
+	ret = pm_runtime_get_sync(drm->dev);
+	if (IS_ERR_VALUE(ret) && ret != -EACCES)
+		return ret;
 	ret = nvif_mthd(ctrl, NVIF_CONTROL_PSTATE_USER, &args, sizeof(args));
+	pm_runtime_put_autosuspend(drm->dev);
 	if (ret < 0)
 		return ret;
 
Signature · 6 lines
2.17.1

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau