summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-02-20 21:15:04 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:56:54 -0400
commit325e0587d9180b05d59869679fc06b0ba979d973 (patch)
treedc7e743440c5e86d72c1a2850b8b93a0cc9d0296 /drivers/gpu/nvgpu/gk20a
parent1b6372ec6b8704d6bacc6b8abf7e599f1cbc15ca (diff)
gpu: nvgpu: Allow enabling PC sampling
Allow enabling of PC sampling hardware workaround. It is only applicable to gm20b. Bug 1517458 Bug 1573150 Change-Id: Iad6a3ae556489fb7ab9628637d291849d2cd98ea Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/710421
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r--drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c16
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h1
3 files changed, 19 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
index ffb52549..7cda9949 100644
--- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c
@@ -377,6 +377,17 @@ static int gk20a_perfbuf_map(struct dbg_session_gk20a *dbg_s,
377static int gk20a_perfbuf_unmap(struct dbg_session_gk20a *dbg_s, 377static int gk20a_perfbuf_unmap(struct dbg_session_gk20a *dbg_s,
378 struct nvgpu_dbg_gpu_perfbuf_unmap_args *args); 378 struct nvgpu_dbg_gpu_perfbuf_unmap_args *args);
379 379
380static int gk20a_dbg_pc_sampling(struct dbg_session_gk20a *dbg_s,
381 struct nvgpu_dbg_gpu_pc_sampling_args *args)
382{
383 struct channel_gk20a *ch = dbg_s->ch;
384 struct gk20a *g = ch->g;
385
386 gk20a_dbg_fn("");
387
388 return g->ops.gr.update_pc_sampling ?
389 g->ops.gr.update_pc_sampling(ch, args->enable) : -EINVAL;
390}
380long gk20a_dbg_gpu_dev_ioctl(struct file *filp, unsigned int cmd, 391long gk20a_dbg_gpu_dev_ioctl(struct file *filp, unsigned int cmd,
381 unsigned long arg) 392 unsigned long arg)
382{ 393{
@@ -449,6 +460,11 @@ long gk20a_dbg_gpu_dev_ioctl(struct file *filp, unsigned int cmd,
449 (struct nvgpu_dbg_gpu_perfbuf_unmap_args *)buf); 460 (struct nvgpu_dbg_gpu_perfbuf_unmap_args *)buf);
450 break; 461 break;
451 462
463 case NVGPU_DBG_GPU_IOCTL_PC_SAMPLING:
464 err = gk20a_dbg_pc_sampling(dbg_s,
465 (struct nvgpu_dbg_gpu_pc_sampling_args *)buf);
466 break;
467
452 default: 468 default:
453 gk20a_err(dev_from_gk20a(g), 469 gk20a_err(dev_from_gk20a(g),
454 "unrecognized dbg gpu ioctl cmd: 0x%x", 470 "unrecognized dbg gpu ioctl cmd: 0x%x",
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index acee2e48..441ea7cc 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -165,6 +165,8 @@ struct gpu_ops {
165 void *ctx_ptr); 165 void *ctx_ptr);
166 int (*dump_gr_regs)(struct gk20a *g, 166 int (*dump_gr_regs)(struct gk20a *g,
167 struct gk20a_debug_output *o); 167 struct gk20a_debug_output *o);
168 int (*update_pc_sampling)(struct channel_gk20a *ch,
169 bool enable);
168 } gr; 170 } gr;
169 const char *name; 171 const char *name;
170 struct { 172 struct {
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index 4b94f863..deafc438 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -500,4 +500,5 @@ int gr_gk20a_alloc_gr_ctx(struct gk20a *g,
500void gr_gk20a_free_gr_ctx(struct gk20a *g, 500void gr_gk20a_free_gr_ctx(struct gk20a *g,
501 struct vm_gk20a *vm, struct gr_ctx_desc *gr_ctx); 501 struct vm_gk20a *vm, struct gr_ctx_desc *gr_ctx);
502int gr_gk20a_halt_pipe(struct gk20a *g); 502int gr_gk20a_halt_pipe(struct gk20a *g);
503
503#endif /*__GR_GK20A_H__*/ 504#endif /*__GR_GK20A_H__*/