linux/drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf100.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2#ifndef __NVKM_GRCTX_NVC0_H__
   3#define __NVKM_GRCTX_NVC0_H__
   4#include "gf100.h"
   5
   6struct gf100_grctx {
   7        struct gf100_gr *gr;
   8        struct gf100_gr_data *data;
   9        struct gf100_gr_mmio *mmio;
  10        int buffer_nr;
  11        u64 buffer[4];
  12        u64 addr;
  13};
  14
  15int  gf100_grctx_mmio_data(struct gf100_grctx *, u32 size, u32 align, bool priv);
  16void gf100_grctx_mmio_item(struct gf100_grctx *, u32 addr, u32 data, int s, int);
  17
  18#define mmio_vram(a,b,c,d) gf100_grctx_mmio_data((a), (b), (c), (d))
  19#define mmio_refn(a,b,c,d,e) gf100_grctx_mmio_item((a), (b), (c), (d), (e))
  20#define mmio_skip(a,b,c) mmio_refn((a), (b), (c), -1, -1)
  21#define mmio_wr32(a,b,c) mmio_refn((a), (b), (c),  0, -1)
  22
  23struct gf100_grctx_func {
  24        /* main context generation function */
  25        void  (*main)(struct gf100_gr *, struct gf100_grctx *);
  26        /* context-specific modify-on-first-load list generation function */
  27        void  (*unkn)(struct gf100_gr *);
  28        /* mmio context data */
  29        const struct gf100_gr_pack *hub;
  30        const struct gf100_gr_pack *gpc;
  31        const struct gf100_gr_pack *zcull;
  32        const struct gf100_gr_pack *tpc;
  33        const struct gf100_gr_pack *ppc;
  34        /* indirect context data, generated with icmds/mthds */
  35        const struct gf100_gr_pack *icmd;
  36        const struct gf100_gr_pack *mthd;
  37        /* bundle circular buffer */
  38        void (*bundle)(struct gf100_grctx *);
  39        u32 bundle_size;
  40        u32 bundle_min_gpm_fifo_depth;
  41        u32 bundle_token_limit;
  42        /* pagepool */
  43        void (*pagepool)(struct gf100_grctx *);
  44        u32 pagepool_size;
  45        /* attribute(/alpha) circular buffer */
  46        void (*attrib)(struct gf100_grctx *);
  47        u32 attrib_nr_max;
  48        u32 attrib_nr;
  49        u32 alpha_nr_max;
  50        u32 alpha_nr;
  51};
  52
  53extern const struct gf100_grctx_func gf100_grctx;
  54int  gf100_grctx_generate(struct gf100_gr *);
  55void gf100_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
  56void gf100_grctx_generate_bundle(struct gf100_grctx *);
  57void gf100_grctx_generate_pagepool(struct gf100_grctx *);
  58void gf100_grctx_generate_attrib(struct gf100_grctx *);
  59void gf100_grctx_generate_unkn(struct gf100_gr *);
  60void gf100_grctx_generate_tpcid(struct gf100_gr *);
  61void gf100_grctx_generate_r406028(struct gf100_gr *);
  62void gf100_grctx_generate_r4060a8(struct gf100_gr *);
  63void gf100_grctx_generate_r418bb8(struct gf100_gr *);
  64void gf100_grctx_generate_r406800(struct gf100_gr *);
  65
  66extern const struct gf100_grctx_func gf108_grctx;
  67void gf108_grctx_generate_attrib(struct gf100_grctx *);
  68void gf108_grctx_generate_unkn(struct gf100_gr *);
  69
  70extern const struct gf100_grctx_func gf104_grctx;
  71extern const struct gf100_grctx_func gf110_grctx;
  72
  73extern const struct gf100_grctx_func gf117_grctx;
  74void gf117_grctx_generate_attrib(struct gf100_grctx *);
  75
  76extern const struct gf100_grctx_func gf119_grctx;
  77
  78extern const struct gf100_grctx_func gk104_grctx;
  79extern const struct gf100_grctx_func gk20a_grctx;
  80void gk104_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
  81void gk104_grctx_generate_bundle(struct gf100_grctx *);
  82void gk104_grctx_generate_pagepool(struct gf100_grctx *);
  83void gk104_grctx_generate_unkn(struct gf100_gr *);
  84void gk104_grctx_generate_r418bb8(struct gf100_gr *);
  85
  86void gm107_grctx_generate_bundle(struct gf100_grctx *);
  87void gm107_grctx_generate_pagepool(struct gf100_grctx *);
  88void gm107_grctx_generate_attrib(struct gf100_grctx *);
  89
  90extern const struct gf100_grctx_func gk110_grctx;
  91extern const struct gf100_grctx_func gk110b_grctx;
  92extern const struct gf100_grctx_func gk208_grctx;
  93
  94extern const struct gf100_grctx_func gm107_grctx;
  95void gm107_grctx_generate_bundle(struct gf100_grctx *);
  96void gm107_grctx_generate_pagepool(struct gf100_grctx *);
  97void gm107_grctx_generate_attrib(struct gf100_grctx *);
  98
  99extern const struct gf100_grctx_func gm200_grctx;
 100void gm200_grctx_generate_tpcid(struct gf100_gr *);
 101void gm200_grctx_generate_405b60(struct gf100_gr *);
 102
 103extern const struct gf100_grctx_func gm20b_grctx;
 104
 105extern const struct gf100_grctx_func gp100_grctx;
 106void gp100_grctx_generate_main(struct gf100_gr *, struct gf100_grctx *);
 107void gp100_grctx_generate_pagepool(struct gf100_grctx *);
 108
 109extern const struct gf100_grctx_func gp102_grctx;
 110void gp102_grctx_generate_attrib(struct gf100_grctx *);
 111
 112extern const struct gf100_grctx_func gp107_grctx;
 113
 114/* context init value lists */
 115
 116extern const struct gf100_gr_pack gf100_grctx_pack_icmd[];
 117
 118extern const struct gf100_gr_pack gf100_grctx_pack_mthd[];
 119extern const struct gf100_gr_init gf100_grctx_init_902d_0[];
 120extern const struct gf100_gr_init gf100_grctx_init_9039_0[];
 121extern const struct gf100_gr_init gf100_grctx_init_90c0_0[];
 122
 123extern const struct gf100_gr_pack gf100_grctx_pack_hub[];
 124extern const struct gf100_gr_init gf100_grctx_init_main_0[];
 125extern const struct gf100_gr_init gf100_grctx_init_fe_0[];
 126extern const struct gf100_gr_init gf100_grctx_init_pri_0[];
 127extern const struct gf100_gr_init gf100_grctx_init_memfmt_0[];
 128extern const struct gf100_gr_init gf100_grctx_init_rstr2d_0[];
 129extern const struct gf100_gr_init gf100_grctx_init_scc_0[];
 130
 131extern const struct gf100_gr_pack gf100_grctx_pack_gpc[];
 132extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_0[];
 133extern const struct gf100_gr_init gf100_grctx_init_prop_0[];
 134extern const struct gf100_gr_init gf100_grctx_init_gpc_unk_1[];
 135extern const struct gf100_gr_init gf100_grctx_init_zcull_0[];
 136extern const struct gf100_gr_init gf100_grctx_init_crstr_0[];
 137extern const struct gf100_gr_init gf100_grctx_init_gpm_0[];
 138extern const struct gf100_gr_init gf100_grctx_init_gcc_0[];
 139
 140extern const struct gf100_gr_pack gf100_grctx_pack_zcull[];
 141
 142extern const struct gf100_gr_pack gf100_grctx_pack_tpc[];
 143extern const struct gf100_gr_init gf100_grctx_init_pe_0[];
 144extern const struct gf100_gr_init gf100_grctx_init_wwdx_0[];
 145extern const struct gf100_gr_init gf100_grctx_init_mpc_0[];
 146extern const struct gf100_gr_init gf100_grctx_init_tpccs_0[];
 147
 148extern const struct gf100_gr_init gf104_grctx_init_tex_0[];
 149extern const struct gf100_gr_init gf104_grctx_init_l1c_0[];
 150extern const struct gf100_gr_init gf104_grctx_init_sm_0[];
 151
 152extern const struct gf100_gr_init gf108_grctx_init_9097_0[];
 153
 154extern const struct gf100_gr_init gf108_grctx_init_gpm_0[];
 155
 156extern const struct gf100_gr_init gf108_grctx_init_pe_0[];
 157extern const struct gf100_gr_init gf108_grctx_init_wwdx_0[];
 158extern const struct gf100_gr_init gf108_grctx_init_tpccs_0[];
 159
 160extern const struct gf100_gr_init gf110_grctx_init_9197_0[];
 161extern const struct gf100_gr_init gf110_grctx_init_9297_0[];
 162
 163extern const struct gf100_gr_pack gf119_grctx_pack_icmd[];
 164
 165extern const struct gf100_gr_pack gf119_grctx_pack_mthd[];
 166
 167extern const struct gf100_gr_init gf119_grctx_init_fe_0[];
 168extern const struct gf100_gr_init gf119_grctx_init_be_0[];
 169
 170extern const struct gf100_gr_init gf119_grctx_init_prop_0[];
 171extern const struct gf100_gr_init gf119_grctx_init_gpc_unk_1[];
 172extern const struct gf100_gr_init gf119_grctx_init_crstr_0[];
 173
 174extern const struct gf100_gr_init gf119_grctx_init_sm_0[];
 175
 176extern const struct gf100_gr_init gf117_grctx_init_pe_0[];
 177
 178extern const struct gf100_gr_init gf117_grctx_init_wwdx_0[];
 179
 180extern const struct gf100_gr_init gk104_grctx_init_memfmt_0[];
 181extern const struct gf100_gr_init gk104_grctx_init_ds_0[];
 182extern const struct gf100_gr_init gk104_grctx_init_scc_0[];
 183
 184extern const struct gf100_gr_init gk104_grctx_init_gpm_0[];
 185
 186extern const struct gf100_gr_init gk104_grctx_init_pes_0[];
 187
 188extern const struct gf100_gr_pack gk104_grctx_pack_hub[];
 189extern const struct gf100_gr_pack gk104_grctx_pack_gpc[];
 190extern const struct gf100_gr_pack gk104_grctx_pack_tpc[];
 191extern const struct gf100_gr_pack gk104_grctx_pack_ppc[];
 192extern const struct gf100_gr_pack gk104_grctx_pack_icmd[];
 193extern const struct gf100_gr_init gk104_grctx_init_a097_0[];
 194
 195extern const struct gf100_gr_pack gk110_grctx_pack_icmd[];
 196
 197extern const struct gf100_gr_pack gk110_grctx_pack_mthd[];
 198
 199extern const struct gf100_gr_pack gk110_grctx_pack_hub[];
 200extern const struct gf100_gr_init gk110_grctx_init_pri_0[];
 201extern const struct gf100_gr_init gk110_grctx_init_cwd_0[];
 202
 203extern const struct gf100_gr_pack gk110_grctx_pack_gpc[];
 204extern const struct gf100_gr_init gk110_grctx_init_gpc_unk_2[];
 205
 206extern const struct gf100_gr_init gk110_grctx_init_tex_0[];
 207extern const struct gf100_gr_init gk110_grctx_init_mpc_0[];
 208extern const struct gf100_gr_init gk110_grctx_init_l1c_0[];
 209
 210extern const struct gf100_gr_pack gk110_grctx_pack_ppc[];
 211
 212extern const struct gf100_gr_init gk208_grctx_init_rstr2d_0[];
 213
 214extern const struct gf100_gr_init gk208_grctx_init_prop_0[];
 215extern const struct gf100_gr_init gk208_grctx_init_crstr_0[];
 216
 217extern const struct gf100_gr_init gm107_grctx_init_gpc_unk_0[];
 218extern const struct gf100_gr_init gm107_grctx_init_wwdx_0[];
 219#endif
 220