1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "base/utils/cpu_boost.h" 17 18 #ifdef FFRT_CPUBOOST_EN 19 #include "c/ffrt_cpu_boost.h" 20 #endif 21 22 namespace OHOS::Ace { FlushDirtyNodeCpuBoostOperate(bool flag)23void FlushDirtyNodeCpuBoostOperate(bool flag) 24 { 25 #ifdef FFRT_CPUBOOST_EN 26 if (flag == true) { 27 ffrt_cpu_boost_start(CPUBOOST_START_POINT); 28 } else { 29 ffrt_cpu_boost_end(CPUBOOST_START_POINT); 30 } 31 #endif 32 } 33 DisplaysyncCpuBoostOperate(bool flag)34void DisplaysyncCpuBoostOperate(bool flag) 35 { 36 #ifdef FFRT_CPUBOOST_EN 37 if (flag == true) { 38 ffrt_cpu_boost_start(CPUBOOST_START_POINT + 1); 39 } else { 40 ffrt_cpu_boost_end(CPUBOOST_START_POINT + 1); 41 } 42 #endif 43 } 44 } 45