From bac80f7e764f75f02f420ace97f9b7de35de0b4f Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Wed, 6 Nov 2019 18:41:10 -0800 Subject: [PATCH] gpu: nvgpu: create separate file for common.netlist hals Moved common.netlist hals from gk20a.h to newly created gops_netlist.h file. JIRA NVGPU-4329 Change-Id: Idaec2f9c0ad11f9dc9aa80acfe06544537c57f3b Signed-off-by: Seshendra Gadagottu Reviewed-on: https://git-master.nvidia.com/r/2233745 Reviewed-by: mobile promotions Tested-by: mobile promotions --- arch/nvgpu-hal-new.yaml | 3 +- drivers/gpu/nvgpu/include/nvgpu/gk20a.h | 7 ++- .../gpu/nvgpu/include/nvgpu/gops_netlist.h | 50 +++++++++++++++++++ 3 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 drivers/gpu/nvgpu/include/nvgpu/gops_netlist.h diff --git a/arch/nvgpu-hal-new.yaml b/arch/nvgpu-hal-new.yaml index be90adaa0..6b0d6295d 100644 --- a/arch/nvgpu-hal-new.yaml +++ b/arch/nvgpu-hal-new.yaml @@ -694,7 +694,8 @@ netlist_fusa: safe: yes owner: Seshendra G gpu: both - sources: [ hal/netlist/netlist_gv11b_fusa.c, + sources: [ include/nvgpu/gops_netlist.h, + hal/netlist/netlist_gv11b_fusa.c, hal/netlist/netlist_gv11b.h ] netlist: diff --git a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h index 54e5c4ed1..18357b98f 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gk20a.h @@ -52,6 +52,7 @@ * - @ref unit-common-nvgpu * - @ref unit-common-ltc * - @ref unit-common-utils + * - @ref unit-common-netlist * - @ref unit-mc * - Etc, etc. * @@ -159,6 +160,7 @@ enum nvgpu_unit; #include #include #include +#include #include #include #include @@ -306,10 +308,7 @@ struct gpu_ops { struct gops_usermode usermode; struct gops_engine_status engine_status; struct gops_pbdma_status pbdma_status; - struct { - int (*get_netlist_name)(struct gk20a *g, int index, char *name); - bool (*is_fw_defined)(void); - } netlist; + struct gops_netlist netlist; struct gops_mm mm; /* * This function is called to allocate secure memory (memory diff --git a/drivers/gpu/nvgpu/include/nvgpu/gops_netlist.h b/drivers/gpu/nvgpu/include/nvgpu/gops_netlist.h new file mode 100644 index 000000000..e83d1fbcf --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/gops_netlist.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. + * + * 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 AUTHORS OR COPYRIGHT HOLDERS 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. + */ +#ifndef NVGPU_GOPS_NETLIST_H +#define NVGPU_GOPS_NETLIST_H + +#include + +/** + * @file + * + * common.netlist interface. + */ +struct gk20a; + +/** + * + * This structure stores common.netlist unit hal pointers. + * + * @see gpu_ops + */ +struct gops_netlist { + +/** @cond DOXYGEN_SHOULD_SKIP_THIS */ + int (*get_netlist_name)(struct gk20a *g, int index, char *name); + bool (*is_fw_defined)(void); +/** @endcond DOXYGEN_SHOULD_SKIP_THIS */ + +}; + +#endif /* NVGPU_GOPS_NETLIST_H */ +