gpu: nvgpu: Move dev field from gk20a to nvgpu_os_linux

Move field "struct device *dev" from struct gk20a to struct
nvgpu_os_linux. The field is valid only for Linux.

JIRA NVGPU-38

Change-Id: I09286aa3a9c5a2406e5a27c1fbf21b2c515b4dd4
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master/r/1514162
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-07-02 12:30:20 -07:00
committed by mobile promotions
parent dfd42c2b28
commit cba424539d
39 changed files with 44 additions and 14 deletions

View File

@@ -33,6 +33,7 @@
#ifdef CONFIG_DEBUG_FS
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h"
#endif
#define MAX_F_POINTS 256

View File

@@ -22,6 +22,8 @@
#include <soc/tegra/tegra-dvfs.h>
#include "clk.h"
#include "os_linux.h"
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"

View File

@@ -21,6 +21,7 @@
#include "debug_kmem.h"
#include "debug_pmu.h"
#include "debug_sched.h"
#include "os_linux.h"
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"

View File

@@ -14,6 +14,7 @@
#include "debug_allocator.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>
#include <linux/seq_file.h>

View File

@@ -14,6 +14,7 @@
#include "debug_cde.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>

View File

@@ -14,6 +14,7 @@
#include "debug_ce.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>

View File

@@ -18,6 +18,7 @@
#include "gk20a/platform_gk20a.h"
#include "gm20b/clk_gm20b.h"
#include "os_linux.h"
static int rate_get(void *data, u64 *val)
{

View File

@@ -14,6 +14,7 @@
#include "debug_fifo.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>
#include <linux/seq_file.h>

View File

@@ -14,6 +14,7 @@
#include "debug_gr.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>

View File

@@ -14,6 +14,7 @@
#include "debug_mm.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>

View File

@@ -15,6 +15,7 @@
#include <nvgpu/enabled.h>
#include "debug_pmu.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>
#include <linux/seq_file.h>

View File

@@ -14,6 +14,7 @@
#include "debug_sched.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#include <linux/debugfs.h>
#include <linux/seq_file.h>

View File

@@ -27,6 +27,7 @@
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
#if defined(CONFIG_GK20A_VIDMEM)
static u64 __nvgpu_dma_alloc(struct nvgpu_allocator *allocator, dma_addr_t at,

View File

@@ -22,6 +22,7 @@
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
static const struct firmware *do_request_firmware(struct device *dev,
const char *prefix, const char *fw_name, int flags)

View File

@@ -21,6 +21,7 @@
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
/*
* Define a length for log buffers. This is the buffer that the 'fmt, ...' part

View File

@@ -865,7 +865,7 @@ static int gk20a_probe(struct platform_device *dev)
gk20a = &l->g;
set_gk20a(dev, gk20a);
gk20a->dev = &dev->dev;
l->dev = &dev->dev;
gk20a->log_mask = NVGPU_DEFAULT_DBG_MASK;
nvgpu_kmem_init(gk20a);

View File

@@ -23,7 +23,7 @@
#include "nvhost_priv.h"
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "os_linux.h"
int nvgpu_get_nvhost_dev(struct gk20a *g)
{

View File

@@ -22,6 +22,7 @@
struct nvgpu_os_linux {
struct gk20a g;
struct device *dev;
struct {
struct cdev cdev;
@@ -75,6 +76,11 @@ static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g)
return container_of(g, struct nvgpu_os_linux, g);
}
static inline struct device *dev_from_gk20a(struct gk20a *g)
{
return nvgpu_os_linux_from_gk20a(g)->dev;
}
#define INTERFACE_NAME "nvhost%s-gpu"
#endif

View File

@@ -29,6 +29,7 @@
#include "module.h"
#include "intr.h"
#include "sysfs.h"
#include "os_linux.h"
#include "pci.h"
@@ -367,7 +368,7 @@ static int nvgpu_pci_probe(struct pci_dev *pdev,
}
platform->g = g;
g->dev = &pdev->dev;
l->dev = &pdev->dev;
err = pci_enable_device(pdev);
if (err)

View File

@@ -52,6 +52,7 @@
#include "gm20b/clk_gm20b.h"
#include "clk.h"
#include "os_linux.h"
#include "../../../arch/arm/mach-tegra/iomap.h"

View File

@@ -29,6 +29,7 @@
#include "gk20a/platform_gk20a.h"
#include "vm_priv.h"
#include "os_linux.h"
static struct nvgpu_mapped_buf *__nvgpu_vm_find_mapped_buf_reverse(
struct vm_gk20a *vm, struct dma_buf *dmabuf, u32 kind)

View File

@@ -37,7 +37,7 @@
#include "cde_gk20a.h"
#include "fence_gk20a.h"
#include "gr_gk20a.h"
#include "platform_gk20a.h"
#include "common/linux/os_linux.h"
#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>

View File

@@ -28,6 +28,7 @@
#include "gk20a.h"
#include "gr_gk20a.h"
#include "platform_gk20a.h"
#include "common/linux/os_linux.h"
#include <nvgpu/log.h>

View File

@@ -1019,7 +1019,6 @@ struct nvgpu_bios {
};
struct gk20a {
struct device *dev;
struct nvgpu_nvhost_dev *nvhost_dev;
/*

View File

@@ -39,7 +39,7 @@
#include "regops_gk20a.h"
#include "dbg_gpu_gk20a.h"
#include "ctxsw_trace_gk20a.h"
#include "platform_gk20a.h"
#include "common/linux/os_linux.h"
#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
#include <nvgpu/hw/gk20a/hw_ctxsw_prog_gk20a.h>

View File

@@ -49,6 +49,7 @@
#include "fence_gk20a.h"
#include "kind_gk20a.h"
#include "bus_gk20a.h"
#include "common/linux/os_linux.h"
#include <nvgpu/hw/gk20a/hw_gmmu_gk20a.h>
#include <nvgpu/hw/gk20a/hw_ram_gk20a.h>

View File

@@ -259,10 +259,6 @@ static inline struct gk20a *get_gk20a(struct device *dev)
{
return gk20a_get_platform(dev)->g;
}
static inline struct device *dev_from_gk20a(struct gk20a *g)
{
return g->dev;
}
static inline struct gk20a *gk20a_from_dev(struct device *dev)
{
if (!dev)

View File

@@ -25,6 +25,7 @@
#include "gm20b/fifo_gm20b.h"
#include "bios_gm206.h"
#include "gp106/mclk_gp106.h"
#include "common/linux/os_linux.h"
#include <nvgpu/hw/gm206/hw_pwr_gm206.h>
#include <nvgpu/hw/gm206/hw_mc_gm206.h>

View File

@@ -23,7 +23,7 @@
#include "gk20a/gk20a.h"
#include "gk20a/gr_gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h"
#include "gr_gm20b.h"
#include "pmu_gm20b.h"

View File

@@ -26,6 +26,7 @@
#ifdef CONFIG_DEBUG_FS
#include "gk20a/platform_gk20a.h"
#endif
#include "common/linux/os_linux.h"
#include "clk_gp106.h"
#include "clk/clk_arb.h"

View File

@@ -19,6 +19,7 @@
#include "gk20a/gk20a.h"
#ifdef CONFIG_DEBUG_FS
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h"
#endif
#include "gp106/mclk_gp106.h"

View File

@@ -17,6 +17,7 @@
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h"
#endif
#include <nvgpu/hw/gp106/hw_therm_gp106.h>

View File

@@ -28,7 +28,7 @@
#include "gk20a/gr_gk20a.h"
#include "gk20a/dbg_gpu_gk20a.h"
#include "gk20a/regops_gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h"
#include "gm20b/gr_gm20b.h"
#include "gp10b/gr_gp10b.h"

View File

@@ -17,10 +17,10 @@
#include <nvgpu/gmmu.h>
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "gm20b/mm_gm20b.h"
#include "mm_gp10b.h"
#include "rpfb_gp10b.h"
#include "common/linux/os_linux.h"
#include <nvgpu/hw/gp10b/hw_fb_gp10b.h>
#include <nvgpu/hw/gp10b/hw_ram_gp10b.h>

View File

@@ -18,6 +18,7 @@
#ifdef CONFIG_DEBUG_FS
#include <linux/debugfs.h>
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h"
#endif
int pmgr_pwr_devices_get_power(struct gk20a *g, u32 *val)

View File

@@ -18,6 +18,7 @@
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "gm206/bios_gm206.h"
#include "common/linux/os_linux.h"
#include "boardobj/boardobjgrp.h"
#include "boardobj/boardobjgrp_e32.h"

View File

@@ -20,6 +20,7 @@
#include "boardobj/boardobjgrp.h"
#include "boardobj/boardobjgrp_e32.h"
#include "gm206/bios_gm206.h"
#include "common/linux/os_linux.h"
#define _pwr_policy_limitarboutputget_helper(p_limit_arb) (p_limit_arb)->output
#define _pwr_policy_limitdeltaapply(limit, delta) ((u32)max(((s32)limit) + (delta), 0))

View File

@@ -677,7 +677,7 @@ int vgpu_probe(struct platform_device *pdev)
return err;
}
gk20a->dev = dev;
l->dev = dev;
if (tegra_platform_is_linsim() || tegra_platform_is_vdk())
__nvgpu_set_enabled(gk20a, NVGPU_IS_FMODEL, true);

View File

@@ -20,6 +20,7 @@
#include <linux/tegra_vgpu.h>
#include "gk20a/gk20a.h"
#include "gk20a/platform_gk20a.h"
#include "common/linux/os_linux.h"
#include <nvgpu/thread.h>