mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: vgpu: cleanup vgpu.h
- delete vgpu_is_reduced_bar1(). Current implementation maps only that portion of BAR1 that is reserved for guest in case of reduced BAR1. However this code is obsolete and reduced BAR1 check is always false. Delete related function vgpu_is_reduced_bar1() and conditional mapping. - move vgpu_mm_bar1_map_userd() delcaration from vgpu.h to mm_vgpu.h - move vgpu_gp10b_init_hal() and vgpu_gv11b_init_hal() declarations from vgpu.h to new header files vgpu/gp10b/vgpu_hal_gp10b.h and vgpu/gv11b/vgpu_hal_gv11b.h respectively. Jira GVSCI-334 Change-Id: I11a297a0aba1afd8b0ad022169ba7f734bcd952c Signed-off-by: Aparna Das <aparnad@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2081152 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
862bddc3eb
commit
bd8b866758
@@ -66,6 +66,7 @@
|
||||
#include "common/vgpu/perf/cyclestats_snapshot_vgpu.h"
|
||||
#include "common/vgpu/ptimer/ptimer_vgpu.h"
|
||||
#include "common/vgpu/init/init_vgpu.h"
|
||||
#include "vgpu_hal_gp10b.h"
|
||||
#include "gp10b/gp10b.h"
|
||||
#include "gp10b/hal_gp10b.h"
|
||||
|
||||
|
||||
30
drivers/gpu/nvgpu/common/vgpu/gp10b/vgpu_hal_gp10b.h
Normal file
30
drivers/gpu/nvgpu/common/vgpu/gp10b/vgpu_hal_gp10b.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VGPU_HAL_GP10B_H
|
||||
#define VGPU_HAL_GP10B_H
|
||||
|
||||
struct gk20a;
|
||||
|
||||
int vgpu_gp10b_init_hal(struct gk20a *g);
|
||||
|
||||
#endif
|
||||
@@ -84,6 +84,7 @@
|
||||
#include "common/vgpu/perf/cyclestats_snapshot_vgpu.h"
|
||||
#include "common/vgpu/fifo/vgpu_fifo_gv11b.h"
|
||||
#include "common/vgpu/ptimer/ptimer_vgpu.h"
|
||||
#include "vgpu_hal_gv11b.h"
|
||||
|
||||
#include <gm20b/gr_gm20b.h>
|
||||
#include <gm20b/fifo_gm20b.h>
|
||||
|
||||
30
drivers/gpu/nvgpu/common/vgpu/gv11b/vgpu_hal_gv11b.h
Normal file
30
drivers/gpu/nvgpu/common/vgpu/gv11b/vgpu_hal_gv11b.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef VGPU_HAL_GV11B_H
|
||||
#define VGPU_HAL_GV11B_H
|
||||
|
||||
struct gk20a;
|
||||
|
||||
int vgpu_gv11b_init_hal(struct gk20a *g);
|
||||
|
||||
#endif
|
||||
@@ -133,24 +133,6 @@ u64 vgpu_mm_bar1_map_userd(struct gk20a *g, struct nvgpu_mem *mem, u32 offset)
|
||||
addr = 0;
|
||||
} else {
|
||||
addr = p->gpu_va;
|
||||
|
||||
/* Server returns gpu_va assuming full BAR1 range.
|
||||
* In case of reduced BAR1 configuration, we only map
|
||||
* the portion of BAR1 reserved for this guest.
|
||||
* As a result, we need to use the offset from the start
|
||||
* of this range, instead of the gpu_va.
|
||||
*
|
||||
* offset
|
||||
* <---->
|
||||
* Guest IPA +========+
|
||||
* : X :
|
||||
* BAR1 PA +----+========+-----------+
|
||||
* <--------->
|
||||
* gpu_va
|
||||
*/
|
||||
if (vgpu_is_reduced_bar1(g)) {
|
||||
addr = offset;
|
||||
}
|
||||
}
|
||||
|
||||
return addr;
|
||||
|
||||
@@ -63,5 +63,6 @@ u64 vgpu_locked_gmmu_map(struct vm_gk20a *vm,
|
||||
struct vm_gk20a_mapping_batch *batch,
|
||||
enum nvgpu_aperture aperture);
|
||||
int vgpu_init_mm_support(struct gk20a *g);
|
||||
u64 vgpu_mm_bar1_map_userd(struct gk20a *g, struct nvgpu_mem *mem, u32 offset);
|
||||
|
||||
#endif /* NVGPU_MM_VGPU_H */
|
||||
|
||||
@@ -29,11 +29,7 @@
|
||||
#include <nvgpu/lock.h>
|
||||
#include <nvgpu/vgpu/tegra_vgpu.h>
|
||||
|
||||
struct device;
|
||||
struct nvgpu_mem;
|
||||
struct gk20a;
|
||||
struct vm_gk20a;
|
||||
struct nvgpu_gr_ctx;
|
||||
struct vgpu_ecc_stat;
|
||||
|
||||
struct vgpu_priv_data {
|
||||
@@ -61,11 +57,4 @@ static inline u64 vgpu_get_handle(struct gk20a *g)
|
||||
return priv->virt_handle;
|
||||
}
|
||||
|
||||
u64 vgpu_mm_bar1_map_userd(struct gk20a *g, struct nvgpu_mem *mem, u32 offset);
|
||||
|
||||
int vgpu_gp10b_init_hal(struct gk20a *g);
|
||||
int vgpu_gv11b_init_hal(struct gk20a *g);
|
||||
|
||||
bool vgpu_is_reduced_bar1(struct gk20a *g);
|
||||
|
||||
#endif /* NVGPU_VGPU_H */
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
#include <nvgpu/regops.h>
|
||||
#include <nvgpu/clk_arb.h>
|
||||
|
||||
#include <nvgpu/vgpu/os_init_hal_vgpu.h>
|
||||
|
||||
#include "vgpu_linux.h"
|
||||
#include "common/vgpu/gr/fecs_trace_vgpu.h"
|
||||
#include "common/vgpu/clk_vgpu.h"
|
||||
@@ -467,15 +469,6 @@ int vgpu_remove(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool vgpu_is_reduced_bar1(struct gk20a *g)
|
||||
{
|
||||
struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
|
||||
struct fifo_gk20a *f = &g->fifo;
|
||||
u32 size = f->num_channels * f->userd_entry_size;
|
||||
|
||||
return resource_size(l->bar1_mem) == size;
|
||||
}
|
||||
|
||||
int vgpu_tegra_suspend(struct device *dev)
|
||||
{
|
||||
struct tegra_vgpu_cmd_msg msg = {};
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <nvgpu/vgpu/vgpu.h>
|
||||
#include <nvgpu/vgpu/vgpu_ivc.h>
|
||||
#include <nvgpu/vgpu/vgpu_ivm.h>
|
||||
#include <nvgpu/vgpu/os_init_hal_vgpu.h>
|
||||
|
||||
struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g)
|
||||
{
|
||||
@@ -32,12 +33,6 @@ struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool vgpu_is_reduced_bar1(struct gk20a *g)
|
||||
{
|
||||
BUG();
|
||||
return false;
|
||||
}
|
||||
|
||||
int vgpu_ivc_init(struct gk20a *g, u32 elems,
|
||||
const size_t *queue_sizes, u32 queue_start, u32 num_queues)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user