diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-11-23 04:03:24 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-11-28 12:46:50 -0500 |
commit | 861b11a968b1f51f45832486e62bfe23fc29fc19 (patch) | |
tree | 3ec0870177b4ce66f151b916661df483d6b2847b /drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h | |
parent | 3fbb44d7576238d42635e2ca6501a17cdc7306f7 (diff) |
gpu: nvgpu: move snapshot_client memory handling to linux
We right now store dmabuf fd and dma_buf pointer for gk20a_cs_snapshot_client
But since dma_buf and all related APIs are linux specific, we need to remove
them from common code and move them to linux specific code
Add new linux specific structure gk20a_cs_snapshot_client_linux which includes
struct gk20a_cs_snapshot_client and linux specific dma_buf pointer
In gk20a_attach_cycle_stats_snapshot(), we first handle all dma_buf related
operations and then call gr_gk20a_css_attach()
Move gk20a_channel_free_cycle_stats_snapshot() to ioctl_channel.c
In gk20a_channel_free_cycle_stats_snapshot(), we call gr_gk20a_css_detach()
and then free up dma_buf in linux specific code
We also need to call gk20a_channel_free_cycle_stats_snapshot() while closing
the channel, so call it from linux specific nvgpu_channel_close_linux()
Jira NVGPU-397
Jira NVGPU-415
Change-Id: Ida27240541f6adf31f28d7d7ee4f51651c6d3de2
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1603908
GVS: Gerrit_Virtual_Submit
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/css_gr_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h index f0ad6044..b6ad9fac 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h | |||
@@ -28,6 +28,10 @@ | |||
28 | /* the minimal size of HW buffer - should be enough to avoid HW overflows */ | 28 | /* the minimal size of HW buffer - should be enough to avoid HW overflows */ |
29 | #define CSS_MIN_HW_SNAPSHOT_SIZE (8 * 1024 * 1024) | 29 | #define CSS_MIN_HW_SNAPSHOT_SIZE (8 * 1024 * 1024) |
30 | 30 | ||
31 | struct gk20a; | ||
32 | struct gr_gk20a; | ||
33 | struct channel_gk20a; | ||
34 | |||
31 | /* cycle stats fifo header (must match NvSnapshotBufferFifo) */ | 35 | /* cycle stats fifo header (must match NvSnapshotBufferFifo) */ |
32 | struct gk20a_cs_snapshot_fifo { | 36 | struct gk20a_cs_snapshot_fifo { |
33 | /* layout description of the buffer */ | 37 | /* layout description of the buffer */ |
@@ -95,8 +99,6 @@ struct gk20a_cs_snapshot_fifo_entry { | |||
95 | /* cycle stats snapshot client data (e.g. associated with channel) */ | 99 | /* cycle stats snapshot client data (e.g. associated with channel) */ |
96 | struct gk20a_cs_snapshot_client { | 100 | struct gk20a_cs_snapshot_client { |
97 | struct nvgpu_list_node list; | 101 | struct nvgpu_list_node list; |
98 | u32 dmabuf_fd; | ||
99 | struct dma_buf *dma_handler; | ||
100 | struct gk20a_cs_snapshot_fifo *snapshot; | 102 | struct gk20a_cs_snapshot_fifo *snapshot; |
101 | u32 snapshot_size; | 103 | u32 snapshot_size; |
102 | u32 perfmon_start; | 104 | u32 perfmon_start; |