diff --git a/drivers/gpu/nvgpu/common/init/nvgpu_init.c b/drivers/gpu/nvgpu/common/init/nvgpu_init.c index bbfd197c9..e63a5c000 100644 --- a/drivers/gpu/nvgpu/common/init/nvgpu_init.c +++ b/drivers/gpu/nvgpu/common/init/nvgpu_init.c @@ -1117,7 +1117,6 @@ int nvgpu_init_gpu_characteristics(struct gk20a *g) #ifdef CONFIG_NVGPU_BUILD_CONFIGURATION_IS_SAFETY nvgpu_set_enabled(g, NVGPU_DRIVER_REDUCED_PROFILE, true); #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_SPARSE_ALLOCS, true); nvgpu_set_enabled(g, NVGPU_SUPPORT_MAP_ACCESS_TYPE, true); diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 13c12d09d..e75320c00 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -74,8 +74,6 @@ struct gk20a; "IO coherence support is available"), \ DEFINE_FLAG(NVGPU_SUPPORT_SPARSE_ALLOCS, \ "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, \ "Support batch mapping"), \ DEFINE_FLAG(NVGPU_SUPPORT_MAPPING_MODIFY, \ diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h index c2aa7d55e..8865485b9 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h @@ -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 * under the terms and conditions of the GNU General Public License, @@ -52,7 +52,6 @@ struct nvgpu_mapped_buf_priv { struct sg_table *sgt; }; -/* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */ int nvgpu_vm_map_linux(struct vm_gk20a *vm, struct dma_buf *dmabuf, u64 map_addr, @@ -69,7 +68,6 @@ int nvgpu_vm_map_linux(struct vm_gk20a *vm, /* * Notes: * - 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 dmabuf_fd, diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h index 854d141f6..4957c4f77 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h @@ -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 * 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_IO_COHERENT BIT32(2) #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_PLATFORM_ATOMIC BIT32(6) #define NVGPU_VM_MAP_TEGRA_RAW BIT32(7) diff --git a/drivers/gpu/nvgpu/os/linux/cde.c b/drivers/gpu/nvgpu/os/linux/cde.c index 456a47d58..2c626cd25 100644 --- a/drivers/gpu/nvgpu/os/linux/cde.c +++ b/drivers/gpu/nvgpu/os/linux/cde.c @@ -1,7 +1,7 @@ /* * 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 * 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 */ err = nvgpu_vm_map_linux(cde_ctx->vm, compbits_scatter_buf, 0, NVGPU_VM_MAP_ACCESS_DEFAULT, - NVGPU_VM_MAP_CACHEABLE | - NVGPU_VM_MAP_DIRECT_KIND_CTRL, + NVGPU_VM_MAP_CACHEABLE, gk20a_cde_mapping_page_size(cde_ctx->vm, map_offset, map_size), diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_as.c b/drivers/gpu/nvgpu/os/linux/ioctl_as.c index b98bab052..ad63a74b1 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_as.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_as.c @@ -1,7 +1,7 @@ /* * 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 * 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, " "); - /* 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, &args->offset, args->flags, args->page_size, @@ -198,15 +191,8 @@ static int gk20a_as_ioctl_map_buffer_batch( break; } - if (map_args.flags & - NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL) { - compressible_kind = map_args.compr_kind; - incompressible_kind = map_args.incompr_kind; - } else { - /* direct kind control must be used */ - err = -EINVAL; - break; - } + compressible_kind = map_args.compr_kind; + incompressible_kind = map_args.incompr_kind; err = nvgpu_vm_map_buffer( as_share->vm, map_args.dmabuf_fd, diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 73d50e079..5d036894f 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -270,8 +270,6 @@ static struct nvgpu_flags_mapping flags_mapping[] = { NVGPU_SUPPORT_IO_COHERENCE}, {NVGPU_GPU_FLAGS_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_ECC_ENABLED_SM_LRF}, {NVGPU_GPU_FLAGS_ECC_ENABLED_SM_SHM, diff --git a/drivers/gpu/nvgpu/os/linux/vm.c b/drivers/gpu/nvgpu/os/linux/vm.c index 20df5f516..067f560f5 100644 --- a/drivers/gpu/nvgpu/os/linux/vm.c +++ b/drivers/gpu/nvgpu/os/linux/vm.c @@ -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 * 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)) 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) { core_flags |= NVGPU_VM_MAP_PLATFORM_ATOMIC; consumed_flags |= NVGPU_AS_MAP_BUFFER_FLAGS_PLATFORM_ATOMIC; diff --git a/include/uapi/linux/nvgpu-as.h b/include/uapi/linux/nvgpu-as.h index 0830aa573..54fe108e2 100644 --- a/include/uapi/linux/nvgpu-as.h +++ b/include/uapi/linux/nvgpu-as.h @@ -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 * 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_MAPPABLE_COMPBITS (1 << 6) #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_TEGRA_RAW (1 << 12) @@ -161,11 +160,6 @@ struct nvgpu_as_bind_channel_args { * * 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 * * Specify that a mapping should use platform atomics. @@ -178,8 +172,7 @@ struct nvgpu_as_bind_channel_args { * @incompr_kind [IN] * * Specify the compressible and incompressible kinds to be used for the - * mapping. Requires that %NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL is - * set in @flags. The kernel will attempt to use @comp_kind and if for + * mapping. The kernel will attempt to use @comp_kind and if for * some reason that is not possible will then fall back to using the * @incompr_kind. * @@ -221,7 +214,6 @@ struct nvgpu_as_bind_channel_args { * returned in this field. The field is in bytes. */ struct nvgpu_as_map_buffer_ex_args { - /* NVGPU_AS_MAP_BUFFER_FLAGS_DIRECT_KIND_CTRL must be set */ __u32 flags; /* in/out */ /* diff --git a/include/uapi/linux/nvgpu-ctrl.h b/include/uapi/linux/nvgpu-ctrl.h index 0809be353..e35be4065 100644 --- a/include/uapi/linux/nvgpu-ctrl.h +++ b/include/uapi/linux/nvgpu-ctrl.h @@ -135,8 +135,6 @@ struct nvgpu_gpu_zbc_query_table_args { #define NVGPU_GPU_FLAGS_SUPPORT_RESCHEDULE_RUNLIST (1ULL << 21) /* subcontexts are available */ #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 */ #define NVGPU_GPU_FLAGS_SUPPORT_DETERMINISTIC_OPTS (1ULL << 24) /* SCG support is available */