mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
gpu: nvgpu: remove kind control capability
Kind is controlled by nvgpu userspace library so related capability flags can be removed from kernel and uapi interface. Jira NVGPU-9832 Bug 4034184 Change-Id: Id2b0a4e1cd784638362116b8d99177467fba998b Signed-off-by: Shashank Singh <shashsingh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2880391 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> Reviewed-by: Dinesh T <dt@nvidia.com> Reviewed-by: Ankur Kishore <ankkishore@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
56a4680a3b
commit
21cb70f58d
@@ -1117,7 +1117,6 @@ int nvgpu_init_gpu_characteristics(struct gk20a *g)
|
|||||||
#ifdef CONFIG_NVGPU_BUILD_CONFIGURATION_IS_SAFETY
|
#ifdef CONFIG_NVGPU_BUILD_CONFIGURATION_IS_SAFETY
|
||||||
nvgpu_set_enabled(g, NVGPU_DRIVER_REDUCED_PROFILE, true);
|
nvgpu_set_enabled(g, NVGPU_DRIVER_REDUCED_PROFILE, true);
|
||||||
#endif
|
#endif
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_DIRECT_KIND_CTRL, true);
|
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_BUFFER_BATCH, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_BUFFER_BATCH, true);
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_SPARSE_ALLOCS, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_SPARSE_ALLOCS, true);
|
||||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_ACCESS_TYPE, true);
|
nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_ACCESS_TYPE, true);
|
||||||
|
|||||||
@@ -74,8 +74,6 @@ struct gk20a;
|
|||||||
"IO coherence support is available"), \
|
"IO coherence support is available"), \
|
||||||
DEFINE_FLAG(NVGPU_SUPPORT_SPARSE_ALLOCS, \
|
DEFINE_FLAG(NVGPU_SUPPORT_SPARSE_ALLOCS, \
|
||||||
"MAP_BUFFER_EX with sparse allocations"), \
|
"MAP_BUFFER_EX with sparse allocations"), \
|
||||||
DEFINE_FLAG(NVGPU_SUPPORT_MAP_DIRECT_KIND_CTRL, \
|
|
||||||
"Direct PTE kind control is supported (map_buffer_ex)"),\
|
|
||||||
DEFINE_FLAG(NVGPU_SUPPORT_MAP_BUFFER_BATCH, \
|
DEFINE_FLAG(NVGPU_SUPPORT_MAP_BUFFER_BATCH, \
|
||||||
"Support batch mapping"), \
|
"Support batch mapping"), \
|
||||||
DEFINE_FLAG(NVGPU_SUPPORT_MAPPING_MODIFY, \
|
DEFINE_FLAG(NVGPU_SUPPORT_MAPPING_MODIFY, \
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -52,7 +52,6 @@ struct nvgpu_mapped_buf_priv {
|
|||||||
struct sg_table *sgt;
|
struct sg_table *sgt;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */
|
|
||||||
int nvgpu_vm_map_linux(struct vm_gk20a *vm,
|
int nvgpu_vm_map_linux(struct vm_gk20a *vm,
|
||||||
struct dma_buf *dmabuf,
|
struct dma_buf *dmabuf,
|
||||||
u64 map_addr,
|
u64 map_addr,
|
||||||
@@ -69,7 +68,6 @@ int nvgpu_vm_map_linux(struct vm_gk20a *vm,
|
|||||||
/*
|
/*
|
||||||
* Notes:
|
* Notes:
|
||||||
* - Batch may be NULL if map op is not part of a batch.
|
* - Batch may be NULL if map op is not part of a batch.
|
||||||
* - NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set
|
|
||||||
*/
|
*/
|
||||||
int nvgpu_vm_map_buffer(struct vm_gk20a *vm,
|
int nvgpu_vm_map_buffer(struct vm_gk20a *vm,
|
||||||
int dmabuf_fd,
|
int dmabuf_fd,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -349,7 +349,6 @@ struct vm_gk20a {
|
|||||||
#define NVGPU_VM_MAP_CACHEABLE BIT32(1)
|
#define NVGPU_VM_MAP_CACHEABLE BIT32(1)
|
||||||
#define NVGPU_VM_MAP_IO_COHERENT BIT32(2)
|
#define NVGPU_VM_MAP_IO_COHERENT BIT32(2)
|
||||||
#define NVGPU_VM_MAP_UNMAPPED_PTE BIT32(3)
|
#define NVGPU_VM_MAP_UNMAPPED_PTE BIT32(3)
|
||||||
#define NVGPU_VM_MAP_DIRECT_KIND_CTRL BIT32(4)
|
|
||||||
#define NVGPU_VM_MAP_L3_ALLOC BIT32(5)
|
#define NVGPU_VM_MAP_L3_ALLOC BIT32(5)
|
||||||
#define NVGPU_VM_MAP_PLATFORM_ATOMIC BIT32(6)
|
#define NVGPU_VM_MAP_PLATFORM_ATOMIC BIT32(6)
|
||||||
#define NVGPU_VM_MAP_TEGRA_RAW BIT32(7)
|
#define NVGPU_VM_MAP_TEGRA_RAW BIT32(7)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* Color decompression engine support
|
* Color decompression engine support
|
||||||
*
|
*
|
||||||
* Copyright (c) 2014-2022, NVIDIA Corporation. All rights reserved.
|
* Copyright (c) 2014-2023, NVIDIA Corporation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -1108,8 +1108,7 @@ __releases(&l->cde_app->mutex)
|
|||||||
get_dma_buf(compbits_scatter_buf); /* a ref for nvgpu_vm_map_linux */
|
get_dma_buf(compbits_scatter_buf); /* a ref for nvgpu_vm_map_linux */
|
||||||
err = nvgpu_vm_map_linux(cde_ctx->vm, compbits_scatter_buf, 0,
|
err = nvgpu_vm_map_linux(cde_ctx->vm, compbits_scatter_buf, 0,
|
||||||
NVGPU_VM_MAP_ACCESS_DEFAULT,
|
NVGPU_VM_MAP_ACCESS_DEFAULT,
|
||||||
NVGPU_VM_MAP_CACHEABLE |
|
NVGPU_VM_MAP_CACHEABLE,
|
||||||
NVGPU_VM_MAP_DIRECT_KIND_CTRL,
|
|
||||||
gk20a_cde_mapping_page_size(cde_ctx->vm,
|
gk20a_cde_mapping_page_size(cde_ctx->vm,
|
||||||
map_offset,
|
map_offset,
|
||||||
map_size),
|
map_size),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* GK20A Address Spaces
|
* GK20A Address Spaces
|
||||||
*
|
*
|
||||||
* Copyright (c) 2011-2022, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2011-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -109,13 +109,6 @@ static int gk20a_as_ioctl_map_buffer_ex(
|
|||||||
|
|
||||||
nvgpu_log_fn(g, " ");
|
nvgpu_log_fn(g, " ");
|
||||||
|
|
||||||
/* unsupported, direct kind control must be used */
|
|
||||||
if (!(args->flags & NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL)) {
|
|
||||||
struct gk20a *g = as_share->vm->mm->g;
|
|
||||||
nvgpu_log_info(g, "Direct kind control must be requested");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nvgpu_vm_map_buffer(as_share->vm, args->dmabuf_fd,
|
return nvgpu_vm_map_buffer(as_share->vm, args->dmabuf_fd,
|
||||||
&args->offset, args->flags,
|
&args->offset, args->flags,
|
||||||
args->page_size,
|
args->page_size,
|
||||||
@@ -198,15 +191,8 @@ static int gk20a_as_ioctl_map_buffer_batch(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map_args.flags &
|
compressible_kind = map_args.compr_kind;
|
||||||
NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL) {
|
incompressible_kind = map_args.incompr_kind;
|
||||||
compressible_kind = map_args.compr_kind;
|
|
||||||
incompressible_kind = map_args.incompr_kind;
|
|
||||||
} else {
|
|
||||||
/* direct kind control must be used */
|
|
||||||
err = -EINVAL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = nvgpu_vm_map_buffer(
|
err = nvgpu_vm_map_buffer(
|
||||||
as_share->vm, map_args.dmabuf_fd,
|
as_share->vm, map_args.dmabuf_fd,
|
||||||
|
|||||||
@@ -270,8 +270,6 @@ static struct nvgpu_flags_mapping flags_mapping[] = {
|
|||||||
NVGPU_SUPPORT_IO_COHERENCE},
|
NVGPU_SUPPORT_IO_COHERENCE},
|
||||||
{NVGPU_GPU_FLAGS_SUPPORT_RESCHEDULE_RUNLIST,
|
{NVGPU_GPU_FLAGS_SUPPORT_RESCHEDULE_RUNLIST,
|
||||||
NVGPU_SUPPORT_RESCHEDULE_RUNLIST},
|
NVGPU_SUPPORT_RESCHEDULE_RUNLIST},
|
||||||
{NVGPU_GPU_FLAGS_SUPPORT_MAP_DIRECT_KIND_CTRL,
|
|
||||||
NVGPU_SUPPORT_MAP_DIRECT_KIND_CTRL},
|
|
||||||
{NVGPU_GPU_FLAGS_ECC_ENABLED_SM_LRF,
|
{NVGPU_GPU_FLAGS_ECC_ENABLED_SM_LRF,
|
||||||
NVGPU_ECC_ENABLED_SM_LRF},
|
NVGPU_ECC_ENABLED_SM_LRF},
|
||||||
{NVGPU_GPU_FLAGS_ECC_ENABLED_SM_SHM,
|
{NVGPU_GPU_FLAGS_ECC_ENABLED_SM_SHM,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2017-2022, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2017-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -72,10 +72,6 @@ static int nvgpu_vm_translate_linux_flags(struct gk20a *g, u32 flags, u32 *out_c
|
|||||||
if (!nvgpu_is_enabled(g, NVGPU_DISABLE_L3_SUPPORT))
|
if (!nvgpu_is_enabled(g, NVGPU_DISABLE_L3_SUPPORT))
|
||||||
core_flags |= NVGPU_VM_MAP_L3_ALLOC;
|
core_flags |= NVGPU_VM_MAP_L3_ALLOC;
|
||||||
}
|
}
|
||||||
if ((flags & NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL) != 0U) {
|
|
||||||
core_flags |= NVGPU_VM_MAP_DIRECT_KIND_CTRL;
|
|
||||||
consumed_flags |= NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL;
|
|
||||||
}
|
|
||||||
if ((flags & NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC) != 0U) {
|
if ((flags & NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC) != 0U) {
|
||||||
core_flags |= NVGPU_VM_MAP_PLATFORM_ATOMIC;
|
core_flags |= NVGPU_VM_MAP_PLATFORM_ATOMIC;
|
||||||
consumed_flags |= NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC;
|
consumed_flags |= NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify it
|
* This program is free software; you can redistribute it and/or modify it
|
||||||
* under the terms and conditions of the GNU General Public License,
|
* under the terms and conditions of the GNU General Public License,
|
||||||
@@ -108,7 +108,6 @@ struct nvgpu_as_bind_channel_args {
|
|||||||
#define NVGPU_AS_MAP_BUFFER_FLAGS_UNMAPPED_PTE (1 << 5)
|
#define NVGPU_AS_MAP_BUFFER_FLAGS_UNMAPPED_PTE (1 << 5)
|
||||||
#define NVGPU_AS_MAP_BUFFER_FLAGS_MAPPABLE_COMPBITS (1 << 6)
|
#define NVGPU_AS_MAP_BUFFER_FLAGS_MAPPABLE_COMPBITS (1 << 6)
|
||||||
#define NVGPU_AS_MAP_BUFFER_FLAGS_L3_ALLOC (1 << 7)
|
#define NVGPU_AS_MAP_BUFFER_FLAGS_L3_ALLOC (1 << 7)
|
||||||
#define NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL (1 << 8)
|
|
||||||
#define NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC (1 << 9)
|
#define NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC (1 << 9)
|
||||||
#define NVGPU_AS_MAP_BUFFER_FLAGS_TEGRA_RAW (1 << 12)
|
#define NVGPU_AS_MAP_BUFFER_FLAGS_TEGRA_RAW (1 << 12)
|
||||||
|
|
||||||
@@ -161,11 +160,6 @@ struct nvgpu_as_bind_channel_args {
|
|||||||
*
|
*
|
||||||
* Deprecated.
|
* Deprecated.
|
||||||
*
|
*
|
||||||
* %NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL
|
|
||||||
*
|
|
||||||
* Set when userspace plans to pass in @compr_kind and @incompr_kind
|
|
||||||
* instead of letting the kernel work out kind fields.
|
|
||||||
*
|
|
||||||
* %NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC
|
* %NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC
|
||||||
*
|
*
|
||||||
* Specify that a mapping should use platform atomics.
|
* Specify that a mapping should use platform atomics.
|
||||||
@@ -178,8 +172,7 @@ struct nvgpu_as_bind_channel_args {
|
|||||||
* @incompr_kind [IN]
|
* @incompr_kind [IN]
|
||||||
*
|
*
|
||||||
* Specify the compressible and incompressible kinds to be used for the
|
* Specify the compressible and incompressible kinds to be used for the
|
||||||
* mapping. Requires that %NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is
|
* mapping. The kernel will attempt to use @comp_kind and if for
|
||||||
* set in @flags. The kernel will attempt to use @comp_kind and if for
|
|
||||||
* some reason that is not possible will then fall back to using the
|
* some reason that is not possible will then fall back to using the
|
||||||
* @incompr_kind.
|
* @incompr_kind.
|
||||||
*
|
*
|
||||||
@@ -221,7 +214,6 @@ struct nvgpu_as_bind_channel_args {
|
|||||||
* returned in this field. The field is in bytes.
|
* returned in this field. The field is in bytes.
|
||||||
*/
|
*/
|
||||||
struct nvgpu_as_map_buffer_ex_args {
|
struct nvgpu_as_map_buffer_ex_args {
|
||||||
/* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */
|
|
||||||
__u32 flags; /* in/out */
|
__u32 flags; /* in/out */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -135,8 +135,6 @@ struct nvgpu_gpu_zbc_query_table_args {
|
|||||||
#define NVGPU_GPU_FLAGS_SUPPORT_RESCHEDULE_RUNLIST (1ULL << 21)
|
#define NVGPU_GPU_FLAGS_SUPPORT_RESCHEDULE_RUNLIST (1ULL << 21)
|
||||||
/* subcontexts are available */
|
/* subcontexts are available */
|
||||||
#define NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS (1ULL << 22)
|
#define NVGPU_GPU_FLAGS_SUPPORT_TSG_SUBCONTEXTS (1ULL << 22)
|
||||||
/* Direct PTE kind control is supported (map_buffer_ex) */
|
|
||||||
#define NVGPU_GPU_FLAGS_SUPPORT_MAP_DIRECT_KIND_CTRL (1ULL << 23)
|
|
||||||
/* NVGPU_GPU_IOCTL_SET_DETERMINISTIC_OPTS is available */
|
/* NVGPU_GPU_IOCTL_SET_DETERMINISTIC_OPTS is available */
|
||||||
#define NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_OPTS (1ULL << 24)
|
#define NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_OPTS (1ULL << 24)
|
||||||
/* SCG support is available */
|
/* SCG support is available */
|
||||||
|
|||||||
Reference in New Issue
Block a user