gpu: nvgpu: tu104: implement l2 sector promotion

Introduce new HAL gops_ltc.set_l2_sector_promotion to configure L2
sector promotion policy. The follow three promotion settings are support:
- NVGPU_GPU_IOCTL_TSG_L2_SECTOR_PROMOTE_FLAG_NONE
- NVGPU_GPU_IOCTL_TSG_L2_SECTOR_PROMOTE_FLAG_64B
- NVGPU_GPU_IOCTL_TSG_L2_SECTOR_PROMOTE_FLAG_128B

Add ioctl "NVGPU_TSG_IOCTL_SET_L2_SECTOR_PROMOTION" to the gpu tsg node
to support l2 sector promotion. On chips which do not support sector
promotion, the ioctl returns 0.

Bug 200656177

Change-Id: Iad835a5c954d3b10da436cfafb388aaaa04f44c7
Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2460553
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Antony Clince Alex
2020-12-16 12:09:03 +05:30
committed by mobile promotions
parent 5517e14e57
commit 95bfa039f5
8 changed files with 246 additions and 4 deletions

View File

@@ -82,6 +82,23 @@ struct nvgpu_tsg_l2_max_ways_evict_last_args {
* with eviction_policy=EVICT_LAST
*/
__u32 max_ways;
__u32 reserved;
};
/*
* This struct contains the parameter for configuring L2 sector promotion.
* It supports 3 valid options:-
* - PROMOTE_NONE(1): cache-miss doens't get promoted.
* - PROMOTE_64B(2): cache-miss gets promoted to 64 bytes if less than 64 bytes.
* - PROMOTE_128B(4): cache-miss gets promoted to 128 bytes if less than 128 bytes.
*/
#define NVGPU_GPU_IOCTL_TSG_L2_SECTOR_PROMOTE_FLAG_NONE (1U << 0U)
#define NVGPU_GPU_IOCTL_TSG_L2_SECTOR_PROMOTE_FLAG_64B (1U << 1U)
#define NVGPU_GPU_IOCTL_TSG_L2_SECTOR_PROMOTE_FLAG_128B (1U << 2U)
struct nvgpu_tsg_set_l2_sector_promotion_args {
/* Valid promotion flag */
__u32 promotion_flag;
__u32 reserved;
};
#define NVGPU_TSG_IOCTL_BIND_CHANNEL \
@@ -113,11 +130,14 @@ struct nvgpu_tsg_l2_max_ways_evict_last_args {
#define NVGPU_TSG_IOCTL_GET_L2_MAX_WAYS_EVICT_LAST \
_IOR(NVGPU_TSG_IOCTL_MAGIC, 14, \
struct nvgpu_tsg_l2_max_ways_evict_last_args)
#define NVGPU_TSG_IOCTL_SET_L2_SECTOR_PROMOTION \
_IOW(NVGPU_TSG_IOCTL_MAGIC, 15, \
struct nvgpu_tsg_set_l2_sector_promotion_args)
#define NVGPU_TSG_IOCTL_MAX_ARG_SIZE \
sizeof(struct nvgpu_tsg_bind_channel_ex_args)
#define NVGPU_TSG_IOCTL_LAST \
_IOC_NR(NVGPU_TSG_IOCTL_GET_L2_MAX_WAYS_EVICT_LAST)
_IOC_NR(NVGPU_TSG_IOCTL_SET_L2_SECTOR_PROMOTION)
/*
* /dev/nvhost-dbg-gpu device