summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/fb_gp106.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/fb_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/fb_gp106.c21
1 files changed, 20 insertions, 1 deletions
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 @@
12 */ 12 */
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/delay.h>
15 16
16#include "gk20a/gk20a.h" 17#include "gk20a/gk20a.h"
17#include "gp10b/fb_gp10b.h" 18#include "gp10b/fb_gp10b.h"
19#include "hw_fb_gp106.h"
20
21#define HW_SCRUB_TIMEOUT_DEFAULT 100 /* usec */
22#define HW_SCRUB_TIMEOUT_MAX 2000000 /* usec */
23
24static void gp106_fb_reset(struct gk20a *g)
25{
26 int retries = HW_SCRUB_TIMEOUT_MAX / HW_SCRUB_TIMEOUT_DEFAULT;
27 /* wait for memory to be accessible */
28 do {
29 u32 w = gk20a_readl(g, fb_niso_scrub_status_r());
30 if (fb_niso_scrub_status_flag_v(w)) {
31 gk20a_dbg_fn("done");
32 break;
33 }
34 udelay(HW_SCRUB_TIMEOUT_DEFAULT);
35 } while (--retries);
36}
18 37
19void gp106_init_fb(struct gpu_ops *gops) 38void gp106_init_fb(struct gpu_ops *gops)
20{ 39{
21 gp10b_init_fb(gops); 40 gp10b_init_fb(gops);
22 41
23 gops->fb.init_fs_state = NULL; 42 gops->fb.init_fs_state = NULL;
24 gops->fb.reset = NULL; 43 gops->fb.reset = gp106_fb_reset;
25} 44}