From c32ac10b0bba400c1e83540a20c5ca210fa48613 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 11 Jun 2014 14:53:38 +0300 Subject: gpu: nvgpu: Dump offending push buffer fragment When outputting debug dump, print the contents of current push buffer segment. Also changes the debug dump to use pr_cont when applicable, and dumps state before recovering in case channel was not loaded to an engine. Bug 1498688 Change-Id: I5ca12f64bae8f12333d82350278c700645d5007e Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/422198 --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 0f805214..486e815c 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -929,6 +929,21 @@ static void channel_gk20a_free_priv_cmdbuf(struct channel_gk20a *c) memset(q, 0, sizeof(struct priv_cmd_queue)); } +int gk20a_find_from_priv_cmdbuf(struct channel_gk20a *c, + u64 gpu_va, u32 **cpu_va) +{ + struct priv_cmd_queue *q = &c->priv_cmd_q; + int ret; + + if (gpu_va >= q->base_gpuva && gpu_va < (q->base_gpuva + q->size)) { + *cpu_va = gpu_va - q->base_gpuva + q->mem.base_cpuva; + ret = 0; + } else + ret = -EINVAL; + + return ret; +} + /* allocate a cmd buffer with given size. size is number of u32 entries */ int gk20a_channel_alloc_priv_cmdbuf(struct channel_gk20a *c, u32 orig_size, struct priv_cmd_entry **entry) -- cgit v1.2.2