diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2017-11-22 02:50:19 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-29 01:50:27 -0500 |
commit | 312f6c2c5f8b2ad6ab95300896ec4e7be9d5f833 (patch) | |
tree | c9a9148202fdd4f8487097d37d81c29efef6f66c /drivers/gpu/nvgpu/gk20a/sim_gk20a.h | |
parent | 830d3f10ca1f3d8a045542ef4548c84440a8e548 (diff) |
gpu: nvgpu: remove dependency on linux header for sim_gk20a*
This patch removes linux dependencies from sim_gk20a.h under
gk20a/sim_gk20a.h. The following changes are made in this patch.
1) Created a linux based structure sim_gk20a_linux that contains a
common sim_gk20a struct inside it. The common struct sim_gk20a doesn't
contain any linux specific structs.
2) The common struct sim_gk20a contains an added function pointer which
is used to invoke gk20a_sim_esc_readl() method.
3) sim_gk20a.c is moved to nvgpu/common/linux along with a new header
sim_gk20a.h that contains the definition of struct sim_gk20a_linux.
4) struct gk20a now contains a pointer of sim_gk20a instead of the
entire object. The memory for this struct is allocated and initialized during
gk20a_init_support() and freed during invocation of
gk20_remove_support().
5) We first obtain the pointer for struct sim_gk20a_linux from the
pointer of sim_gk20a using the container_of method in order to work on
the struct.
JIRA NVGPU-386
Change-Id: Ic82b8702642377f82694577a53c3ca0b9c1bb2ab
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1603073
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/sim_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sim_gk20a.h | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/sim_gk20a.h b/drivers/gpu/nvgpu/gk20a/sim_gk20a.h index 44378e7a..8f23abd8 100644 --- a/drivers/gpu/nvgpu/gk20a/sim_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/sim_gk20a.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * GK20A sim support | 4 | * GK20A sim support |
5 | * | 5 | * |
6 | * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. | 6 | * Copyright (c) 2013-2017, NVIDIA CORPORATION. All rights reserved. |
7 | * | 7 | * |
8 | * Permission is hereby granted, free of charge, to any person obtaining a | 8 | * Permission is hereby granted, free of charge, to any person obtaining a |
9 | * copy of this software and associated documentation files (the "Software"), | 9 | * copy of this software and associated documentation files (the "Software"), |
@@ -27,25 +27,16 @@ | |||
27 | #define __SIM_GK20A_H__ | 27 | #define __SIM_GK20A_H__ |
28 | 28 | ||
29 | struct gk20a; | 29 | struct gk20a; |
30 | struct platform_device; | ||
31 | 30 | ||
32 | struct sim_gk20a { | 31 | struct sim_gk20a { |
33 | struct gk20a *g; | 32 | struct gk20a *g; |
34 | struct resource *reg_mem; | ||
35 | void __iomem *regs; | ||
36 | struct { | ||
37 | struct page *page; | ||
38 | void *kvaddr; | ||
39 | u64 phys; | ||
40 | } send_bfr, recv_bfr, msg_bfr; | ||
41 | u32 send_ring_put; | 33 | u32 send_ring_put; |
42 | u32 recv_ring_get; | 34 | u32 recv_ring_get; |
43 | u32 recv_ring_put; | 35 | u32 recv_ring_put; |
44 | u32 sequence_base; | 36 | u32 sequence_base; |
45 | void (*remove_support)(struct sim_gk20a *); | 37 | void (*remove_support)(struct sim_gk20a *); |
38 | int (*esc_readl)( | ||
39 | struct gk20a *g, char *path, u32 index, u32 *data); | ||
46 | }; | 40 | }; |
47 | 41 | ||
48 | int gk20a_init_sim_support(struct gk20a *g); | ||
49 | int gk20a_sim_esc_readl(struct gk20a *g, char *path, u32 index, u32 *data); | ||
50 | |||
51 | #endif /*__SIM_GK20A_H__*/ | 42 | #endif /*__SIM_GK20A_H__*/ |