summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/ioctl_channel.h
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-11-23 04:03:24 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-28 12:46:50 -0500
commit861b11a968b1f51f45832486e62bfe23fc29fc19 (patch)
tree3ec0870177b4ce66f151b916661df483d6b2847b /drivers/gpu/nvgpu/common/linux/ioctl_channel.h
parent3fbb44d7576238d42635e2ca6501a17cdc7306f7 (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/common/linux/ioctl_channel.h')
-rw-r--r--drivers/gpu/nvgpu/common/linux/ioctl_channel.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_channel.h b/drivers/gpu/nvgpu/common/linux/ioctl_channel.h
index 235d84ef..3ea8d765 100644
--- a/drivers/gpu/nvgpu/common/linux/ioctl_channel.h
+++ b/drivers/gpu/nvgpu/common/linux/ioctl_channel.h
@@ -15,11 +15,20 @@
15 15
16#include <linux/fs.h> 16#include <linux/fs.h>
17 17
18#include "gk20a/css_gr_gk20a.h"
19
18struct inode; 20struct inode;
19struct file; 21struct file;
20struct gk20a; 22struct gk20a;
21struct nvgpu_channel_open_args; 23struct nvgpu_channel_open_args;
22 24
25struct gk20a_cs_snapshot_client_linux {
26 struct gk20a_cs_snapshot_client cs_client;
27
28 u32 dmabuf_fd;
29 struct dma_buf *dma_handler;
30};
31
23int gk20a_channel_open(struct inode *inode, struct file *filp); 32int gk20a_channel_open(struct inode *inode, struct file *filp);
24int gk20a_channel_release(struct inode *inode, struct file *filp); 33int gk20a_channel_release(struct inode *inode, struct file *filp);
25long gk20a_channel_ioctl(struct file *filp, 34long gk20a_channel_ioctl(struct file *filp,
@@ -27,6 +36,8 @@ long gk20a_channel_ioctl(struct file *filp,
27int gk20a_channel_open_ioctl(struct gk20a *g, 36int gk20a_channel_open_ioctl(struct gk20a *g,
28 struct nvgpu_channel_open_args *args); 37 struct nvgpu_channel_open_args *args);
29 38
39int gk20a_channel_free_cycle_stats_snapshot(struct channel_gk20a *ch);
40
30extern const struct file_operations gk20a_event_id_ops; 41extern const struct file_operations gk20a_event_id_ops;
31extern const struct file_operations gk20a_channel_ops; 42extern const struct file_operations gk20a_channel_ops;
32 43