From 32bdf8cc2d5bdeec662efd1329db67d245bd963f Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Tue, 5 May 2020 12:51:31 -0700 Subject: [PATCH] gpu: nvgpu: add NVGPU_SUPPORT_PLC flag Add NVGPU_SUPPORT_PLC to indicate if compression PLC is supported in nvgpu. Add corresponding GPU characteristics flag and IOCTL mapping to sync compression support status with nvrm_gpu. JIRA NVGPU-4666 Change-Id: I63307b99ceac7dc2e6af143ca13cdac63e253ed3 Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2340242 Reviewed-by: automaticguardword Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seema Khowala Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/include/nvgpu/enabled.h | 5 ++++- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 4 +++- include/uapi/linux/nvgpu.h | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h index 6d8833c58..8ffbcb4da 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h +++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h @@ -258,10 +258,13 @@ struct gk20a; /** SM TTU is enabled */ #define NVGPU_SUPPORT_SM_TTU 88U +/** PLC Compression */ +#define NVGPU_SUPPORT_PLC 89U + /* * Must be greater than the largest bit offset in the above list. */ -#define NVGPU_MAX_ENABLED_BITS 89U +#define NVGPU_MAX_ENABLED_BITS 90U /** * @brief Check if the passed flag is enabled. diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 4f336de38..311d752d2 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -254,7 +254,9 @@ static struct nvgpu_flags_mapping flags_mapping[] = { {NVGPU_GPU_FLAGS_SUPPORT_COMPRESSION, NVGPU_SUPPORT_COMPRESSION}, {NVGPU_GPU_FLAGS_SUPPORT_SM_TTU, - NVGPU_SUPPORT_SM_TTU} + NVGPU_SUPPORT_SM_TTU}, + {NVGPU_GPU_FLAGS_SUPPORT_PLC, + NVGPU_SUPPORT_PLC} }; static u64 nvgpu_ctrl_ioctl_gpu_characteristics_flags(struct gk20a *g) diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 7938245db..9a132aacc 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -177,6 +177,8 @@ struct nvgpu_gpu_zbc_query_table_args { #define NVGPU_GPU_FLAGS_SUPPORT_COMPRESSION (1ULL << 36) /* SM TTU is enabled */ #define NVGPU_GPU_FLAGS_SUPPORT_SM_TTU (1ULL << 37) +/* Compression PLC is enabled */ +#define NVGPU_GPU_FLAGS_SUPPORT_PLC (1ULL << 38) /* SM LRF ECC is enabled */ #define NVGPU_GPU_FLAGS_ECC_ENABLED_SM_LRF (1ULL << 60) /* SM SHM ECC is enabled */