From 3bccca16b88a9629ef4ae72c0b9314761ab033ca Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 26 Aug 2016 10:18:16 -0700 Subject: gpu: nvgpu: gp106: Skip resetting FB FB is enabled in devinit. Skip resetting it in GPU boot. Bug 1799537 Change-Id: I0748127f0962e7d6d2bf0ecece6773fdf9c35bc8 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1208715 (cherry picked from commit ceafac52f5711bd987b746686f11b22807f74698) Reviewed-on: http://git-master/r/1227265 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gp106/fb_gp106.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 drivers/gpu/nvgpu/gp106/fb_gp106.c (limited to 'drivers/gpu/nvgpu/gp106/fb_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/fb_gp106.c b/drivers/gpu/nvgpu/gp106/fb_gp106.c new file mode 100644 index 00000000..1c5b3e0a --- /dev/null +++ b/drivers/gpu/nvgpu/gp106/fb_gp106.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include + +#include "gk20a/gk20a.h" +#include "gp10b/fb_gp10b.h" + +void gp106_init_fb(struct gpu_ops *gops) +{ + gp10b_init_fb(gops); + + gops->fb.init_fs_state = NULL; + gops->fb.reset = NULL; +} -- cgit v1.2.2 From b6408e26c1a6c4c91233c144bae84db9728c4338 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 12 Oct 2016 15:24:11 -0700 Subject: gpu: nvgpu: At FB reset wait for scrubber We need to wait for scrubber to have finished before we can allow any accesses to memory. Do the wait in place where on iGPU we would do FB reset. Bug 1799537 Bug 1815139 Change-Id: Ic92dee936388a13c4abf0b295fd99581522c430f Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1235541 (cherry picked from commit 1ef73ecb4e37da042e7117426ab2823b7f4528dc) Reviewed-on: http://git-master/r/1239955 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/gp106/fb_gp106.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gp106/fb_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/fb_gp106.c b/drivers/gpu/nvgpu/gp106/fb_gp106.c index 1c5b3e0a..ef9f1094 100644 --- a/drivers/gpu/nvgpu/gp106/fb_gp106.c +++ b/drivers/gpu/nvgpu/gp106/fb_gp106.c @@ -12,14 +12,33 @@ */ #include +#include #include "gk20a/gk20a.h" #include "gp10b/fb_gp10b.h" +#include "hw_fb_gp106.h" + +#define HW_SCRUB_TIMEOUT_DEFAULT 100 /* usec */ +#define HW_SCRUB_TIMEOUT_MAX 2000000 /* usec */ + +static void gp106_fb_reset(struct gk20a *g) +{ + int retries = HW_SCRUB_TIMEOUT_MAX / HW_SCRUB_TIMEOUT_DEFAULT; + /* wait for memory to be accessible */ + do { + u32 w = gk20a_readl(g, fb_niso_scrub_status_r()); + if (fb_niso_scrub_status_flag_v(w)) { + gk20a_dbg_fn("done"); + break; + } + udelay(HW_SCRUB_TIMEOUT_DEFAULT); + } while (--retries); +} void gp106_init_fb(struct gpu_ops *gops) { gp10b_init_fb(gops); gops->fb.init_fs_state = NULL; - gops->fb.reset = NULL; + gops->fb.reset = gp106_fb_reset; } -- cgit v1.2.2