[3/6] kms/nv50: add core957d class

Submitted by Karol Herbst on July 20, 2018, 3:17 p.m.

Details

Message ID 20180720151729.30291-4-kherbst@redhat.com
State New
Headers show
Series "improve feature detection" ( rev: 1 ) in Nouveau

Not browsing as part of any series.

Commit Message

Karol Herbst July 20, 2018, 3:17 p.m.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
---
 drm/nouveau/dispnv50/Kbuild     |  1 +
 drm/nouveau/dispnv50/core.c     |  6 ++---
 drm/nouveau/dispnv50/core.h     |  2 ++
 drm/nouveau/dispnv50/core957d.c | 42 +++++++++++++++++++++++++++++++++
 4 files changed, 48 insertions(+), 3 deletions(-)
 create mode 100644 drm/nouveau/dispnv50/core957d.c

Patch hide | download patch | download mbox

diff --git a/drm/nouveau/dispnv50/Kbuild b/drm/nouveau/dispnv50/Kbuild
index 849b0f45..c3dee4d0 100644
--- a/drm/nouveau/dispnv50/Kbuild
+++ b/drm/nouveau/dispnv50/Kbuild
@@ -6,6 +6,7 @@  nouveau-y += dispnv50/core507d.o
 nouveau-y += dispnv50/core827d.o
 nouveau-y += dispnv50/core907d.o
 nouveau-y += dispnv50/core917d.o
+nouveau-y += dispnv50/core957d.o
 nouveau-y += dispnv50/corec37d.o
 
 nouveau-y += dispnv50/dac507d.o
diff --git a/drm/nouveau/dispnv50/core.c b/drm/nouveau/dispnv50/core.c
index f3c49adb..ba453afb 100644
--- a/drm/nouveau/dispnv50/core.c
+++ b/drm/nouveau/dispnv50/core.c
@@ -43,9 +43,9 @@  nv50_core_new(struct nouveau_drm *drm, struct nv50_core **pcore)
 		int (*new)(struct nouveau_drm *, s32, struct nv50_core **);
 	} cores[] = {
 		{ GV100_DISP_CORE_CHANNEL_DMA, 0, corec37d_new },
-		{ GP102_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
-		{ GP100_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
-		{ GM200_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
+		{ GP102_DISP_CORE_CHANNEL_DMA, 0, core957d_new },
+		{ GP100_DISP_CORE_CHANNEL_DMA, 0, core957d_new },
+		{ GM200_DISP_CORE_CHANNEL_DMA, 0, core957d_new },
 		{ GM107_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
 		{ GK110_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
 		{ GK104_DISP_CORE_CHANNEL_DMA, 0, core917d_new },
diff --git a/drm/nouveau/dispnv50/core.h b/drm/nouveau/dispnv50/core.h
index 16274bb2..a156be6e 100644
--- a/drm/nouveau/dispnv50/core.h
+++ b/drm/nouveau/dispnv50/core.h
@@ -55,6 +55,8 @@  bool core907d_caps_parse(struct nv50_disp *, struct nv50_core_caps *);
 
 int core917d_new(struct nouveau_drm *, s32, struct nv50_core **);
 
+int core957d_new(struct nouveau_drm *, s32, struct nv50_core **);
+
 int corec37d_new(struct nouveau_drm *, s32, struct nv50_core **);
 extern const struct nv50_outp_func sorc37d;
 #endif
diff --git a/drm/nouveau/dispnv50/core957d.c b/drm/nouveau/dispnv50/core957d.c
new file mode 100644
index 00000000..a31b1941
--- /dev/null
+++ b/drm/nouveau/dispnv50/core957d.c
@@ -0,0 +1,42 @@ 
+/*
+ * Copyright 2018 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 "core.h"
+#include "head.h"
+
+static const struct nv50_core_func
+core957d = {
+	.init = core507d_init,
+	.ntfy_init = core507d_ntfy_init,
+	.ntfy_wait_done = core507d_ntfy_wait_done,
+	.update = core507d_update,
+	.caps_fetch = core507d_caps_fetch,
+	.caps_parse = core907d_caps_parse,
+	.head = &head917d,
+	.dac = &dac907d,
+	.sor = &sor907d,
+};
+
+int
+core957d_new(struct nouveau_drm *drm, s32 oclass, struct nv50_core **pcore)
+{
+	return core507d_new_(&core957d, drm, oclass, pcore);
+}