gpu: nvgpu: Organize semaphore_gk20a.[ch]

Move semaphore_gk20a.c drivers/gpu/nvgpu/common/ since the semaphore
code is common to all chips.

Move the semaphore_gk20a.h header file to drivers/gpu/nvgpu/include/nvgpu
and rename it to semaphore.h. Also update all places where the header
is inluced to use the new path.

This revealed an odd location for the enum gk20a_mem_rw_flag. This should
be in the mm headers. As a result many places that did not need anything
semaphore related had to include the semaphore header file. Fixing this
oddity allowed the semaphore include to be removed from many C files that
did not need it.

Bug 1799159

Change-Id: Ie017219acf34c4c481747323b9f3ac33e76e064c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1284627
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
This commit is contained in:
Alex Waterman
2017-01-12 18:50:34 -08:00
committed by Varun Colbert
parent b9194a1c33
commit aa36d3786a
23 changed files with 39 additions and 56 deletions

View File

@@ -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 \

View File

@@ -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 <linux/highmem.h>
#include <linux/slab.h>
#include <asm/pgtable.h>
#include "gk20a.h"
#include "mm_gk20a.h"
#include "semaphore_gk20a.h"
#include <nvgpu/semaphore.h>
#define __lock_sema_sea(s) \
do { \

View File

@@ -34,7 +34,6 @@
#include "fence_gk20a.h"
#include "gr_gk20a.h"
#include "debug_gk20a.h"
#include "semaphore_gk20a.h"
#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>

View File

@@ -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 <nvgpu/hw/gk20a/hw_ce2_gk20a.h>
#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>

View File

@@ -28,13 +28,13 @@
#include <linux/vmalloc.h>
#include <linux/circ_buf.h>
#include "debug_gk20a.h"
#include "ctxsw_trace_gk20a.h"
#include <nvgpu/semaphore.h>
#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 <nvgpu/timers.h>

View File

@@ -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 <linux/list.h>
#include <linux/version.h>
#include <nvgpu/semaphore.h>
#include "channel_sync_gk20a.h"
#include "gk20a.h"
#include "fence_gk20a.h"
#include "semaphore_gk20a.h"
#include "sync_gk20a.h"
#include "mm_gk20a.h"

View File

@@ -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 <linux/debugfs.h>
#include <linux/seq_file.h>
#include <linux/io.h>
#include <nvgpu/semaphore.h>
#include "gk20a.h"
#include "debug_gk20a.h"
#include "semaphore_gk20a.h"
#include <nvgpu/hw/gk20a/hw_ram_gk20a.h>
#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h>

View File

@@ -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 <linux/file.h>
#include <linux/version.h>
#include <nvgpu/semaphore.h>
#include "gk20a.h"
#include "semaphore_gk20a.h"
#include "channel_gk20a.h"
#include "sync_gk20a.h"

View File

@@ -25,11 +25,11 @@
#include <linux/nvhost.h>
#include <nvgpu/timers.h>
#include <nvgpu/semaphore.h>
#include "gk20a.h"
#include "debug_gk20a.h"
#include "ctxsw_trace_gk20a.h"
#include "semaphore_gk20a.h"
#include <nvgpu/hw/gk20a/hw_fifo_gk20a.h>
#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>

View File

@@ -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"

View File

@@ -33,13 +33,13 @@
#include <nvgpu/timers.h>
#include <nvgpu/allocator.h>
#include <nvgpu/semaphore.h>
#include <nvgpu/page_allocator.h>
#include "gk20a.h"
#include "mm_gk20a.h"
#include "fence_gk20a.h"
#include "kind_gk20a.h"
#include "semaphore_gk20a.h"
#include <nvgpu/hw/gk20a/hw_gmmu_gk20a.h>
#include <nvgpu/hw/gk20a/hw_fb_gk20a.h>

View File

@@ -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) {

View File

@@ -29,7 +29,6 @@
#include "gk20a.h"
#include "gr_gk20a.h"
#include "semaphore_gk20a.h"
#include <nvgpu/hw/gk20a/hw_mc_gk20a.h>
#include <nvgpu/hw/gk20a/hw_pwr_gk20a.h>

View File

@@ -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 <linux/version.h>
#include <linux/kernel.h>
#include <linux/file.h>
@@ -23,9 +21,14 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <uapi/linux/nvgpu.h>
#include <nvgpu/semaphore.h>
#include "../drivers/staging/android/sync.h"
#include "semaphore_gk20a.h"
#include "sync_gk20a.h"
static const struct sync_timeline_ops gk20a_sync_timeline_ops;

View File

@@ -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"

View File

@@ -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 <linux/nvhost.h>
#include "gk20a/debug_gk20a.h"
#include "gk20a/semaphore_gk20a.h"
#include <nvgpu/hw/gm206/hw_ce2_gm206.h>
#include <nvgpu/hw/gm206/hw_pbdma_gm206.h>

View File

@@ -26,7 +26,6 @@
#include "gk20a/gk20a.h"
#include "gk20a/pmu_gk20a.h"
#include "gk20a/semaphore_gk20a.h"
#include <nvgpu/hw/gm20b/hw_pwr_gm20b.h>

View File

@@ -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"

View File

@@ -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"

View File

@@ -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 <linux/dma-mapping.h>
#include "gk20a/gk20a.h"
#include "gk20a/semaphore_gk20a.h"
#include "mm_gp10b.h"
#include "rpfb_gp10b.h"

View File

@@ -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 <nvgpu/allocator.h>
#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.
*/

View File

@@ -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 <linux/dma-mapping.h>
#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)

View File

@@ -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 <linux/dma-mapping.h>
#include "vgpu/vgpu.h"
#include "gk20a/semaphore_gk20a.h"
#include "gk20a/mm_gk20a.h"
static int vgpu_init_mm_setup_sw(struct gk20a *g)