diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2016-07-08 20:41:01 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-07-13 21:53:25 -0400 |
commit | fd47877f77c44f03723dc1d74433a50efdb28ba2 (patch) | |
tree | 5a28158cc1bad62a399d986511ac13880e786484 /drivers | |
parent | 15cec92f4e188679cf9813947938f066bc2eee2d (diff) |
drm/nouveau/disp/gp104: initial support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
25 files changed, 394 insertions, 5 deletions
diff --git a/drivers/gpu/drm/nouveau/include/nvif/class.h b/drivers/gpu/drm/nouveau/include/nvif/class.h index ed71576eedac..37a184353dca 100644 --- a/drivers/gpu/drm/nouveau/include/nvif/class.h +++ b/drivers/gpu/drm/nouveau/include/nvif/class.h | |||
@@ -52,6 +52,7 @@ | |||
52 | #define GM107_DISP /* cl5070.h */ 0x00009470 | 52 | #define GM107_DISP /* cl5070.h */ 0x00009470 |
53 | #define GM200_DISP /* cl5070.h */ 0x00009570 | 53 | #define GM200_DISP /* cl5070.h */ 0x00009570 |
54 | #define GP100_DISP /* cl5070.h */ 0x00009770 | 54 | #define GP100_DISP /* cl5070.h */ 0x00009770 |
55 | #define GP104_DISP /* cl5070.h */ 0x00009870 | ||
55 | 56 | ||
56 | #define NV31_MPEG 0x00003174 | 57 | #define NV31_MPEG 0x00003174 |
57 | #define G82_MPEG 0x00008274 | 58 | #define G82_MPEG 0x00008274 |
@@ -89,6 +90,7 @@ | |||
89 | #define GM107_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000947d | 90 | #define GM107_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000947d |
90 | #define GM200_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000957d | 91 | #define GM200_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000957d |
91 | #define GP100_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000977d | 92 | #define GP100_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000977d |
93 | #define GP104_DISP_CORE_CHANNEL_DMA /* cl507d.h */ 0x0000987d | ||
92 | 94 | ||
93 | #define NV50_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000507e | 95 | #define NV50_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000507e |
94 | #define G82_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000827e | 96 | #define G82_DISP_OVERLAY_CHANNEL_DMA /* cl507e.h */ 0x0000827e |
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h b/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h index c88c15000764..e82049667ce4 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/engine/disp.h | |||
@@ -33,4 +33,5 @@ int gk110_disp_new(struct nvkm_device *, int, struct nvkm_disp **); | |||
33 | int gm107_disp_new(struct nvkm_device *, int, struct nvkm_disp **); | 33 | int gm107_disp_new(struct nvkm_device *, int, struct nvkm_disp **); |
34 | int gm200_disp_new(struct nvkm_device *, int, struct nvkm_disp **); | 34 | int gm200_disp_new(struct nvkm_device *, int, struct nvkm_disp **); |
35 | int gp100_disp_new(struct nvkm_device *, int, struct nvkm_disp **); | 35 | int gp100_disp_new(struct nvkm_device *, int, struct nvkm_disp **); |
36 | int gp104_disp_new(struct nvkm_device *, int, struct nvkm_disp **); | ||
36 | #endif | 37 | #endif |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 6caad22568a2..844bd9951456 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -495,6 +495,7 @@ nouveau_display_create(struct drm_device *dev) | |||
495 | 495 | ||
496 | if (nouveau_modeset != 2 && drm->vbios.dcb.entries) { | 496 | if (nouveau_modeset != 2 && drm->vbios.dcb.entries) { |
497 | static const u16 oclass[] = { | 497 | static const u16 oclass[] = { |
498 | GP104_DISP, | ||
498 | GP100_DISP, | 499 | GP100_DISP, |
499 | GM200_DISP, | 500 | GM200_DISP, |
500 | GM107_DISP, | 501 | GM107_DISP, |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index e871a554398c..7d0edcbcfca7 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -297,6 +297,7 @@ nv50_core_create(struct nvif_device *device, struct nvif_object *disp, | |||
297 | .pushbuf = 0xb0007d00, | 297 | .pushbuf = 0xb0007d00, |
298 | }; | 298 | }; |
299 | static const s32 oclass[] = { | 299 | static const s32 oclass[] = { |
300 | GP104_DISP_CORE_CHANNEL_DMA, | ||
300 | GP100_DISP_CORE_CHANNEL_DMA, | 301 | GP100_DISP_CORE_CHANNEL_DMA, |
301 | GM200_DISP_CORE_CHANNEL_DMA, | 302 | GM200_DISP_CORE_CHANNEL_DMA, |
302 | GM107_DISP_CORE_CHANNEL_DMA, | 303 | GM107_DISP_CORE_CHANNEL_DMA, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index 75c66457a11c..70d2a93991a3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | |||
@@ -2200,6 +2200,7 @@ nv134_chipset = { | |||
2200 | .pci = gp100_pci_new, | 2200 | .pci = gp100_pci_new, |
2201 | .timer = gk20a_timer_new, | 2201 | .timer = gk20a_timer_new, |
2202 | .top = gk104_top_new, | 2202 | .top = gk104_top_new, |
2203 | .disp = gp104_disp_new, | ||
2203 | .dma = gf119_dma_new, | 2204 | .dma = gf119_dma_new, |
2204 | }; | 2205 | }; |
2205 | 2206 | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild index ee26089037ed..77a52b54a31e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild | |||
@@ -11,6 +11,7 @@ nvkm-y += nvkm/engine/disp/gk110.o | |||
11 | nvkm-y += nvkm/engine/disp/gm107.o | 11 | nvkm-y += nvkm/engine/disp/gm107.o |
12 | nvkm-y += nvkm/engine/disp/gm200.o | 12 | nvkm-y += nvkm/engine/disp/gm200.o |
13 | nvkm-y += nvkm/engine/disp/gp100.o | 13 | nvkm-y += nvkm/engine/disp/gp100.o |
14 | nvkm-y += nvkm/engine/disp/gp104.o | ||
14 | 15 | ||
15 | nvkm-y += nvkm/engine/disp/outp.o | 16 | nvkm-y += nvkm/engine/disp/outp.o |
16 | nvkm-y += nvkm/engine/disp/outpdp.o | 17 | nvkm-y += nvkm/engine/disp/outpdp.o |
@@ -47,12 +48,14 @@ nvkm-y += nvkm/engine/disp/rootgk110.o | |||
47 | nvkm-y += nvkm/engine/disp/rootgm107.o | 48 | nvkm-y += nvkm/engine/disp/rootgm107.o |
48 | nvkm-y += nvkm/engine/disp/rootgm200.o | 49 | nvkm-y += nvkm/engine/disp/rootgm200.o |
49 | nvkm-y += nvkm/engine/disp/rootgp100.o | 50 | nvkm-y += nvkm/engine/disp/rootgp100.o |
51 | nvkm-y += nvkm/engine/disp/rootgp104.o | ||
50 | 52 | ||
51 | nvkm-y += nvkm/engine/disp/channv50.o | 53 | nvkm-y += nvkm/engine/disp/channv50.o |
52 | nvkm-y += nvkm/engine/disp/changf119.o | 54 | nvkm-y += nvkm/engine/disp/changf119.o |
53 | 55 | ||
54 | nvkm-y += nvkm/engine/disp/dmacnv50.o | 56 | nvkm-y += nvkm/engine/disp/dmacnv50.o |
55 | nvkm-y += nvkm/engine/disp/dmacgf119.o | 57 | nvkm-y += nvkm/engine/disp/dmacgf119.o |
58 | nvkm-y += nvkm/engine/disp/dmacgp104.o | ||
56 | 59 | ||
57 | nvkm-y += nvkm/engine/disp/basenv50.o | 60 | nvkm-y += nvkm/engine/disp/basenv50.o |
58 | nvkm-y += nvkm/engine/disp/baseg84.o | 61 | nvkm-y += nvkm/engine/disp/baseg84.o |
@@ -61,6 +64,7 @@ nvkm-y += nvkm/engine/disp/basegt215.o | |||
61 | nvkm-y += nvkm/engine/disp/basegf119.o | 64 | nvkm-y += nvkm/engine/disp/basegf119.o |
62 | nvkm-y += nvkm/engine/disp/basegk104.o | 65 | nvkm-y += nvkm/engine/disp/basegk104.o |
63 | nvkm-y += nvkm/engine/disp/basegk110.o | 66 | nvkm-y += nvkm/engine/disp/basegk110.o |
67 | nvkm-y += nvkm/engine/disp/basegp104.o | ||
64 | 68 | ||
65 | nvkm-y += nvkm/engine/disp/corenv50.o | 69 | nvkm-y += nvkm/engine/disp/corenv50.o |
66 | nvkm-y += nvkm/engine/disp/coreg84.o | 70 | nvkm-y += nvkm/engine/disp/coreg84.o |
@@ -73,6 +77,7 @@ nvkm-y += nvkm/engine/disp/coregk110.o | |||
73 | nvkm-y += nvkm/engine/disp/coregm107.o | 77 | nvkm-y += nvkm/engine/disp/coregm107.o |
74 | nvkm-y += nvkm/engine/disp/coregm200.o | 78 | nvkm-y += nvkm/engine/disp/coregm200.o |
75 | nvkm-y += nvkm/engine/disp/coregp100.o | 79 | nvkm-y += nvkm/engine/disp/coregp100.o |
80 | nvkm-y += nvkm/engine/disp/coregp104.o | ||
76 | 81 | ||
77 | nvkm-y += nvkm/engine/disp/ovlynv50.o | 82 | nvkm-y += nvkm/engine/disp/ovlynv50.o |
78 | nvkm-y += nvkm/engine/disp/ovlyg84.o | 83 | nvkm-y += nvkm/engine/disp/ovlyg84.o |
@@ -80,6 +85,7 @@ nvkm-y += nvkm/engine/disp/ovlygt200.o | |||
80 | nvkm-y += nvkm/engine/disp/ovlygt215.o | 85 | nvkm-y += nvkm/engine/disp/ovlygt215.o |
81 | nvkm-y += nvkm/engine/disp/ovlygf119.o | 86 | nvkm-y += nvkm/engine/disp/ovlygf119.o |
82 | nvkm-y += nvkm/engine/disp/ovlygk104.o | 87 | nvkm-y += nvkm/engine/disp/ovlygk104.o |
88 | nvkm-y += nvkm/engine/disp/ovlygp104.o | ||
83 | 89 | ||
84 | nvkm-y += nvkm/engine/disp/piocnv50.o | 90 | nvkm-y += nvkm/engine/disp/piocnv50.o |
85 | nvkm-y += nvkm/engine/disp/piocgf119.o | 91 | nvkm-y += nvkm/engine/disp/piocgf119.o |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/basegp104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/basegp104.c new file mode 100644 index 000000000000..51688e37c54e --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/basegp104.c | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright 2016 Red Hat Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Authors: Ben Skeggs <bskeggs@redhat.com> | ||
23 | */ | ||
24 | #include "dmacnv50.h" | ||
25 | #include "rootnv50.h" | ||
26 | |||
27 | #include <nvif/class.h> | ||
28 | |||
29 | const struct nv50_disp_dmac_oclass | ||
30 | gp104_disp_base_oclass = { | ||
31 | .base.oclass = GK110_DISP_BASE_CHANNEL_DMA, | ||
32 | .base.minver = 0, | ||
33 | .base.maxver = 0, | ||
34 | .ctor = nv50_disp_base_new, | ||
35 | .func = &gp104_disp_dmac_func, | ||
36 | .mthd = &gf119_disp_base_chan_mthd, | ||
37 | .chid = 1, | ||
38 | }; | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h index aee374884c96..f5f683d9fd20 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.h | |||
@@ -85,6 +85,7 @@ extern const struct nv50_disp_mthd_list gf119_disp_core_mthd_pior; | |||
85 | extern const struct nv50_disp_chan_mthd gf119_disp_base_chan_mthd; | 85 | extern const struct nv50_disp_chan_mthd gf119_disp_base_chan_mthd; |
86 | 86 | ||
87 | extern const struct nv50_disp_chan_mthd gk104_disp_core_chan_mthd; | 87 | extern const struct nv50_disp_chan_mthd gk104_disp_core_chan_mthd; |
88 | extern const struct nv50_disp_chan_mthd gk104_disp_ovly_chan_mthd; | ||
88 | 89 | ||
89 | struct nv50_disp_pioc_oclass { | 90 | struct nv50_disp_pioc_oclass { |
90 | int (*ctor)(const struct nv50_disp_chan_func *, | 91 | int (*ctor)(const struct nv50_disp_chan_func *, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c index 6b1dc703dac7..21fbf89b6319 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregf119.c | |||
@@ -171,7 +171,7 @@ gf119_disp_core_chan_mthd = { | |||
171 | } | 171 | } |
172 | }; | 172 | }; |
173 | 173 | ||
174 | static void | 174 | void |
175 | gf119_disp_core_fini(struct nv50_disp_dmac *chan) | 175 | gf119_disp_core_fini(struct nv50_disp_dmac *chan) |
176 | { | 176 | { |
177 | struct nv50_disp *disp = chan->base.root->disp; | 177 | struct nv50_disp *disp = chan->base.root->disp; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregp104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregp104.c new file mode 100644 index 000000000000..6922f4007b61 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/coregp104.c | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * Copyright 2016 Red Hat Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Authors: Ben Skeggs <bskeggs@redhat.com> | ||
23 | */ | ||
24 | #include "dmacnv50.h" | ||
25 | #include "rootnv50.h" | ||
26 | |||
27 | #include <subdev/timer.h> | ||
28 | |||
29 | #include <nvif/class.h> | ||
30 | |||
31 | static int | ||
32 | gp104_disp_core_init(struct nv50_disp_dmac *chan) | ||
33 | { | ||
34 | struct nv50_disp *disp = chan->base.root->disp; | ||
35 | struct nvkm_subdev *subdev = &disp->base.engine.subdev; | ||
36 | struct nvkm_device *device = subdev->device; | ||
37 | |||
38 | /* enable error reporting */ | ||
39 | nvkm_mask(device, 0x6100a0, 0x00000001, 0x00000001); | ||
40 | |||
41 | /* initialise channel for dma command submission */ | ||
42 | nvkm_wr32(device, 0x611494, chan->push); | ||
43 | nvkm_wr32(device, 0x611498, 0x00010000); | ||
44 | nvkm_wr32(device, 0x61149c, 0x00000001); | ||
45 | nvkm_mask(device, 0x610490, 0x00000010, 0x00000010); | ||
46 | nvkm_wr32(device, 0x640000, 0x00000000); | ||
47 | nvkm_wr32(device, 0x610490, 0x01000013); | ||
48 | |||
49 | /* wait for it to go inactive */ | ||
50 | if (nvkm_msec(device, 2000, | ||
51 | if (!(nvkm_rd32(device, 0x610490) & 0x80000000)) | ||
52 | break; | ||
53 | ) < 0) { | ||
54 | nvkm_error(subdev, "core init: %08x\n", | ||
55 | nvkm_rd32(device, 0x610490)); | ||
56 | return -EBUSY; | ||
57 | } | ||
58 | |||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | const struct nv50_disp_dmac_func | ||
63 | gp104_disp_core_func = { | ||
64 | .init = gp104_disp_core_init, | ||
65 | .fini = gf119_disp_core_fini, | ||
66 | .bind = gf119_disp_dmac_bind, | ||
67 | }; | ||
68 | |||
69 | const struct nv50_disp_dmac_oclass | ||
70 | gp104_disp_core_oclass = { | ||
71 | .base.oclass = GP104_DISP_CORE_CHANNEL_DMA, | ||
72 | .base.minver = 0, | ||
73 | .base.maxver = 0, | ||
74 | .ctor = nv50_disp_core_new, | ||
75 | .func = &gp104_disp_core_func, | ||
76 | .mthd = &gk104_disp_core_chan_mthd, | ||
77 | .chid = 0, | ||
78 | }; | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c index 876b14549a58..a57f7cef307a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c | |||
@@ -36,7 +36,7 @@ gf119_disp_dmac_bind(struct nv50_disp_dmac *chan, | |||
36 | chan->base.chid << 27 | 0x00000001); | 36 | chan->base.chid << 27 | 0x00000001); |
37 | } | 37 | } |
38 | 38 | ||
39 | static void | 39 | void |
40 | gf119_disp_dmac_fini(struct nv50_disp_dmac *chan) | 40 | gf119_disp_dmac_fini(struct nv50_disp_dmac *chan) |
41 | { | 41 | { |
42 | struct nv50_disp *disp = chan->base.root->disp; | 42 | struct nv50_disp *disp = chan->base.root->disp; |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgp104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgp104.c new file mode 100644 index 000000000000..ad24c2c57696 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacgp104.c | |||
@@ -0,0 +1,66 @@ | |||
1 | /* | ||
2 | * Copyright 2016 Red Hat Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Authors: Ben Skeggs <bskeggs@redhat.com> | ||
23 | */ | ||
24 | #include "dmacnv50.h" | ||
25 | #include "rootnv50.h" | ||
26 | |||
27 | #include <subdev/timer.h> | ||
28 | |||
29 | static int | ||
30 | gp104_disp_dmac_init(struct nv50_disp_dmac *chan) | ||
31 | { | ||
32 | struct nv50_disp *disp = chan->base.root->disp; | ||
33 | struct nvkm_subdev *subdev = &disp->base.engine.subdev; | ||
34 | struct nvkm_device *device = subdev->device; | ||
35 | int chid = chan->base.chid; | ||
36 | |||
37 | /* enable error reporting */ | ||
38 | nvkm_mask(device, 0x6100a0, 0x00000001 << chid, 0x00000001 << chid); | ||
39 | |||
40 | /* initialise channel for dma command submission */ | ||
41 | nvkm_wr32(device, 0x611494 + (chid * 0x0010), chan->push); | ||
42 | nvkm_wr32(device, 0x611498 + (chid * 0x0010), 0x00010000); | ||
43 | nvkm_wr32(device, 0x61149c + (chid * 0x0010), 0x00000001); | ||
44 | nvkm_mask(device, 0x610490 + (chid * 0x0010), 0x00000010, 0x00000010); | ||
45 | nvkm_wr32(device, 0x640000 + (chid * 0x1000), 0x00000000); | ||
46 | nvkm_wr32(device, 0x610490 + (chid * 0x0010), 0x00000013); | ||
47 | |||
48 | /* wait for it to go inactive */ | ||
49 | if (nvkm_msec(device, 2000, | ||
50 | if (!(nvkm_rd32(device, 0x610490 + (chid * 0x10)) & 0x80000000)) | ||
51 | break; | ||
52 | ) < 0) { | ||
53 | nvkm_error(subdev, "ch %d init: %08x\n", chid, | ||
54 | nvkm_rd32(device, 0x610490 + (chid * 0x10))); | ||
55 | return -EBUSY; | ||
56 | } | ||
57 | |||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | const struct nv50_disp_dmac_func | ||
62 | gp104_disp_dmac_func = { | ||
63 | .init = gp104_disp_dmac_init, | ||
64 | .fini = gf119_disp_dmac_fini, | ||
65 | .bind = gf119_disp_dmac_bind, | ||
66 | }; | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacnv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacnv50.h index c737583e393d..43ac05857853 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacnv50.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dmacnv50.h | |||
@@ -25,8 +25,12 @@ int nv50_disp_dmac_bind(struct nv50_disp_dmac *, struct nvkm_object *, u32); | |||
25 | extern const struct nv50_disp_dmac_func nv50_disp_core_func; | 25 | extern const struct nv50_disp_dmac_func nv50_disp_core_func; |
26 | 26 | ||
27 | extern const struct nv50_disp_dmac_func gf119_disp_dmac_func; | 27 | extern const struct nv50_disp_dmac_func gf119_disp_dmac_func; |
28 | void gf119_disp_dmac_fini(struct nv50_disp_dmac *); | ||
28 | int gf119_disp_dmac_bind(struct nv50_disp_dmac *, struct nvkm_object *, u32); | 29 | int gf119_disp_dmac_bind(struct nv50_disp_dmac *, struct nvkm_object *, u32); |
29 | extern const struct nv50_disp_dmac_func gf119_disp_core_func; | 30 | extern const struct nv50_disp_dmac_func gf119_disp_core_func; |
31 | void gf119_disp_core_fini(struct nv50_disp_dmac *); | ||
32 | |||
33 | extern const struct nv50_disp_dmac_func gp104_disp_dmac_func; | ||
30 | 34 | ||
31 | struct nv50_disp_dmac_oclass { | 35 | struct nv50_disp_dmac_oclass { |
32 | int (*ctor)(const struct nv50_disp_dmac_func *, | 36 | int (*ctor)(const struct nv50_disp_dmac_func *, |
@@ -90,4 +94,8 @@ extern const struct nv50_disp_dmac_oclass gm107_disp_core_oclass; | |||
90 | extern const struct nv50_disp_dmac_oclass gm200_disp_core_oclass; | 94 | extern const struct nv50_disp_dmac_oclass gm200_disp_core_oclass; |
91 | 95 | ||
92 | extern const struct nv50_disp_dmac_oclass gp100_disp_core_oclass; | 96 | extern const struct nv50_disp_dmac_oclass gp100_disp_core_oclass; |
97 | |||
98 | extern const struct nv50_disp_dmac_oclass gp104_disp_core_oclass; | ||
99 | extern const struct nv50_disp_dmac_oclass gp104_disp_base_oclass; | ||
100 | extern const struct nv50_disp_dmac_oclass gp104_disp_ovly_oclass; | ||
93 | #endif | 101 | #endif |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c index 605e4ea669a4..29e84b241cca 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gf119.c | |||
@@ -413,7 +413,7 @@ gf119_disp_intr_supervisor(struct work_struct *work) | |||
413 | nvkm_wr32(device, 0x6101d0, 0x80000000); | 413 | nvkm_wr32(device, 0x6101d0, 0x80000000); |
414 | } | 414 | } |
415 | 415 | ||
416 | static void | 416 | void |
417 | gf119_disp_intr_error(struct nv50_disp *disp, int chid) | 417 | gf119_disp_intr_error(struct nv50_disp *disp, int chid) |
418 | { | 418 | { |
419 | struct nvkm_subdev *subdev = &disp->base.engine.subdev; | 419 | struct nvkm_subdev *subdev = &disp->base.engine.subdev; |
@@ -461,7 +461,7 @@ gf119_disp_intr(struct nv50_disp *disp) | |||
461 | u32 stat = nvkm_rd32(device, 0x61009c); | 461 | u32 stat = nvkm_rd32(device, 0x61009c); |
462 | int chid = ffs(stat) - 1; | 462 | int chid = ffs(stat) - 1; |
463 | if (chid >= 0) | 463 | if (chid >= 0) |
464 | gf119_disp_intr_error(disp, chid); | 464 | disp->func->intr_error(disp, chid); |
465 | intr &= ~0x00000002; | 465 | intr &= ~0x00000002; |
466 | } | 466 | } |
467 | 467 | ||
@@ -505,6 +505,7 @@ gf119_disp_new_(const struct nv50_disp_func *func, struct nvkm_device *device, | |||
505 | static const struct nv50_disp_func | 505 | static const struct nv50_disp_func |
506 | gf119_disp = { | 506 | gf119_disp = { |
507 | .intr = gf119_disp_intr, | 507 | .intr = gf119_disp_intr, |
508 | .intr_error = gf119_disp_intr_error, | ||
508 | .uevent = &gf119_disp_chan_uevent, | 509 | .uevent = &gf119_disp_chan_uevent, |
509 | .super = gf119_disp_intr_supervisor, | 510 | .super = gf119_disp_intr_supervisor, |
510 | .root = &gf119_disp_root_oclass, | 511 | .root = &gf119_disp_root_oclass, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c index a86384b8e388..37f145cf30d7 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk104.c | |||
@@ -27,6 +27,7 @@ | |||
27 | static const struct nv50_disp_func | 27 | static const struct nv50_disp_func |
28 | gk104_disp = { | 28 | gk104_disp = { |
29 | .intr = gf119_disp_intr, | 29 | .intr = gf119_disp_intr, |
30 | .intr_error = gf119_disp_intr_error, | ||
30 | .uevent = &gf119_disp_chan_uevent, | 31 | .uevent = &gf119_disp_chan_uevent, |
31 | .super = gf119_disp_intr_supervisor, | 32 | .super = gf119_disp_intr_supervisor, |
32 | .root = &gk104_disp_root_oclass, | 33 | .root = &gk104_disp_root_oclass, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c index 0d574c7e594a..e14ac946608c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gk110.c | |||
@@ -27,6 +27,7 @@ | |||
27 | static const struct nv50_disp_func | 27 | static const struct nv50_disp_func |
28 | gk110_disp = { | 28 | gk110_disp = { |
29 | .intr = gf119_disp_intr, | 29 | .intr = gf119_disp_intr, |
30 | .intr_error = gf119_disp_intr_error, | ||
30 | .uevent = &gf119_disp_chan_uevent, | 31 | .uevent = &gf119_disp_chan_uevent, |
31 | .super = gf119_disp_intr_supervisor, | 32 | .super = gf119_disp_intr_supervisor, |
32 | .root = &gk110_disp_root_oclass, | 33 | .root = &gk110_disp_root_oclass, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c index f4b9cf8574be..2f2437cc5891 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm107.c | |||
@@ -27,6 +27,7 @@ | |||
27 | static const struct nv50_disp_func | 27 | static const struct nv50_disp_func |
28 | gm107_disp = { | 28 | gm107_disp = { |
29 | .intr = gf119_disp_intr, | 29 | .intr = gf119_disp_intr, |
30 | .intr_error = gf119_disp_intr_error, | ||
30 | .uevent = &gf119_disp_chan_uevent, | 31 | .uevent = &gf119_disp_chan_uevent, |
31 | .super = gf119_disp_intr_supervisor, | 32 | .super = gf119_disp_intr_supervisor, |
32 | .root = &gm107_disp_root_oclass, | 33 | .root = &gm107_disp_root_oclass, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c index 67eec8620719..9f368d4ee61e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gm200.c | |||
@@ -27,6 +27,7 @@ | |||
27 | static const struct nv50_disp_func | 27 | static const struct nv50_disp_func |
28 | gm200_disp = { | 28 | gm200_disp = { |
29 | .intr = gf119_disp_intr, | 29 | .intr = gf119_disp_intr, |
30 | .intr_error = gf119_disp_intr_error, | ||
30 | .uevent = &gf119_disp_chan_uevent, | 31 | .uevent = &gf119_disp_chan_uevent, |
31 | .super = gf119_disp_intr_supervisor, | 32 | .super = gf119_disp_intr_supervisor, |
32 | .root = &gm200_disp_root_oclass, | 33 | .root = &gm200_disp_root_oclass, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c index a252d80ed946..4f81bf31435e 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp100.c | |||
@@ -27,6 +27,7 @@ | |||
27 | static const struct nv50_disp_func | 27 | static const struct nv50_disp_func |
28 | gp100_disp = { | 28 | gp100_disp = { |
29 | .intr = gf119_disp_intr, | 29 | .intr = gf119_disp_intr, |
30 | .intr_error = gf119_disp_intr_error, | ||
30 | .uevent = &gf119_disp_chan_uevent, | 31 | .uevent = &gf119_disp_chan_uevent, |
31 | .super = gf119_disp_intr_supervisor, | 32 | .super = gf119_disp_intr_supervisor, |
32 | .root = &gp100_disp_root_oclass, | 33 | .root = &gp100_disp_root_oclass, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp104.c new file mode 100644 index 000000000000..3bf3380336e4 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/gp104.c | |||
@@ -0,0 +1,81 @@ | |||
1 | /* | ||
2 | * Copyright 2016 Red Hat Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Authors: Ben Skeggs <bskeggs@redhat.com> | ||
23 | */ | ||
24 | #include "nv50.h" | ||
25 | #include "rootnv50.h" | ||
26 | |||
27 | static void | ||
28 | gp104_disp_intr_error(struct nv50_disp *disp, int chid) | ||
29 | { | ||
30 | struct nvkm_subdev *subdev = &disp->base.engine.subdev; | ||
31 | struct nvkm_device *device = subdev->device; | ||
32 | u32 mthd = nvkm_rd32(device, 0x6111f0 + (chid * 12)); | ||
33 | u32 data = nvkm_rd32(device, 0x6111f4 + (chid * 12)); | ||
34 | u32 unkn = nvkm_rd32(device, 0x6111f8 + (chid * 12)); | ||
35 | |||
36 | nvkm_error(subdev, "chid %d mthd %04x data %08x %08x %08x\n", | ||
37 | chid, (mthd & 0x0000ffc), data, mthd, unkn); | ||
38 | |||
39 | if (chid < ARRAY_SIZE(disp->chan)) { | ||
40 | switch (mthd & 0xffc) { | ||
41 | case 0x0080: | ||
42 | nv50_disp_chan_mthd(disp->chan[chid], NV_DBG_ERROR); | ||
43 | break; | ||
44 | default: | ||
45 | break; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | nvkm_wr32(device, 0x61009c, (1 << chid)); | ||
50 | nvkm_wr32(device, 0x6111f0 + (chid * 12), 0x90000000); | ||
51 | } | ||
52 | |||
53 | static const struct nv50_disp_func | ||
54 | gp104_disp = { | ||
55 | .intr = gf119_disp_intr, | ||
56 | .intr_error = gp104_disp_intr_error, | ||
57 | .uevent = &gf119_disp_chan_uevent, | ||
58 | .super = gf119_disp_intr_supervisor, | ||
59 | .root = &gp104_disp_root_oclass, | ||
60 | .head.vblank_init = gf119_disp_vblank_init, | ||
61 | .head.vblank_fini = gf119_disp_vblank_fini, | ||
62 | .head.scanoutpos = gf119_disp_root_scanoutpos, | ||
63 | .outp.internal.crt = nv50_dac_output_new, | ||
64 | .outp.internal.tmds = nv50_sor_output_new, | ||
65 | .outp.internal.lvds = nv50_sor_output_new, | ||
66 | .outp.internal.dp = gm200_sor_dp_new, | ||
67 | .dac.nr = 3, | ||
68 | .dac.power = nv50_dac_power, | ||
69 | .dac.sense = nv50_dac_sense, | ||
70 | .sor.nr = 4, | ||
71 | .sor.power = nv50_sor_power, | ||
72 | .sor.hda_eld = gf119_hda_eld, | ||
73 | .sor.hdmi = gk104_hdmi_ctrl, | ||
74 | .sor.magic = gm200_sor_magic, | ||
75 | }; | ||
76 | |||
77 | int | ||
78 | gp104_disp_new(struct nvkm_device *device, int index, struct nvkm_disp **pdisp) | ||
79 | { | ||
80 | return gf119_disp_new_(&gp104_disp, device, index, pdisp); | ||
81 | } | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h index aecebd8717e5..1e1de6bfe85a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/nv50.h | |||
@@ -68,6 +68,7 @@ struct nv50_disp_func_outp { | |||
68 | 68 | ||
69 | struct nv50_disp_func { | 69 | struct nv50_disp_func { |
70 | void (*intr)(struct nv50_disp *); | 70 | void (*intr)(struct nv50_disp *); |
71 | void (*intr_error)(struct nv50_disp *, int chid); | ||
71 | 72 | ||
72 | const struct nvkm_event_func *uevent; | 73 | const struct nvkm_event_func *uevent; |
73 | void (*super)(struct work_struct *); | 74 | void (*super)(struct work_struct *); |
@@ -114,4 +115,5 @@ void gf119_disp_vblank_init(struct nv50_disp *, int); | |||
114 | void gf119_disp_vblank_fini(struct nv50_disp *, int); | 115 | void gf119_disp_vblank_fini(struct nv50_disp *, int); |
115 | void gf119_disp_intr(struct nv50_disp *); | 116 | void gf119_disp_intr(struct nv50_disp *); |
116 | void gf119_disp_intr_supervisor(struct work_struct *); | 117 | void gf119_disp_intr_supervisor(struct work_struct *); |
118 | void gf119_disp_intr_error(struct nv50_disp *, int); | ||
117 | #endif | 119 | #endif |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ovlygk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ovlygk104.c index 2e2dc0641ef2..2f0220b39f34 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ovlygk104.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ovlygk104.c | |||
@@ -80,7 +80,7 @@ gk104_disp_ovly_mthd_base = { | |||
80 | } | 80 | } |
81 | }; | 81 | }; |
82 | 82 | ||
83 | static const struct nv50_disp_chan_mthd | 83 | const struct nv50_disp_chan_mthd |
84 | gk104_disp_ovly_chan_mthd = { | 84 | gk104_disp_ovly_chan_mthd = { |
85 | .name = "Overlay", | 85 | .name = "Overlay", |
86 | .addr = 0x001000, | 86 | .addr = 0x001000, |
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/ovlygp104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ovlygp104.c new file mode 100644 index 000000000000..97e2dd2d908e --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/ovlygp104.c | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * Copyright 2012 Red Hat Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Authors: Ben Skeggs | ||
23 | */ | ||
24 | #include "dmacnv50.h" | ||
25 | #include "rootnv50.h" | ||
26 | |||
27 | #include <nvif/class.h> | ||
28 | |||
29 | const struct nv50_disp_dmac_oclass | ||
30 | gp104_disp_ovly_oclass = { | ||
31 | .base.oclass = GK104_DISP_OVERLAY_CONTROL_DMA, | ||
32 | .base.minver = 0, | ||
33 | .base.maxver = 0, | ||
34 | .ctor = nv50_disp_ovly_new, | ||
35 | .func = &gp104_disp_dmac_func, | ||
36 | .mthd = &gk104_disp_ovly_chan_mthd, | ||
37 | .chid = 5, | ||
38 | }; | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp104.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp104.c new file mode 100644 index 000000000000..8443e04dc626 --- /dev/null +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootgp104.c | |||
@@ -0,0 +1,58 @@ | |||
1 | /* | ||
2 | * Copyright 2016 Red Hat Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | * | ||
22 | * Authors: Ben Skeggs <bskeggs@redhat.com> | ||
23 | */ | ||
24 | #include "rootnv50.h" | ||
25 | #include "dmacnv50.h" | ||
26 | |||
27 | #include <nvif/class.h> | ||
28 | |||
29 | static const struct nv50_disp_root_func | ||
30 | gp104_disp_root = { | ||
31 | .init = gf119_disp_root_init, | ||
32 | .fini = gf119_disp_root_fini, | ||
33 | .dmac = { | ||
34 | &gp104_disp_core_oclass, | ||
35 | &gp104_disp_base_oclass, | ||
36 | &gp104_disp_ovly_oclass, | ||
37 | }, | ||
38 | .pioc = { | ||
39 | &gk104_disp_oimm_oclass, | ||
40 | &gk104_disp_curs_oclass, | ||
41 | }, | ||
42 | }; | ||
43 | |||
44 | static int | ||
45 | gp104_disp_root_new(struct nvkm_disp *disp, const struct nvkm_oclass *oclass, | ||
46 | void *data, u32 size, struct nvkm_object **pobject) | ||
47 | { | ||
48 | return nv50_disp_root_new_(&gp104_disp_root, disp, oclass, | ||
49 | data, size, pobject); | ||
50 | } | ||
51 | |||
52 | const struct nvkm_disp_oclass | ||
53 | gp104_disp_root_oclass = { | ||
54 | .base.oclass = GP104_DISP, | ||
55 | .base.minver = -1, | ||
56 | .base.maxver = -1, | ||
57 | .ctor = gp104_disp_root_new, | ||
58 | }; | ||
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h index c1d8b21ae167..ad00f1724b72 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.h | |||
@@ -41,4 +41,5 @@ extern const struct nvkm_disp_oclass gk110_disp_root_oclass; | |||
41 | extern const struct nvkm_disp_oclass gm107_disp_root_oclass; | 41 | extern const struct nvkm_disp_oclass gm107_disp_root_oclass; |
42 | extern const struct nvkm_disp_oclass gm200_disp_root_oclass; | 42 | extern const struct nvkm_disp_oclass gm200_disp_root_oclass; |
43 | extern const struct nvkm_disp_oclass gp100_disp_root_oclass; | 43 | extern const struct nvkm_disp_oclass gp100_disp_root_oclass; |
44 | extern const struct nvkm_disp_oclass gp104_disp_root_oclass; | ||
44 | #endif | 45 | #endif |