drm/nouveau/disp/gp100: split SOR implementation from gm200
authorBen Skeggs <bskeggs@redhat.com>
Thu, 4 Jun 2020 04:22:32 +0000 (14:22 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 4 Jun 2020 04:23:21 +0000 (14:23 +1000)
GP100 needs different HDA detection.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild
drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/gp102.c
drivers/gpu/drm/nouveau/nvkm/engine/disp/ior.h
drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgp100.c [new file with mode: 0644]

index 571687b..cf07531 100644 (file)
@@ -39,6 +39,7 @@ nvkm-y += nvkm/engine/disp/sorgf119.o
 nvkm-y += nvkm/engine/disp/sorgk104.o
 nvkm-y += nvkm/engine/disp/sorgm107.o
 nvkm-y += nvkm/engine/disp/sorgm200.o
+nvkm-y += nvkm/engine/disp/sorgp100.o
 nvkm-y += nvkm/engine/disp/sorgv100.o
 nvkm-y += nvkm/engine/disp/sortu102.o
 
index fd62166..8471de3 100644 (file)
@@ -36,7 +36,7 @@ gp100_disp = {
        .super = gf119_disp_super,
        .root = &gp100_disp_root_oclass,
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
-       .sor = { .cnt = gf119_sor_cnt, .new = gm200_sor_new },
+       .sor = { .cnt = gf119_sor_cnt, .new = gp100_sor_new },
 };
 
 int
index 3468dde..a3779c5 100644 (file)
@@ -63,7 +63,7 @@ gp102_disp = {
        .super = gf119_disp_super,
        .root = &gp102_disp_root_oclass,
        .head = { .cnt = gf119_head_cnt, .new = gf119_head_new },
-       .sor = { .cnt = gf119_sor_cnt, .new = gm200_sor_new },
+       .sor = { .cnt = gf119_sor_cnt, .new = gp100_sor_new },
 };
 
 int
index c1d7a36..1a200a9 100644 (file)
@@ -201,6 +201,7 @@ int gf119_sor_new(struct nvkm_disp *, int);
 int gk104_sor_new(struct nvkm_disp *, int);
 int gm107_sor_new(struct nvkm_disp *, int);
 int gm200_sor_new(struct nvkm_disp *, int);
+int gp100_sor_new(struct nvkm_disp *, int);
 
 int gv100_sor_cnt(struct nvkm_disp *, unsigned long *);
 int gv100_sor_new(struct nvkm_disp *, int);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgp100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/sorgp100.c
new file mode 100644 (file)
index 0000000..94feb91
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2020 Red Hat Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+#include "ior.h"
+
+static const struct nvkm_ior_func
+gp100_sor = {
+       .route = {
+               .get = gm200_sor_route_get,
+               .set = gm200_sor_route_set,
+       },
+       .state = gf119_sor_state,
+       .power = nv50_sor_power,
+       .clock = gf119_sor_clock,
+       .hdmi = {
+               .ctrl = gk104_hdmi_ctrl,
+               .scdc = gm200_hdmi_scdc,
+       },
+       .dp = {
+               .lanes = { 0, 1, 2, 3 },
+               .links = gf119_sor_dp_links,
+               .power = g94_sor_dp_power,
+               .pattern = gm107_sor_dp_pattern,
+               .drive = gm200_sor_dp_drive,
+               .vcpi = gf119_sor_dp_vcpi,
+               .audio = gf119_sor_dp_audio,
+               .audio_sym = gf119_sor_dp_audio_sym,
+               .watermark = gf119_sor_dp_watermark,
+       },
+       .hda = {
+               .hpd = gf119_hda_hpd,
+               .eld = gf119_hda_eld,
+               .device_entry = gf119_hda_device_entry,
+       },
+};
+
+int
+gp100_sor_new(struct nvkm_disp *disp, int id)
+{
+       return nvkm_ior_new_(&gp100_sor, disp, SOR, id);
+}