diff options
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 */ |