diff --git a/drivers/gpu/nvgpu/Makefile.nvgpu b/drivers/gpu/nvgpu/Makefile.nvgpu index 0f8f5bc12..5c2bbb79e 100644 --- a/drivers/gpu/nvgpu/Makefile.nvgpu +++ b/drivers/gpu/nvgpu/Makefile.nvgpu @@ -32,6 +32,7 @@ nvgpu-y := \ common/mm/page_allocator.o \ common/mm/lockless_allocator.o \ common/nvgpu_common.o \ + common/semaphore.o \ gk20a/gk20a.o \ gk20a/sched_gk20a.o \ gk20a/as_gk20a.o \ @@ -48,7 +49,6 @@ nvgpu-y := \ gk20a/mm_gk20a.o \ gk20a/pmu_gk20a.o \ gk20a/priv_ring_gk20a.o \ - gk20a/semaphore_gk20a.o \ gk20a/fence_gk20a.o \ gk20a/therm_gk20a.o \ gk20a/gr_ctx_gk20a_sim.o \ diff --git a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c b/drivers/gpu/nvgpu/common/semaphore.c similarity index 97% rename from drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c rename to drivers/gpu/nvgpu/common/semaphore.c index 2038e3001..ea4910f16 100644 --- a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.c +++ b/drivers/gpu/nvgpu/common/semaphore.c @@ -1,9 +1,7 @@ /* - * drivers/video/tegra/host/gk20a/semaphore_gk20a.c + * Nvgpu Semaphores * - * GK20A Semaphores - * - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -21,11 +19,7 @@ #include #include -#include - -#include "gk20a.h" -#include "mm_gk20a.h" -#include "semaphore_gk20a.h" +#include #define __lock_sema_sea(s) \ do { \ diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index b4a1f6f43..2a9ad40dd 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c @@ -34,7 +34,6 @@ #include "fence_gk20a.h" #include "gr_gk20a.h" #include "debug_gk20a.h" -#include "semaphore_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c index 7afed41f3..62b0a05e2 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.c @@ -1,7 +1,7 @@ /* * GK20A Graphics Copy Engine (gr host) * - * Copyright (c) 2011-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2017, 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, @@ -28,7 +28,6 @@ #include "gk20a.h" #include "debug_gk20a.h" -#include "semaphore_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index c8b1c1051..3fa6bb25d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -28,13 +28,13 @@ #include #include -#include "debug_gk20a.h" -#include "ctxsw_trace_gk20a.h" +#include #include "gk20a.h" +#include "debug_gk20a.h" +#include "ctxsw_trace_gk20a.h" #include "dbg_gpu_gk20a.h" #include "fence_gk20a.h" -#include "semaphore_gk20a.h" #include diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index c3c6fbb84..0eba1c301 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -1,9 +1,7 @@ /* - * drivers/video/tegra/host/gk20a/channel_sync_gk20a.c - * * GK20A Channel Synchronization Abstraction * - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -20,10 +18,11 @@ #include #include +#include + #include "channel_sync_gk20a.h" #include "gk20a.h" #include "fence_gk20a.h" -#include "semaphore_gk20a.h" #include "sync_gk20a.h" #include "mm_gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c index 37ba720a1..83fdc05dd 100644 --- a/drivers/gpu/nvgpu/gk20a/debug_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/debug_gk20a.c @@ -1,6 +1,4 @@ /* - * drivers/video/tegra/host/t20/debug_gk20a.c - * * Copyright (C) 2011-2017 NVIDIA Corporation. All rights reserved. * * This software is licensed under the terms of the GNU General Public @@ -20,12 +18,12 @@ #include #include - #include +#include + #include "gk20a.h" #include "debug_gk20a.h" -#include "semaphore_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c index b8a1dcbc0..6bd590679 100644 --- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -17,8 +17,9 @@ #include #include +#include + #include "gk20a.h" -#include "semaphore_gk20a.h" #include "channel_gk20a.h" #include "sync_gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 469148c29..c6b444f96 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -25,11 +25,11 @@ #include #include +#include #include "gk20a.h" #include "debug_gk20a.h" #include "ctxsw_trace_gk20a.h" -#include "semaphore_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index cddb33160..0e1c88a47 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -41,7 +41,6 @@ #include "regops_gk20a.h" #include "dbg_gpu_gk20a.h" #include "debug_gk20a.h" -#include "semaphore_gk20a.h" #include "platform_gk20a.h" #include "ctxsw_trace_gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index ea5ea73f5..cafb1233d 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -33,13 +33,13 @@ #include #include +#include #include #include "gk20a.h" #include "mm_gk20a.h" #include "fence_gk20a.h" #include "kind_gk20a.h" -#include "semaphore_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h index f3dffa46b..d39ca2d0d 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h @@ -52,6 +52,12 @@ enum gk20a_aperture { APERTURE_VIDMEM }; +enum gk20a_mem_rw_flag { + gk20a_mem_flag_none = 0, + gk20a_mem_flag_read_only = 1, + gk20a_mem_flag_write_only = 2, +}; + static inline const char *gk20a_aperture_str(enum gk20a_aperture aperture) { switch (aperture) { diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index 9924e48fa..d53cf09b6 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -29,7 +29,6 @@ #include "gk20a.h" #include "gr_gk20a.h" -#include "semaphore_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c index b642981c3..e7bacac84 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c @@ -1,7 +1,7 @@ /* * GK20A Sync Framework Integration * - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -13,8 +13,6 @@ * more details. */ -#include "sync_gk20a.h" - #include #include #include @@ -23,9 +21,14 @@ #include #include #include + #include + +#include + #include "../drivers/staging/android/sync.h" -#include "semaphore_gk20a.h" + +#include "sync_gk20a.h" static const struct sync_timeline_ops gk20a_sync_timeline_ops; diff --git a/drivers/gpu/nvgpu/gm206/acr_gm206.c b/drivers/gpu/nvgpu/gm206/acr_gm206.c index 238114e34..3af593741 100644 --- a/drivers/gpu/nvgpu/gm206/acr_gm206.c +++ b/drivers/gpu/nvgpu/gm206/acr_gm206.c @@ -21,7 +21,6 @@ #include "gk20a/gk20a.h" #include "gk20a/pmu_gk20a.h" -#include "gk20a/semaphore_gk20a.h" #include "acr.h" #include "acr_gm206.h" diff --git a/drivers/gpu/nvgpu/gm206/ce_gm206.c b/drivers/gpu/nvgpu/gm206/ce_gm206.c index 5d5fd432a..dd3eac95f 100644 --- a/drivers/gpu/nvgpu/gm206/ce_gm206.c +++ b/drivers/gpu/nvgpu/gm206/ce_gm206.c @@ -1,7 +1,7 @@ /* * GM206 Copy Engine. * - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, 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, @@ -29,7 +29,6 @@ #include #include "gk20a/debug_gk20a.h" -#include "gk20a/semaphore_gk20a.h" #include #include diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c index 060dc778b..40a28136b 100644 --- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c @@ -26,7 +26,6 @@ #include "gk20a/gk20a.h" #include "gk20a/pmu_gk20a.h" -#include "gk20a/semaphore_gk20a.h" #include diff --git a/drivers/gpu/nvgpu/gp106/acr_gp106.c b/drivers/gpu/nvgpu/gp106/acr_gp106.c index 9e8449943..f8d7ba705 100644 --- a/drivers/gpu/nvgpu/gp106/acr_gp106.c +++ b/drivers/gpu/nvgpu/gp106/acr_gp106.c @@ -21,7 +21,6 @@ #include "gk20a/gk20a.h" #include "gk20a/pmu_gk20a.h" -#include "gk20a/semaphore_gk20a.h" #include "gm206/acr_gm206.h" #include "gm20b/acr_gm20b.h" diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index e04aec7d8..a7aa40034 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -24,7 +24,6 @@ #include "gk20a/gk20a.h" #include "gk20a/gr_gk20a.h" -#include "gk20a/semaphore_gk20a.h" #include "gk20a/dbg_gpu_gk20a.h" #include "gm20b/gr_gm20b.h" diff --git a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c index 835d33f34..776bbe855 100644 --- a/drivers/gpu/nvgpu/gp10b/mm_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/mm_gp10b.c @@ -1,7 +1,7 @@ /* * GP10B MMU * - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -17,7 +17,6 @@ #include #include "gk20a/gk20a.h" -#include "gk20a/semaphore_gk20a.h" #include "mm_gp10b.h" #include "rpfb_gp10b.h" diff --git a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h similarity index 97% rename from drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h rename to drivers/gpu/nvgpu/include/nvgpu/semaphore.h index 8e09fcfca..07a275846 100644 --- a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h +++ b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -20,9 +20,9 @@ #include -#include "gk20a.h" -#include "mm_gk20a.h" -#include "channel_gk20a.h" +#include "gk20a/gk20a.h" +#include "gk20a/mm_gk20a.h" +#include "gk20a/channel_gk20a.h" #define gpu_sema_dbg(fmt, args...) \ gk20a_dbg(gpu_dbg_sema, fmt, ##args) @@ -146,12 +146,6 @@ struct gk20a_semaphore_sea { struct mutex sea_lock; /* Lock alloc/free calls. */ }; -enum gk20a_mem_rw_flag { - gk20a_mem_flag_none = 0, - gk20a_mem_flag_read_only = 1, - gk20a_mem_flag_write_only = 2, -}; - /* * Semaphore sea functions. */ diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c index 66fda2d9c..3d908b0d4 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_mm_gp10b.c @@ -1,7 +1,7 @@ /* * Virtualized GPU Memory Management * - * Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2015-2017, 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, @@ -16,7 +16,6 @@ #include #include "vgpu/vgpu.h" #include "vgpu_mm_gp10b.h" -#include "gk20a/semaphore_gk20a.h" #include "gk20a/mm_gk20a.h" static int vgpu_gp10b_init_mm_setup_hw(struct gk20a *g) diff --git a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c index f97acd47b..eb5f77494 100644 --- a/drivers/gpu/nvgpu/vgpu/mm_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/mm_vgpu.c @@ -1,7 +1,7 @@ /* * Virtualized GPU Memory Management * - * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2014-2017, 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, @@ -15,7 +15,6 @@ #include #include "vgpu/vgpu.h" -#include "gk20a/semaphore_gk20a.h" #include "gk20a/mm_gk20a.h" static int vgpu_init_mm_setup_sw(struct gk20a *g)