60fd626
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
60fd626
From: Ben Skeggs <bskeggs@redhat.com>
60fd626
Date: Wed, 6 May 2020 14:40:58 +1000
60fd626
Subject: [PATCH] disp/hda/gf119-: select HDA device entry based on bound head
60fd626
60fd626
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
60fd626
---
60fd626
 drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c | 7 ++++---
60fd626
 1 file changed, 4 insertions(+), 3 deletions(-)
60fd626
60fd626
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
60fd626
index 8a0ec7db5145..19d2d58344e4 100644
60fd626
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
60fd626
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/hdagf119.c
60fd626
@@ -28,14 +28,14 @@ gf119_hda_device_entry(struct nvkm_ior *ior, int head)
60fd626
 {
60fd626
 	struct nvkm_device *device = ior->disp->engine.subdev.device;
60fd626
 	const u32 hoff = 0x800 * head;
60fd626
-	nvkm_mask(device, 0x616548 + hoff, 0x00000070, 0x00000000);
60fd626
+	nvkm_mask(device, 0x616548 + hoff, 0x00000070, head << 4);
60fd626
 }
60fd626
60fd626
 void
60fd626
 gf119_hda_eld(struct nvkm_ior *ior, int head, u8 *data, u8 size)
60fd626
 {
60fd626
 	struct nvkm_device *device = ior->disp->engine.subdev.device;
60fd626
-	const u32 soff = 0x030 * ior->id;
60fd626
+	const u32 soff = 0x030 * ior->id + (head * 0x04);
60fd626
 	int i;
60fd626
60fd626
 	for (i = 0; i < size; i++)
60fd626
@@ -49,6 +49,7 @@ void
60fd626
 gf119_hda_hpd(struct nvkm_ior *ior, int head, bool present)
60fd626
 {
60fd626
 	struct nvkm_device *device = ior->disp->engine.subdev.device;
60fd626
+	const u32 soff = 0x030 * ior->id + (head * 0x04);
60fd626
 	u32 data = 0x80000000;
60fd626
 	u32 mask = 0x80000001;
60fd626
 	if (present) {
60fd626
@@ -57,5 +58,5 @@ gf119_hda_hpd(struct nvkm_ior *ior, int head, bool present)
60fd626
 	} else {
60fd626
 		mask |= 0x00000002;
60fd626
 	}
60fd626
-	nvkm_mask(device, 0x10ec10 + ior->id * 0x030, mask, data);
60fd626
+	nvkm_mask(device, 0x10ec10 + soff, mask, data);
60fd626
 }
60fd626
-- 
60fd626
2.26.2
60fd626