diff options
author | Sami Kiminki <skiminki@nvidia.com> | 2016-10-28 16:05:23 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-11-11 05:21:04 -0500 |
commit | f329e674f477f0120f9a92a9e7b4945a1ddaefbb (patch) | |
tree | 55107ad03a029e438e93c1793afd5e940ab7206b /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |
parent | cc4208a27831faf95409b491aa29b8a161bf630a (diff) |
gpu: nvgpu: gk20a: Fix FBP/L2 masks, add GET_FBP_L2_MASKS
Fix FBP and ROP_L2 enable masks for Maxwell+. Deprecate rop_l2_en_mask
in GPU characteristics by adding _DEPRECATED postfix. The array is
too small to hold ROP_L2 enable masks for desktop GPUs.
Add NVGPU_GPU_IOCTL_GET_FBP_L2_MASKS to expose the ROP_L2 masks for
userspace.
Bug 200136909
Bug 200241845
Change-Id: I5ad5a5c09f3962ebb631b8d6e7a2f9df02f75ac7
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Reviewed-on: http://git-master/r/1245294
(cherry picked from commit 0823b33e59defec341ea7919dae4e5f73a36d256)
Reviewed-on: http://git-master/r/1249883
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c index 2fdf719a..493cbe80 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |||
@@ -246,6 +246,30 @@ static int gk20a_ctrl_get_tpc_masks(struct gk20a *g, | |||
246 | return err; | 246 | return err; |
247 | } | 247 | } |
248 | 248 | ||
249 | static int gk20a_ctrl_get_fbp_l2_masks( | ||
250 | struct gk20a *g, struct nvgpu_gpu_get_fbp_l2_masks_args *args) | ||
251 | { | ||
252 | struct gr_gk20a *gr = &g->gr; | ||
253 | int err = 0; | ||
254 | const u32 fbp_l2_mask_size = sizeof(u32) * gr->max_fbps_count; | ||
255 | |||
256 | if (args->mask_buf_size > 0) { | ||
257 | size_t write_size = fbp_l2_mask_size; | ||
258 | |||
259 | if (write_size > args->mask_buf_size) | ||
260 | write_size = args->mask_buf_size; | ||
261 | |||
262 | err = copy_to_user((void __user *)(uintptr_t) | ||
263 | args->mask_buf_addr, | ||
264 | gr->fbp_rop_l2_en_mask, write_size); | ||
265 | } | ||
266 | |||
267 | if (err == 0) | ||
268 | args->mask_buf_size = fbp_l2_mask_size; | ||
269 | |||
270 | return err; | ||
271 | } | ||
272 | |||
249 | static int nvgpu_gpu_ioctl_l2_fb_ops(struct gk20a *g, | 273 | static int nvgpu_gpu_ioctl_l2_fb_ops(struct gk20a *g, |
250 | struct nvgpu_gpu_l2_fb_args *args) | 274 | struct nvgpu_gpu_l2_fb_args *args) |
251 | { | 275 | { |
@@ -936,6 +960,10 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg | |||
936 | err = gk20a_ctrl_get_tpc_masks(g, | 960 | err = gk20a_ctrl_get_tpc_masks(g, |
937 | (struct nvgpu_gpu_get_tpc_masks_args *)buf); | 961 | (struct nvgpu_gpu_get_tpc_masks_args *)buf); |
938 | break; | 962 | break; |
963 | case NVGPU_GPU_IOCTL_GET_FBP_L2_MASKS: | ||
964 | err = gk20a_ctrl_get_fbp_l2_masks(g, | ||
965 | (struct nvgpu_gpu_get_fbp_l2_masks_args *)buf); | ||
966 | break; | ||
939 | case NVGPU_GPU_IOCTL_OPEN_CHANNEL: | 967 | case NVGPU_GPU_IOCTL_OPEN_CHANNEL: |
940 | /* this arg type here, but ..gpu_open_channel_args in nvgpu.h | 968 | /* this arg type here, but ..gpu_open_channel_args in nvgpu.h |
941 | * for consistency - they are the same */ | 969 | * for consistency - they are the same */ |