summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c
index b4e2cb79..7f03be64 100644
--- a/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/css_gr_gv11b.c
@@ -22,9 +22,6 @@
22 * DEALINGS IN THE SOFTWARE. 22 * DEALINGS IN THE SOFTWARE.
23 */ 23 */
24 24
25#include <linux/dma-mapping.h>
26#include <linux/dma-buf.h>
27
28#include <nvgpu/bitops.h> 25#include <nvgpu/bitops.h>
29#include <nvgpu/kmem.h> 26#include <nvgpu/kmem.h>
30#include <nvgpu/lock.h> 27#include <nvgpu/lock.h>
@@ -33,7 +30,9 @@
33#include <nvgpu/sizes.h> 30#include <nvgpu/sizes.h>
34#include <nvgpu/enabled.h> 31#include <nvgpu/enabled.h>
35#include <nvgpu/log.h> 32#include <nvgpu/log.h>
33#include <nvgpu/nvgpu_mem.h>
36#include <nvgpu/bug.h> 34#include <nvgpu/bug.h>
35#include <nvgpu/dma.h>
37 36
38#include "gk20a/gk20a.h" 37#include "gk20a/gk20a.h"
39#include "gk20a/css_gr_gk20a.h" 38#include "gk20a/css_gr_gk20a.h"
@@ -44,14 +43,14 @@
44 43
45 44
46/* reports whether the hw queue overflowed */ 45/* reports whether the hw queue overflowed */
47static inline bool css_hw_get_overflow_status(struct gk20a *g) 46bool gv11b_css_hw_get_overflow_status(struct gk20a *g)
48{ 47{
49 const u32 st = perf_pmasys_control_membuf_status_overflowed_f(); 48 const u32 st = perf_pmasys_control_membuf_status_overflowed_f();
50 return st == (gk20a_readl(g, perf_pmasys_control_r()) & st); 49 return st == (gk20a_readl(g, perf_pmasys_control_r()) & st);
51} 50}
52 51
53/* returns how many pending snapshot entries are pending */ 52/* returns how many pending snapshot entries are pending */
54static inline u32 css_hw_get_pending_snapshots(struct gk20a *g) 53u32 gv11b_css_hw_get_pending_snapshots(struct gk20a *g)
55{ 54{
56 return gk20a_readl(g, perf_pmasys_mem_bytes_r()) / 55 return gk20a_readl(g, perf_pmasys_mem_bytes_r()) /
57 sizeof(struct gk20a_cs_snapshot_fifo_entry); 56 sizeof(struct gk20a_cs_snapshot_fifo_entry);
@@ -74,7 +73,7 @@ static void gv11b_css_hw_reset_streaming(struct gk20a *g)
74 perf_pmasys_control_membuf_clear_status_doit_f()); 73 perf_pmasys_control_membuf_clear_status_doit_f());
75 74
76 /* pointing all pending snapshots as handled */ 75 /* pointing all pending snapshots as handled */
77 gv11b_css_hw_set_handled_snapshots(g, css_hw_get_pending_snapshots(g)); 76 gv11b_css_hw_set_handled_snapshots(g, gv11b_css_hw_get_pending_snapshots(g));
78} 77}
79 78
80/* informs hw how many snapshots have been processed (frees up fifo space) */ 79/* informs hw how many snapshots have been processed (frees up fifo space) */
@@ -199,10 +198,10 @@ int gv11b_css_hw_check_data_available(struct channel_gk20a *ch, u32 *pending,
199 if (!css->hw_snapshot) 198 if (!css->hw_snapshot)
200 return -EINVAL; 199 return -EINVAL;
201 200
202 *pending = css_hw_get_pending_snapshots(g); 201 *pending = gv11b_css_hw_get_pending_snapshots(g);
203 if (!*pending) 202 if (!*pending)
204 return 0; 203 return 0;
205 204
206 *hw_overflow = css_hw_get_overflow_status(g); 205 *hw_overflow = gv11b_css_hw_get_overflow_status(g);
207 return 0; 206 return 0;
208} 207}