summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/regops_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gm20b/regops_gm20b.c3
-rw-r--r--drivers/gpu/nvgpu/gp106/regops_gp106.c3
-rw-r--r--drivers/gpu/nvgpu/gp10b/regops_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/bsearch.h20
6 files changed, 28 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 06374fb7..96ec7f6e 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -26,7 +26,6 @@
26#include <linux/firmware.h> 26#include <linux/firmware.h>
27#include <linux/nvhost.h> 27#include <linux/nvhost.h>
28#include <linux/sort.h> 28#include <linux/sort.h>
29#include <linux/bsearch.h>
30#include <trace/events/gk20a.h> 29#include <trace/events/gk20a.h>
31 30
32#include <nvgpu/dma.h> 31#include <nvgpu/dma.h>
@@ -34,6 +33,7 @@
34#include <nvgpu/timers.h> 33#include <nvgpu/timers.h>
35#include <nvgpu/nvgpu_common.h> 34#include <nvgpu/nvgpu_common.h>
36#include <nvgpu/log.h> 35#include <nvgpu/log.h>
36#include <nvgpu/bsearch.h>
37 37
38#include "gk20a.h" 38#include "gk20a.h"
39#include "kind_gk20a.h" 39#include "kind_gk20a.h"
diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
index b19b16d7..128c00b5 100644
--- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/bsearch.h>
21#include <uapi/linux/nvgpu.h> 20#include <uapi/linux/nvgpu.h>
22 21
23#include "gk20a.h" 22#include "gk20a.h"
@@ -26,6 +25,7 @@
26#include "regops_gk20a.h" 25#include "regops_gk20a.h"
27 26
28#include <nvgpu/log.h> 27#include <nvgpu/log.h>
28#include <nvgpu/bsearch.h>
29 29
30static int regop_bsearch_range_cmp(const void *pkey, const void *pelem) 30static int regop_bsearch_range_cmp(const void *pkey, const void *pelem)
31{ 31{
diff --git a/drivers/gpu/nvgpu/gm20b/regops_gm20b.c b/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
index 1a6e6d7c..e06ee869 100644
--- a/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/regops_gm20b.c
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/bsearch.h>
21#include <uapi/linux/nvgpu.h> 20#include <uapi/linux/nvgpu.h>
22 21
23#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
@@ -25,6 +24,8 @@
25#include "gk20a/regops_gk20a.h" 24#include "gk20a/regops_gk20a.h"
26#include "regops_gm20b.h" 25#include "regops_gm20b.h"
27 26
27#include <nvgpu/bsearch.h>
28
28static const struct regop_offset_range gm20b_global_whitelist_ranges[] = { 29static const struct regop_offset_range gm20b_global_whitelist_ranges[] = {
29 { 0x00001a00, 3 }, 30 { 0x00001a00, 3 },
30 { 0x0000259c, 1 }, 31 { 0x0000259c, 1 },
diff --git a/drivers/gpu/nvgpu/gp106/regops_gp106.c b/drivers/gpu/nvgpu/gp106/regops_gp106.c
index 9de1d3a3..0d90977d 100644
--- a/drivers/gpu/nvgpu/gp106/regops_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/regops_gp106.c
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/bsearch.h>
21#include <uapi/linux/nvgpu.h> 20#include <uapi/linux/nvgpu.h>
22 21
23#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
@@ -25,6 +24,8 @@
25#include "gk20a/regops_gk20a.h" 24#include "gk20a/regops_gk20a.h"
26#include "regops_gp106.h" 25#include "regops_gp106.h"
27 26
27#include <nvgpu/bsearch.h>
28
28static const struct regop_offset_range gp106_global_whitelist_ranges[] = { 29static const struct regop_offset_range gp106_global_whitelist_ranges[] = {
29 { 0x000004f0, 1}, 30 { 0x000004f0, 1},
30 { 0x00001a00, 3}, 31 { 0x00001a00, 3},
diff --git a/drivers/gpu/nvgpu/gp10b/regops_gp10b.c b/drivers/gpu/nvgpu/gp10b/regops_gp10b.c
index b880fda1..33e331a4 100644
--- a/drivers/gpu/nvgpu/gp10b/regops_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/regops_gp10b.c
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/bsearch.h>
21#include <uapi/linux/nvgpu.h> 20#include <uapi/linux/nvgpu.h>
22 21
23#include "gk20a/gk20a.h" 22#include "gk20a/gk20a.h"
@@ -25,6 +24,8 @@
25#include "gk20a/regops_gk20a.h" 24#include "gk20a/regops_gk20a.h"
26#include "regops_gp10b.h" 25#include "regops_gp10b.h"
27 26
27#include <nvgpu/bsearch.h>
28
28static const struct regop_offset_range gp10b_global_whitelist_ranges[] = { 29static const struct regop_offset_range gp10b_global_whitelist_ranges[] = {
29 { 0x000004f0, 1}, 30 { 0x000004f0, 1},
30 { 0x00001a00, 3}, 31 { 0x00001a00, 3},
diff --git a/drivers/gpu/nvgpu/include/nvgpu/bsearch.h b/drivers/gpu/nvgpu/include/nvgpu/bsearch.h
new file mode 100644
index 00000000..6140be26
--- /dev/null
+++ b/drivers/gpu/nvgpu/include/nvgpu/bsearch.h
@@ -0,0 +1,20 @@
1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13#ifndef __NVGPU_BSEARCH_H__
14#define __NVGPU_BSEARCH_H__
15
16#ifdef __KERNEL__
17#include <linux/bsearch.h>
18#endif
19
20#endif