summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/regops_gp106.c
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-28 21:36:52 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-02 17:43:25 -0400
commita15e110a9b790f55a5c6e257cfbf7f7235f5a334 (patch)
tree199209146e3e67927c13e2ece240de40f973e1ea /drivers/gpu/nvgpu/gp106/regops_gp106.c
parent43ae97000be786e4118d431637f05b1462e296c4 (diff)
gpu: nvgpu: Reorg regops HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the regops sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: I7e2ccf158a8e7efa453a3326e86146660f18926f Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1530135 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Tested-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/regops_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/regops_gp106.c65
1 files changed, 14 insertions, 51 deletions
diff --git a/drivers/gpu/nvgpu/gp106/regops_gp106.c b/drivers/gpu/nvgpu/gp106/regops_gp106.c
index a165c426..f734ef49 100644
--- a/drivers/gpu/nvgpu/gp106/regops_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/regops_gp106.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Tegra GP106 GPU Debugger Driver Register Ops 2 * Tegra GP106 GPU Debugger Driver Register Ops
3 * 3 *
4 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -1708,105 +1708,68 @@ static const struct regop_offset_range gp106_qctl_whitelist_ranges[] = {
1708static const u32 gp106_qctl_whitelist_ranges_count = 1708static const u32 gp106_qctl_whitelist_ranges_count =
1709 ARRAY_SIZE(gp106_qctl_whitelist_ranges); 1709 ARRAY_SIZE(gp106_qctl_whitelist_ranges);
1710 1710
1711static const struct regop_offset_range *gp106_get_global_whitelist_ranges(void) 1711const struct regop_offset_range *gp106_get_global_whitelist_ranges(void)
1712{ 1712{
1713 return gp106_global_whitelist_ranges; 1713 return gp106_global_whitelist_ranges;
1714} 1714}
1715 1715
1716static int gp106_get_global_whitelist_ranges_count(void) 1716int gp106_get_global_whitelist_ranges_count(void)
1717{ 1717{
1718 return gp106_global_whitelist_ranges_count; 1718 return gp106_global_whitelist_ranges_count;
1719} 1719}
1720 1720
1721static const struct regop_offset_range *gp106_get_context_whitelist_ranges(void) 1721const struct regop_offset_range *gp106_get_context_whitelist_ranges(void)
1722{ 1722{
1723 return gp106_global_whitelist_ranges; 1723 return gp106_global_whitelist_ranges;
1724} 1724}
1725 1725
1726static int gp106_get_context_whitelist_ranges_count(void) 1726int gp106_get_context_whitelist_ranges_count(void)
1727{ 1727{
1728 return gp106_global_whitelist_ranges_count; 1728 return gp106_global_whitelist_ranges_count;
1729} 1729}
1730 1730
1731static const u32 *gp106_get_runcontrol_whitelist(void) 1731const u32 *gp106_get_runcontrol_whitelist(void)
1732{ 1732{
1733 return gp106_runcontrol_whitelist; 1733 return gp106_runcontrol_whitelist;
1734} 1734}
1735 1735
1736static int gp106_get_runcontrol_whitelist_count(void) 1736int gp106_get_runcontrol_whitelist_count(void)
1737{ 1737{
1738 return gp106_runcontrol_whitelist_count; 1738 return gp106_runcontrol_whitelist_count;
1739} 1739}
1740 1740
1741static const 1741const struct regop_offset_range *gp106_get_runcontrol_whitelist_ranges(void)
1742struct regop_offset_range *gp106_get_runcontrol_whitelist_ranges(void)
1743{ 1742{
1744 return gp106_runcontrol_whitelist_ranges; 1743 return gp106_runcontrol_whitelist_ranges;
1745} 1744}
1746 1745
1747static int gp106_get_runcontrol_whitelist_ranges_count(void) 1746int gp106_get_runcontrol_whitelist_ranges_count(void)
1748{ 1747{
1749 return gp106_runcontrol_whitelist_ranges_count; 1748 return gp106_runcontrol_whitelist_ranges_count;
1750} 1749}
1751 1750
1752static const u32 *gp106_get_qctl_whitelist(void) 1751const u32 *gp106_get_qctl_whitelist(void)
1753{ 1752{
1754 return gp106_qctl_whitelist; 1753 return gp106_qctl_whitelist;
1755} 1754}
1756 1755
1757static int gp106_get_qctl_whitelist_count(void) 1756int gp106_get_qctl_whitelist_count(void)
1758{ 1757{
1759 return gp106_qctl_whitelist_count; 1758 return gp106_qctl_whitelist_count;
1760} 1759}
1761 1760
1762static const struct regop_offset_range *gp106_get_qctl_whitelist_ranges(void) 1761const struct regop_offset_range *gp106_get_qctl_whitelist_ranges(void)
1763{ 1762{
1764 return gp106_qctl_whitelist_ranges; 1763 return gp106_qctl_whitelist_ranges;
1765} 1764}
1766 1765
1767static int gp106_get_qctl_whitelist_ranges_count(void) 1766int gp106_get_qctl_whitelist_ranges_count(void)
1768{ 1767{
1769 return gp106_qctl_whitelist_ranges_count; 1768 return gp106_qctl_whitelist_ranges_count;
1770} 1769}
1771 1770
1772static int gp106_apply_smpc_war(struct dbg_session_gk20a *dbg_s) 1771int gp106_apply_smpc_war(struct dbg_session_gk20a *dbg_s)
1773{ 1772{
1774 /* Not needed on gp106 */ 1773 /* Not needed on gp106 */
1775 return 0; 1774 return 0;
1776} 1775}
1777
1778void gp106_init_regops(struct gpu_ops *gops)
1779{
1780 gops->regops.get_global_whitelist_ranges =
1781 gp106_get_global_whitelist_ranges;
1782 gops->regops.get_global_whitelist_ranges_count =
1783 gp106_get_global_whitelist_ranges_count;
1784
1785 gops->regops.get_context_whitelist_ranges =
1786 gp106_get_context_whitelist_ranges;
1787 gops->regops.get_context_whitelist_ranges_count =
1788 gp106_get_context_whitelist_ranges_count;
1789
1790 gops->regops.get_runcontrol_whitelist =
1791 gp106_get_runcontrol_whitelist;
1792 gops->regops.get_runcontrol_whitelist_count =
1793 gp106_get_runcontrol_whitelist_count;
1794
1795 gops->regops.get_runcontrol_whitelist_ranges =
1796 gp106_get_runcontrol_whitelist_ranges;
1797 gops->regops.get_runcontrol_whitelist_ranges_count =
1798 gp106_get_runcontrol_whitelist_ranges_count;
1799
1800 gops->regops.get_qctl_whitelist =
1801 gp106_get_qctl_whitelist;
1802 gops->regops.get_qctl_whitelist_count =
1803 gp106_get_qctl_whitelist_count;
1804
1805 gops->regops.get_qctl_whitelist_ranges =
1806 gp106_get_qctl_whitelist_ranges;
1807 gops->regops.get_qctl_whitelist_ranges_count =
1808 gp106_get_qctl_whitelist_ranges_count;
1809
1810 gops->regops.apply_smpc_war =
1811 gp106_apply_smpc_war;
1812}