Srinu Gorle | cf8c675 | 2018-01-19 18:36:13 +0530 | [diff] [blame] | 1 | /* Copyright (c) 2014-2015, 2018 The Linux Foundation. All rights reserved. |
| 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | * |
| 12 | */ |
| 13 | |
| 14 | #ifndef _MSM_VIDC_DCVS_H_ |
| 15 | #define _MSM_VIDC_DCVS_H_ |
| 16 | #include "msm_vidc_internal.h" |
| 17 | |
| 18 | /* Low threshold for encoder dcvs */ |
| 19 | #define DCVS_ENC_LOW_THR 4 |
| 20 | /* High threshold for encoder dcvs */ |
| 21 | #define DCVS_ENC_HIGH_THR 9 |
| 22 | /* extra o/p buffers in case of encoder dcvs */ |
| 23 | #define DCVS_ENC_EXTRA_OUTPUT_BUFFERS 2 |
| 24 | /* extra o/p buffers in case of decoder dcvs */ |
| 25 | #define DCVS_DEC_EXTRA_OUTPUT_BUFFERS 4 |
| 26 | /* Default threshold to reduce the core frequency */ |
| 27 | #define DCVS_NOMINAL_THRESHOLD 8 |
| 28 | /* Default threshold to increase the core frequency */ |
| 29 | #define DCVS_TURBO_THRESHOLD 4 |
| 30 | |
| 31 | /* Considering one safeguard buffer */ |
| 32 | #define DCVS_BUFFER_SAFEGUARD (DCVS_DEC_EXTRA_OUTPUT_BUFFERS - 1) |
| 33 | |
| 34 | void msm_dcvs_init(struct msm_vidc_inst *inst); |
| 35 | void msm_dcvs_init_load(struct msm_vidc_inst *inst); |
| 36 | void msm_dcvs_monitor_buffer(struct msm_vidc_inst *inst); |
| 37 | void msm_dcvs_check_and_scale_clocks(struct msm_vidc_inst *inst, bool is_etb); |
| 38 | int msm_dcvs_get_extra_buff_count(struct msm_vidc_inst *inst); |
| 39 | void msm_dcvs_enc_set_power_save_mode(struct msm_vidc_inst *inst, |
| 40 | bool is_power_save_mode); |
| 41 | #endif |