1 /* $NetBSD: nouveau_nvkm_engine_gr_ctxgk110b.c,v 1.3 2021/12/18 23:45:36 riastradh Exp $ */ 2 3 /* 4 * Copyright 2013 Red Hat Inc. 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a 7 * copy of this software and associated documentation files (the "Software"), 8 * to deal in the Software without restriction, including without limitation 9 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 * and/or sell copies of the Software, and to permit persons to whom the 11 * Software is furnished to do so, subject to the following conditions: 12 * 13 * The above copyright notice and this permission notice shall be included in 14 * all copies or substantial portions of the Software. 15 * 16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 * OTHER DEALINGS IN THE SOFTWARE. 23 * 24 * Authors: Ben Skeggs <bskeggs@redhat.com> 25 */ 26 #include <sys/cdefs.h> 27 __KERNEL_RCSID(0, "$NetBSD: nouveau_nvkm_engine_gr_ctxgk110b.c,v 1.3 2021/12/18 23:45:36 riastradh Exp $"); 28 29 #include "ctxgf100.h" 30 31 /******************************************************************************* 32 * PGRAPH context register lists 33 ******************************************************************************/ 34 35 static const struct gf100_gr_init 36 gk110b_grctx_init_sm_0[] = { 37 { 0x419e04, 1, 0x04, 0x00000000 }, 38 { 0x419e08, 1, 0x04, 0x0000001d }, 39 { 0x419e0c, 1, 0x04, 0x00000000 }, 40 { 0x419e10, 1, 0x04, 0x00001c02 }, 41 { 0x419e44, 1, 0x04, 0x0013eff2 }, 42 { 0x419e48, 1, 0x04, 0x00000000 }, 43 { 0x419e4c, 1, 0x04, 0x0000007f }, 44 { 0x419e50, 2, 0x04, 0x00000000 }, 45 { 0x419e58, 1, 0x04, 0x00000001 }, 46 { 0x419e5c, 3, 0x04, 0x00000000 }, 47 { 0x419e68, 1, 0x04, 0x00000002 }, 48 { 0x419e6c, 12, 0x04, 0x00000000 }, 49 { 0x419eac, 1, 0x04, 0x00001f8f }, 50 { 0x419eb0, 1, 0x04, 0x0db00d2f }, 51 { 0x419eb8, 1, 0x04, 0x00000000 }, 52 { 0x419ec8, 1, 0x04, 0x0001304f }, 53 { 0x419f30, 4, 0x04, 0x00000000 }, 54 { 0x419f40, 1, 0x04, 0x00000018 }, 55 { 0x419f44, 3, 0x04, 0x00000000 }, 56 { 0x419f58, 1, 0x04, 0x00000000 }, 57 { 0x419f70, 1, 0x04, 0x00006300 }, 58 { 0x419f78, 1, 0x04, 0x000000eb }, 59 { 0x419f7c, 1, 0x04, 0x00000404 }, 60 {} 61 }; 62 63 static const struct gf100_gr_pack 64 gk110b_grctx_pack_tpc[] = { 65 { gf117_grctx_init_pe_0 }, 66 { gk110_grctx_init_tex_0 }, 67 { gk110_grctx_init_mpc_0 }, 68 { gk110_grctx_init_l1c_0 }, 69 { gk110b_grctx_init_sm_0 }, 70 {} 71 }; 72 73 /******************************************************************************* 74 * PGRAPH context implementation 75 ******************************************************************************/ 76 77 const struct gf100_grctx_func 78 gk110b_grctx = { 79 .main = gf100_grctx_generate_main, 80 .unkn = gk104_grctx_generate_unkn, 81 .hub = gk110_grctx_pack_hub, 82 .gpc_0 = gk110_grctx_pack_gpc_0, 83 .gpc_1 = gk110_grctx_pack_gpc_1, 84 .zcull = gf100_grctx_pack_zcull, 85 .tpc = gk110b_grctx_pack_tpc, 86 .ppc = gk110_grctx_pack_ppc, 87 .icmd = gk110_grctx_pack_icmd, 88 .mthd = gk110_grctx_pack_mthd, 89 .bundle = gk104_grctx_generate_bundle, 90 .bundle_size = 0x3000, 91 .bundle_min_gpm_fifo_depth = 0x180, 92 .bundle_token_limit = 0x600, 93 .pagepool = gk104_grctx_generate_pagepool, 94 .pagepool_size = 0x8000, 95 .attrib = gf117_grctx_generate_attrib, 96 .attrib_nr_max = 0x324, 97 .attrib_nr = 0x218, 98 .alpha_nr_max = 0x7ff, 99 .alpha_nr = 0x648, 100 .patch_ltc = gk104_grctx_generate_patch_ltc, 101 .sm_id = gf100_grctx_generate_sm_id, 102 .tpc_nr = gf100_grctx_generate_tpc_nr, 103 .rop_mapping = gf117_grctx_generate_rop_mapping, 104 .alpha_beta_tables = gk104_grctx_generate_alpha_beta_tables, 105 .dist_skip_table = gf117_grctx_generate_dist_skip_table, 106 .gpc_tpc_nr = gk104_grctx_generate_gpc_tpc_nr, 107 .r418800 = gk104_grctx_generate_r418800, 108 .r419eb0 = gk110_grctx_generate_r419eb0, 109 }; 110