mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
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 <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1235541 (cherry picked from commit 1ef73ecb4e37da042e7117426ab2823b7f4528dc) Reviewed-on: http://git-master/r/1239955 GVS: Gerrit_Virtual_Submit
45 lines
1.2 KiB
C
45 lines
1.2 KiB
C
/*
|
|
* 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 <linux/types.h>
|
|
#include <linux/delay.h>
|
|
|
|
#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 = gp106_fb_reset;
|
|
}
|