From 425f99335bfa13fa2af4e0865f61a4eb29fad6be Mon Sep 17 00:00:00 2001 From: Sami Kiminki Date: Tue, 15 Nov 2016 21:03:14 +0200 Subject: gpu: nvgpu: gk20a: Allow regops lists longer than 128 Process long regops lists in 4-kB fragments, overcoming the overly low limit of 128 reg ops per IOCTL call. Bump the list limit to 1024 and report the limit in GPU characteristics. Bug 200248726 Change-Id: I3ad49139409f32aea8b1226d6562e88edccc8053 Signed-off-by: Sami Kiminki Reviewed-on: http://git-master/r/1253716 (cherry picked from commit 22314619b28f52610cb8769cd4c3f9eb01904eab) Reviewed-on: http://git-master/r/1266652 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/vgpu.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index bd332583..213f6bbb 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c @@ -191,6 +191,9 @@ static void vgpu_remove_support(struct device *dev) struct tegra_vgpu_intr_msg msg; int err; + if (g->dbg_regops_tmp_buf) + kfree(g->dbg_regops_tmp_buf); + if (g->pmu.remove_support) g->pmu.remove_support(&g->pmu); @@ -242,6 +245,14 @@ static int vgpu_init_support(struct platform_device *pdev) mutex_init(&g->client_lock); mutex_init(&g->ch_wdt_lock); + g->dbg_regops_tmp_buf = kzalloc(SZ_4K, GFP_KERNEL); + if (!g->dbg_regops_tmp_buf) { + dev_err(g->dev, "couldn't allocate regops tmp buf"); + return -ENOMEM; + } + g->dbg_regops_tmp_buf_ops = + SZ_4K / sizeof(g->dbg_regops_tmp_buf[0]); + g->remove_support = vgpu_remove_support; return 0; -- cgit v1.2.2