Skip to content

Commit 015185c

Browse files
Ben Skeggsairlied
authored andcommitted
drm/nouveau/ofa/r535: initial support
Adds support for allocating OFA classes from RM. Signed-off-by: Ben Skeggs <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ca96863 commit 015185c

File tree

17 files changed

+294
-0
lines changed

17 files changed

+294
-0
lines changed

drivers/gpu/drm/nouveau/include/nvif/cl0080.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ struct nv_device_time_v0 {
9292
#define NV_DEVICE_HOST_RUNLIST_ENGINES_NVDEC 0x00008000
9393
#define NV_DEVICE_HOST_RUNLIST_ENGINES_NVENC 0x00010000
9494
#define NV_DEVICE_HOST_RUNLIST_ENGINES_NVJPG 0x00020000
95+
#define NV_DEVICE_HOST_RUNLIST_ENGINES_OFA 0x00040000
9596
/* Returns the number of available channels on runlist(data). */
9697
#define NV_DEVICE_HOST_RUNLIST_CHANNELS NV_DEVICE_HOST(0x00000101)
9798
#endif

drivers/gpu/drm/nouveau/include/nvif/class.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,4 +256,8 @@
256256

257257
#define NVC4D1_VIDEO_NVJPG 0x0000c4d1
258258
#define NVC9D1_VIDEO_NVJPG 0x0000c9d1
259+
260+
#define NVC6FA_VIDEO_OFA 0x0000c6fa
261+
#define NVC7FA_VIDEO_OFA 0x0000c7fa
262+
#define NVC9FA_VIDEO_OFA 0x0000c9fa
259263
#endif
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/* SPDX-License-Identifier: MIT */
2+
#ifndef __NVKM_OFA_H__
3+
#define __NVKM_OFA_H__
4+
#include <core/engine.h>
5+
6+
int ga100_ofa_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_engine **);
7+
int ga102_ofa_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_engine **);
8+
int ad102_ofa_new(struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_engine **);
9+
#endif

drivers/gpu/drm/nouveau/include/nvrm/535.54.03/common/sdk/nvidia/inc/nvos.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ typedef struct
126126
NvU32 engineInstance;
127127
} NV_NVJPG_ALLOCATION_PARAMETERS;
128128

