summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2017-12-29 06:21:24 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-01-08 17:37:29 -0500
commitdf6c5047ed15183defa04d94f3b843f0bc800683 (patch)
tree73ce29c39270bf5371113be18358530394a69b20 /include/uapi/linux
parentfcb040c265ba5c2d7d75f277117e269b2c28b906 (diff)
video: tegra: host: pva: Add frequency scaling
This change adds frequency scaling support to PVA. The change allows differnt PVA users to request minimum frequency or bandiwdth requirement. This frequency is then propagated to all PVA clocks (R5, VPS0 and VPS1). nvhost implements clock scaling by: * Going through all bandwidth requests and summing them up * Going through all minimum requests and taking maximum over them * Taking maximum of summed bandiwdth requests and minimum frequency requests. JIRA PVA-101 Change-Id: Ib895ffd7eafe3379b097ade740750a2d99464b73 Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1628404 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/nvhost_pva_ioctl.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/include/uapi/linux/nvhost_pva_ioctl.h b/include/uapi/linux/nvhost_pva_ioctl.h
index 233b9eca5..520c47b9c 100644
--- a/include/uapi/linux/nvhost_pva_ioctl.h
+++ b/include/uapi/linux/nvhost_pva_ioctl.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Tegra PVA Driver ioctls 2 * Tegra PVA Driver ioctls
3 * 3 *
4 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License, 7 * under the terms and conditions of the GNU General Public License,
@@ -295,6 +295,33 @@ struct pva_ioctl_vpu_func_table {
295 __u32 size; 295 __u32 size;
296}; 296};
297 297
298/**
299 * enum pva_clk_type - Clock type identifier while setting the frequency.
300 *
301 * PVA KMD supports three request types: Minimum, bandwidth and bandwidth
302 * (kHz). All bandwidth requests are summed up and treated as one of the
303 * minimum frequency requests. KMD then takes the maximum over all minimum
304 * requests and tries to set the frequency to PVA.
305 */
306enum pva_clk_type {
307 PVA_CLOCK = 0,
308 PVA_BW = 1,
309 PVA_BW_KHZ = 3,
310};
311
312/**
313 * struct pva_ioctl_rate - Requesting PVA frequency update
314 *
315 * @param rate: Requested rate
316 * @param type: Type of the request according to pva_clk_type
317 * @param reserved: Reserved for future usage. Must be 0.
318 */
319struct pva_ioctl_rate {
320 __u64 rate;
321 __u32 type;
322 __u32 reserved;
323};
324
298#define PVA_IOCTL_CHARACTERISTICS \ 325#define PVA_IOCTL_CHARACTERISTICS \
299 _IOWR(NVHOST_PVA_IOCTL_MAGIC, 1, struct pva_characteristics_req) 326 _IOWR(NVHOST_PVA_IOCTL_MAGIC, 1, struct pva_characteristics_req)
300#define PVA_IOCTL_PIN \ 327#define PVA_IOCTL_PIN \
@@ -307,9 +334,13 @@ struct pva_ioctl_vpu_func_table {
307 _IOW(NVHOST_PVA_IOCTL_MAGIC, 5, struct pva_ioctl_queue_attr) 334 _IOW(NVHOST_PVA_IOCTL_MAGIC, 5, struct pva_ioctl_queue_attr)
308#define PVA_IOCTL_COPY_VPU_FUNCTION_TABLE \ 335#define PVA_IOCTL_COPY_VPU_FUNCTION_TABLE \
309 _IOWR(NVHOST_PVA_IOCTL_MAGIC, 6, struct pva_ioctl_vpu_func_table) 336 _IOWR(NVHOST_PVA_IOCTL_MAGIC, 6, struct pva_ioctl_vpu_func_table)
337#define PVA_IOCTL_SET_RATE \
338 _IOWR(NVHOST_PVA_IOCTL_MAGIC, 7, struct pva_ioctl_rate)
339#define PVA_IOCTL_GET_RATE \
340 _IOWR(NVHOST_PVA_IOCTL_MAGIC, 8, struct pva_ioctl_rate)
310 341
311 342
312#define NVHOST_PVA_IOCTL_LAST _IOC_NR(PVA_IOCTL_COPY_VPU_FUNCTION_TABLE) 343#define NVHOST_PVA_IOCTL_LAST _IOC_NR(PVA_IOCTL_GET_RATE)
313#define NVHOST_PVA_IOCTL_MAX_ARG_SIZE sizeof(struct pva_characteristics_req) 344#define NVHOST_PVA_IOCTL_MAX_ARG_SIZE sizeof(struct pva_characteristics_req)
314 345
315#endif /* __LINUX_NVHOST_PVA_IOCTL_H */ 346#endif /* __LINUX_NVHOST_PVA_IOCTL_H */