summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDebarshi Dutta <ddutta@nvidia.com>2018-05-10 23:48:48 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-14 09:07:12 -0400
commita51eb9da021c2934e196c5d8be04551703e6bb5b (patch)
tree843036626eff3733759ab003fc577a1ae2e729ae
parent4dac924aba27aa46267fb39f3ed968318292a7f5 (diff)
gpu: nvgpu: move sync_gk20a under common/linux directory
sync_gk20a.* files are no longer used by core code and only invoked from linux specific implementations of the OS_FENCE framework which are under the common/linux directory. Hence, sync_gk20a.* files are also moved under common/linux. JIRA NVGPU-66 Change-Id: If623524611373d2da39b63cfb3c1e40089bf8d22 Signed-off-by: Debarshi Dutta <ddutta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1712900 Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/Makefile2
-rw-r--r--drivers/gpu/nvgpu/common/linux/channel.c2
-rw-r--r--drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c3
-rw-r--r--drivers/gpu/nvgpu/common/linux/os_fence_android_syncpt.c1
-rw-r--r--drivers/gpu/nvgpu/common/linux/sync_sema_android.c (renamed from drivers/gpu/nvgpu/gk20a/sync_gk20a.c)30
-rw-r--r--drivers/gpu/nvgpu/common/linux/sync_sema_android.h51
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c1
-rw-r--r--drivers/gpu/nvgpu/gk20a/sync_gk20a.h59
9 files changed, 67 insertions, 83 deletions
diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile
index 5af7de35..8f8f8dc8 100644
--- a/drivers/gpu/nvgpu/Makefile
+++ b/drivers/gpu/nvgpu/Makefile
@@ -160,7 +160,7 @@ nvgpu-$(CONFIG_TEGRA_GK20A) += \
160 common/linux/platform_gp10b_tegra.o \ 160 common/linux/platform_gp10b_tegra.o \
161 common/linux/platform_gv11b_tegra.o 161 common/linux/platform_gv11b_tegra.o
162 162
163nvgpu-$(CONFIG_SYNC) += gk20a/sync_gk20a.o \ 163nvgpu-$(CONFIG_SYNC) += common/linux/sync_sema_android.o \
164 common/linux/os_fence_android.o \ 164 common/linux/os_fence_android.o \
165 common/linux/os_fence_android_sema.o 165 common/linux/os_fence_android_sema.o
166 166
diff --git a/drivers/gpu/nvgpu/common/linux/channel.c b/drivers/gpu/nvgpu/common/linux/channel.c
index d767374b..1e170b30 100644
--- a/drivers/gpu/nvgpu/common/linux/channel.c
+++ b/drivers/gpu/nvgpu/common/linux/channel.c
@@ -40,7 +40,7 @@
40#include <trace/events/gk20a.h> 40#include <trace/events/gk20a.h>
41#include <uapi/linux/nvgpu.h> 41#include <uapi/linux/nvgpu.h>
42 42
43#include "gk20a/sync_gk20a.h" 43#include "sync_sema_android.h"
44 44
45u32 nvgpu_submit_gpfifo_user_flags_to_common_flags(u32 user_flags) 45u32 nvgpu_submit_gpfifo_user_flags_to_common_flags(u32 user_flags)
46{ 46{
diff --git a/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c b/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c
index d4aeb6ed..2bb71c99 100644
--- a/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c
+++ b/drivers/gpu/nvgpu/common/linux/os_fence_android_sema.c
@@ -21,10 +21,11 @@
21#include <nvgpu/linux/os_fence_android.h> 21#include <nvgpu/linux/os_fence_android.h>
22#include <nvgpu/semaphore.h> 22#include <nvgpu/semaphore.h>
23 23
24#include "gk20a/sync_gk20a.h"
25#include "gk20a/channel_sync_gk20a.h" 24#include "gk20a/channel_sync_gk20a.h"
26#include "gk20a/mm_gk20a.h" 25#include "gk20a/mm_gk20a.h"
27 26
27#include "sync_sema_android.h"
28
28#include "../drivers/staging/android/sync.h" 29#include "../drivers/staging/android/sync.h"
29 30
30int nvgpu_os_fence_sema_wait_gen_cmd(struct nvgpu_os_fence *s, 31int nvgpu_os_fence_sema_wait_gen_cmd(struct nvgpu_os_fence *s,
diff --git a/drivers/gpu/nvgpu/common/linux/os_fence_android_syncpt.c b/drivers/gpu/nvgpu/common/linux/os_fence_android_syncpt.c
index b3712011..d7a72fcd 100644
--- a/drivers/gpu/nvgpu/common/linux/os_fence_android_syncpt.c
+++ b/drivers/gpu/nvgpu/common/linux/os_fence_android_syncpt.c
@@ -24,7 +24,6 @@
24 24
25#include "gk20a/gk20a.h" 25#include "gk20a/gk20a.h"
26#include "gk20a/channel_gk20a.h" 26#include "gk20a/channel_gk20a.h"
27#include "gk20a/sync_gk20a.h"
28#include "gk20a/channel_sync_gk20a.h" 27#include "gk20a/channel_sync_gk20a.h"
29#include "gk20a/mm_gk20a.h" 28#include "gk20a/mm_gk20a.h"
30 29
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/common/linux/sync_sema_android.c
index 56c90da7..fad21351 100644
--- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c
+++ b/drivers/gpu/nvgpu/common/linux/sync_sema_android.c
@@ -1,25 +1,19 @@
1/* 1/*
2 * GK20A Sync Framework Integration 2 * Semaphore Sync Framework Integration
3 * 3 *
4 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2017-2018, NVIDIA Corporation. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * This program is free software; you can redistribute it and/or modify it
7 * copy of this software and associated documentation files (the "Software"), 7 * under the terms and conditions of the GNU General Public License,
8 * to deal in the Software without restriction, including without limitation 8 * version 2, as published by the Free Software Foundation.
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 * 9 *
13 * The above copyright notice and this permission notice shall be included in 10 * This program is distributed in the hope it will be useful, but WITHOUT
14 * all copies or substantial portions of the Software. 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 * 14 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 * You should have received a copy of the GNU General Public License
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */ 17 */
24 18
25#include <linux/file.h> 19#include <linux/file.h>
@@ -36,7 +30,7 @@
36 30
37#include "../drivers/staging/android/sync.h" 31#include "../drivers/staging/android/sync.h"
38 32
39#include "sync_gk20a.h" 33#include "sync_sema_android.h"
40 34
41static const struct sync_timeline_ops gk20a_sync_timeline_ops; 35static const struct sync_timeline_ops gk20a_sync_timeline_ops;
42 36
diff --git a/drivers/gpu/nvgpu/common/linux/sync_sema_android.h b/drivers/gpu/nvgpu/common/linux/sync_sema_android.h
new file mode 100644
index 00000000..4fca7bed
--- /dev/null
+++ b/drivers/gpu/nvgpu/common/linux/sync_sema_android.h
@@ -0,0 +1,51 @@
1/*
2 * Semaphore Sync Framework Integration
3 *
4 * Copyright (c) 2017-2018, NVIDIA Corporation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef _GK20A_SYNC_H_
20#define _GK20A_SYNC_H_
21
22struct sync_timeline;
23struct sync_fence;
24struct sync_pt;
25struct nvgpu_semaphore;
26struct fence;
27
28#ifdef CONFIG_SYNC
29struct sync_timeline *gk20a_sync_timeline_create(const char *name);
30void gk20a_sync_timeline_destroy(struct sync_timeline *);
31void gk20a_sync_timeline_signal(struct sync_timeline *);
32struct sync_fence *gk20a_sync_fence_create(
33 struct channel_gk20a *c,
34 struct nvgpu_semaphore *,
35 const char *fmt, ...);
36struct sync_fence *gk20a_sync_fence_fdget(int fd);
37struct nvgpu_semaphore *gk20a_sync_pt_sema(struct sync_pt *spt);
38#else
39static inline void gk20a_sync_timeline_destroy(struct sync_timeline *obj) {}
40static inline void gk20a_sync_timeline_signal(struct sync_timeline *obj) {}
41static inline struct sync_fence *gk20a_sync_fence_fdget(int fd)
42{
43 return NULL;
44}
45static inline struct sync_timeline *gk20a_sync_timeline_create(
46 const char *name) {
47 return NULL;
48}
49#endif
50
51#endif
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index a2047444..68fbb738 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -34,7 +34,6 @@
34#include "channel_sync_gk20a.h" 34#include "channel_sync_gk20a.h"
35#include "gk20a.h" 35#include "gk20a.h"
36#include "fence_gk20a.h" 36#include "fence_gk20a.h"
37#include "sync_gk20a.h"
38#include "mm_gk20a.h" 37#include "mm_gk20a.h"
39 38
40#ifdef CONFIG_TEGRA_GK20A_NVHOST 39#ifdef CONFIG_TEGRA_GK20A_NVHOST
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index 0f7f3ea1..142663dd 100644
--- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
@@ -31,7 +31,6 @@
31 31
32#include "gk20a.h" 32#include "gk20a.h"
33#include "channel_gk20a.h" 33#include "channel_gk20a.h"
34#include "sync_gk20a.h"
35 34
36struct gk20a_fence_ops { 35struct gk20a_fence_ops {
37 int (*wait)(struct gk20a_fence *, long timeout); 36 int (*wait)(struct gk20a_fence *, long timeout);
diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h b/drivers/gpu/nvgpu/gk20a/sync_gk20a.h
deleted file mode 100644
index ffdfaec3..00000000
--- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * drivers/video/tegra/host/gk20a/sync_gk20a.h
3 *
4 * GK20A Sync Framework Integration
5 *
6 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
7 *
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
25 */
26
27#ifndef _GK20A_SYNC_H_
28#define _GK20A_SYNC_H_
29
30struct sync_timeline;
31struct sync_fence;
32struct sync_pt;
33struct nvgpu_semaphore;
34struct fence;
35
36#ifdef CONFIG_SYNC
37struct sync_timeline *gk20a_sync_timeline_create(const char *name);
38void gk20a_sync_timeline_destroy(struct sync_timeline *);
39void gk20a_sync_timeline_signal(struct sync_timeline *);
40struct sync_fence *gk20a_sync_fence_create(
41 struct channel_gk20a *c,
42 struct nvgpu_semaphore *,
43 const char *fmt, ...);
44struct sync_fence *gk20a_sync_fence_fdget(int fd);
45struct nvgpu_semaphore *gk20a_sync_pt_sema(struct sync_pt *spt);
46#else
47static inline void gk20a_sync_timeline_destroy(struct sync_timeline *obj) {}
48static inline void gk20a_sync_timeline_signal(struct sync_timeline *obj) {}
49static inline struct sync_fence *gk20a_sync_fence_fdget(int fd)
50{
51 return NULL;
52}
53static inline struct sync_timeline *gk20a_sync_timeline_create(
54 const char *name) {
55 return NULL;
56}
57#endif
58
59#endif