From 42852f182a783e7bcd157fa0a9390c77e9376a60 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Fri, 31 Mar 2017 16:19:41 +0530 Subject: gpu: nvgpu: use nvgpu list for cycle stats snapshot clients Use nvgpu list APIs instead of linux list APIs for cycle stats snapshot clients list Jira NVGPU-13 Change-Id: I124812b70ca8deb26ee1644d4d79cc404fd2aed9 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1454010 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h index be638abf..d6cea7c6 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.h @@ -88,7 +88,7 @@ struct gk20a_cs_snapshot_fifo_entry { /* cycle stats snapshot client data (e.g. associated with channel) */ struct gk20a_cs_snapshot_client { - struct list_head list; + struct nvgpu_list_node list; u32 dmabuf_fd; struct dma_buf *dma_handler; struct gk20a_cs_snapshot_fifo *snapshot; @@ -97,6 +97,13 @@ struct gk20a_cs_snapshot_client { u32 perfmon_count; }; +static inline struct gk20a_cs_snapshot_client * +gk20a_cs_snapshot_client_from_list(struct nvgpu_list_node *node) +{ + return (struct gk20a_cs_snapshot_client *) + ((uintptr_t)node - offsetof(struct gk20a_cs_snapshot_client, list)); +}; + /* should correlate with size of gk20a_cs_snapshot_fifo_entry::perfmon_id */ #define CSS_MAX_PERFMON_IDS 256 @@ -106,7 +113,7 @@ struct gk20a_cs_snapshot_client { /* cycle stats snapshot control structure for one HW entry and many clients */ struct gk20a_cs_snapshot { unsigned long perfmon_ids[PM_BITMAP_SIZE]; - struct list_head clients; + struct nvgpu_list_node clients; struct mem_desc hw_memdesc; /* pointer to allocated cpu_va memory where GPU place data */ struct gk20a_cs_snapshot_fifo_entry *hw_snapshot; -- cgit v1.2.2