From f8429c8e7c4ae5c9e45d0e7de517ce1aa95f7acc Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Tue, 3 Nov 2020 12:55:11 +0530 Subject: [PATCH] gpu: nvgpu: MIG attributes enhancement This CL covers the following code changes, 1) Added some more documentation for gpu_instance_id and gr_instance_id. 2) Used the gr_sys_pipe_id for gr_instance_id. 2) Removed gr_syspipe_id attribute. 4) Removed NVGPU_GPU_FLAGS_SUPPORT_MIG flag. 3) Changed the device node name to use gpu instance id + syspipe id combination insted of gpu instance id + gr engine instance id. Bug 2802347 Change-Id: Id6ca7db5765ab31b5d83472be35dde432c2281ed Signed-off-by: Lakshmanan M Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2440532 Reviewed-by: automaticguardword Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Rajesh Devaraj Reviewed-by: Deepak Nibade Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/ioctl.c | 2 +- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 5 +---- include/uapi/linux/nvgpu.h | 5 +---- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl.c b/drivers/gpu/nvgpu/os/linux/ioctl.c index a5f63f7bb..3dd0e5a34 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl.c @@ -386,7 +386,7 @@ static const struct nvgpu_mig_static_info nvgpu_default_pci_mig_static_info[] = { .instance_type = NVGPU_MIG_TYPE_MIG, .major_instance_id = 2, - .minor_instance_id = 0, + .minor_instance_id = 4, }, }; diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 22ffe86f1..00c78ed2f 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -283,8 +283,6 @@ static struct nvgpu_flags_mapping flags_mapping[] = { NVGPU_SUPPORT_I2M}, {NVGPU_GPU_FLAGS_SUPPORT_ZBC, NVGPU_SUPPORT_ZBC}, - {NVGPU_GPU_FLAGS_SUPPORT_MIG, - NVGPU_SUPPORT_MIG}, {NVGPU_GPU_FLAGS_SUPPORT_PROFILER_V2_DEVICE, NVGPU_SUPPORT_PROFILER_V2_DEVICE}, {NVGPU_GPU_FLAGS_SUPPORT_PROFILER_V2_CONTEXT, @@ -487,8 +485,7 @@ static long gk20a_ctrl_ioctl_gpu_characteristics( gpu.per_device_identifier = g->per_device_identifier; gpu.gpu_instance_id = gpu_instance->gpu_instance_id; - gpu.gr_sys_pipe_id = gpu_instance->gr_syspipe.gr_syspipe_id; - gpu.gr_instance_id = gpu_instance->gr_syspipe.gr_instance_id; + gpu.gr_instance_id = gpu_instance->gr_syspipe.gr_syspipe_id; if (request->gpu_characteristics_buf_size > 0) { size_t write_size = sizeof(gpu); diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 0fb34ab39..0a7ef2ab5 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -191,9 +191,6 @@ struct nvgpu_gpu_zbc_query_table_args { #define NVGPU_GPU_FLAGS_SUPPORT_I2M (1ULL << 43) /* Flag to indicate whether zbc classes are supported */ #define NVGPU_GPU_FLAGS_SUPPORT_ZBC (1ULL << 44) -/* Flag to indicate whether Multi Instance Gpu per GPU physical device - is enabled/disabled. */ -#define NVGPU_GPU_FLAGS_SUPPORT_MIG (1ULL << 45) /* Profiler V2 device objects are supported */ #define NVGPU_GPU_FLAGS_SUPPORT_PROFILER_V2_DEVICE (1ULL << 46) /* Profiler V2 context objects are supported */ @@ -329,8 +326,8 @@ struct nvgpu_gpu_characteristics { __u32 num_sub_partition_per_fbpa; __u32 gpu_instance_id; - __u32 gr_sys_pipe_id; __u32 gr_instance_id; + __u32 reserved4; /* Notes: - This struct can be safely appended with new fields. However, always