129+
typedef struct
130+
{
131+
NvU32 size;
132+
NvU32 prohibitMultipleInstances; // Prohibit multiple allocations of OFA?
133+
} NV_OFA_ALLOCATION_PARAMETERS;
134+
129135
typedef struct
130136
{
131137
NvU32 index;

drivers/gpu/drm/nouveau/include/nvrm/535.54.03/nvidia/inc/kernel/gpu/intr/engine_idx.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949

5050
#define MC_ENGINE_IDX_NVDEC7 71
5151

52+
#define MC_ENGINE_IDX_OFA0 80
53+
5254
#define MC_ENGINE_IDX_GR 82
5355
#define MC_ENGINE_IDX_GR0 MC_ENGINE_IDX_GR
5456

drivers/gpu/drm/nouveau/nvkm/engine/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ include $(src)/nvkm/engine/msvld/Kbuild
1818
include $(src)/nvkm/engine/nvenc/Kbuild
1919
include $(src)/nvkm/engine/nvdec/Kbuild
2020
include $(src)/nvkm/engine/nvjpg/Kbuild
21+
include $(src)/nvkm/engine/ofa/Kbuild
2122
include $(src)/nvkm/engine/pm/Kbuild
2223
include $(src)/nvkm/engine/sec/Kbuild
2324
include $(src)/nvkm/engine/sec2/Kbuild

drivers/gpu/drm/nouveau/nvkm/engine/device/base.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,6 +2594,7 @@ nv170_chipset = {
25942594
.fifo = { 0x00000001, ga100_fifo_new },
25952595
.nvdec = { 0x0000001f, ga100_nvdec_new },
25962596
.nvjpg = { 0x00000001, ga100_nvjpg_new },
2597+
.ofa = { 0x00000001, ga100_ofa_new },
25972598
};
25982599

25992600
static const struct nvkm_device_chip
@@ -2624,6 +2625,7 @@ nv172_chipset = {
26242625
.gr = { 0x00000001, ga102_gr_new },
26252626
.nvdec = { 0x00000003, ga102_nvdec_new },
26262627
.nvenc = { 0x00000001, ga102_nvenc_new },
2628+
.ofa = { 0x00000001, ga102_ofa_new },
26272629
.sec2 = { 0x00000001, ga102_sec2_new },
26282630
};
26292631

@@ -2655,6 +2657,7 @@ nv173_chipset = {
26552657
.gr = { 0x00000001, ga102_gr_new },
26562658
.nvdec = { 0x00000003, ga102_nvdec_new },
26572659
.nvenc = { 0x00000001, ga102_nvenc_new },
2660+
.ofa = { 0x00000001, ga102_ofa_new },
26582661
.sec2 = { 0x00000001, ga102_sec2_new },
26592662
};
26602663

@@ -2686,6 +2689,7 @@ nv174_chipset = {
26862689
.gr = { 0x00000001, ga102_gr_new },
26872690
.nvdec = { 0x00000003, ga102_nvdec_new },
26882691
.nvenc = { 0x00000001, ga102_nvenc_new },
2692+
.ofa = { 0x00000001, ga102_ofa_new },
26892693
.sec2 = { 0x00000001, ga102_sec2_new },
26902694
};
26912695

@@ -2717,6 +2721,7 @@ nv176_chipset = {
27172721
.gr = { 0x00000001, ga102_gr_new },
27182722
.nvdec = { 0x00000003, ga102_nvdec_new },
27192723
.nvenc = { 0x00000001, ga102_nvenc_new },
2724+
.ofa = { 0x00000001, ga102_ofa_new },
27202725
.sec2 = { 0x00000001, ga102_sec2_new },
27212726
};
27222727

@@ -2748,6 +2753,7 @@ nv177_chipset = {
27482753
.gr = { 0x00000001, ga102_gr_new },
27492754
.nvdec = { 0x00000003, ga102_nvdec_new },
27502755
.nvenc = { 0x00000001, ga102_nvenc_new },
2756+
.ofa = { 0x00000001, ga102_ofa_new },
27512757
.sec2 = { 0x00000001, ga102_sec2_new },
27522758
};
27532759

@@ -2773,6 +2779,7 @@ nv192_chipset = {
27732779
.nvdec = { 0x0000000f, ad102_nvdec_new },
27742780
.nvenc = { 0x00000007, ad102_nvenc_new },
27752781
.nvjpg = { 0x0000000f, ad102_nvjpg_new },
2782+
.ofa = { 0x00000001, ad102_ofa_new },
27762783
.sec2 = { 0x00000001, ga102_sec2_new },
27772784
};
27782785

@@ -2798,6 +2805,7 @@ nv193_chipset = {
27982805
.nvdec = { 0x0000000f, ad102_nvdec_new },
27992806
.nvenc = { 0x00000007, ad102_nvenc_new },
28002807
.nvjpg = { 0x0000000f, ad102_nvjpg_new },
2808+
.ofa = { 0x00000001, ad102_ofa_new },
28012809
.sec2 = { 0x00000001, ga102_sec2_new },
28022810
};
28032811

@@ -2823,6 +2831,7 @@ nv194_chipset = {
28232831
.nvdec = { 0x0000000f, ad102_nvdec_new },
28242832
.nvenc = { 0x00000007, ad102_nvenc_new },
28252833
.nvjpg = { 0x0000000f, ad102_nvjpg_new },
2834+
.ofa = { 0x00000001, ad102_ofa_new },
28262835
.sec2 = { 0x00000001, ga102_sec2_new },
28272836
};
28282837

@@ -2848,6 +2857,7 @@ nv196_chipset = {
28482857
.nvdec = { 0x0000000f, ad102_nvdec_new },
28492858
.nvenc = { 0x00000007, ad102_nvenc_new },
28502859
.nvjpg = { 0x0000000f, ad102_nvjpg_new },
2860+
.ofa = { 0x00000001, ad102_ofa_new },
28512861
.sec2 = { 0x00000001, ga102_sec2_new },
28522862
};
28532863

@@ -2873,6 +2883,7 @@ nv197_chipset = {
28732883
.nvdec = { 0x0000000f, ad102_nvdec_new },
28742884
.nvenc = { 0x00000007, ad102_nvenc_new },
28752885
.nvjpg = { 0x0000000f, ad102_nvjpg_new },
2886+
.ofa = { 0x00000001, ad102_ofa_new },
28762887
.sec2 = { 0x00000001, ga102_sec2_new },
28772888
};
28782889

drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include <engine/nvenc.h>
4545
#include <engine/nvdec.h>
4646
#include <engine/nvjpg.h>
47+
#include <engine/ofa.h>
4748
#include <engine/pm.h>
4849
#include <engine/sec.h>
4950
#include <engine/sec2.h>

drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ nvkm_fifo_info(struct nvkm_engine *engine, u64 mthd, u64 *data)
211211
CASE(NVDEC );
212212
CASE(NVENC );
213213
CASE(NVJPG );
214+
CASE(OFA );
214215
default:
215216
WARN_ON(1);
216217
break;

drivers/gpu/drm/nouveau/nvkm/engine/fifo/r535.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ r535_fifo_runl_ctor(struct nvkm_fifo *fifo)
598598
case NVKM_ENGINE_NVDEC:
599599
case NVKM_ENGINE_NVENC:
600600
case NVKM_ENGINE_NVJPG:
601+
case NVKM_ENGINE_OFA:
601602
engn = nvkm_runl_add(runl, nv2080, &r535_flcn, type, inst);
602603
break;
603604
case NVKM_ENGINE_SW:

0 commit comments

Comments
 (0)