msm_vidc_power.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #include "msm_vidc_power.h"
  6. #include "msm_vidc_debug.h"
  7. #include "msm_vidc_internal.h"
  8. #include "msm_vidc_inst.h"
  9. #include "msm_vidc_core.h"
  10. #include "msm_vidc_dt.h"
  11. #include "msm_vidc_driver.h"
  12. #include "msm_vidc_platform.h"
  13. #include "msm_vidc_buffer.h"
  14. #include "venus_hfi.h"
  15. #include "msm_vidc_events.h"
  16. /* Q16 Format */
  17. #define MSM_VIDC_MIN_UBWC_COMPLEXITY_FACTOR (1 << 16)
  18. #define MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR (4 << 16)
  19. #define MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO (1 << 16)
  20. #define MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO (5 << 16)
  21. u64 msm_vidc_max_freq(struct msm_vidc_inst *inst)
  22. {
  23. struct msm_vidc_core* core;
  24. struct allowed_clock_rates_table *allowed_clks_tbl;
  25. u64 freq = 0;
  26. if (!inst || !inst->core) {
  27. d_vpr_e("%s: invalid params\n", __func__);
  28. return freq;
  29. }
  30. core = inst->core;
  31. if (!core->dt || !core->dt->allowed_clks_tbl) {
  32. i_vpr_e(inst, "%s: invalid params\n", __func__);
  33. return freq;
  34. }
  35. allowed_clks_tbl = core->dt->allowed_clks_tbl;
  36. freq = allowed_clks_tbl[0].clock_rate;
  37. i_vpr_l(inst, "%s: rate = %lu\n", __func__, freq);
  38. return freq;
  39. }
  40. int msm_vidc_get_mbps(struct msm_vidc_inst *inst)
  41. {
  42. u32 mbpf, fps;
  43. mbpf = msm_vidc_get_mbs_per_frame(inst);
  44. fps = msm_vidc_get_fps(inst);
  45. return mbpf * fps;
  46. }
  47. int msm_vidc_get_inst_load(struct msm_vidc_inst *inst)
  48. {
  49. int load = 0;
  50. if (!inst || !inst->capabilities) {
  51. d_vpr_e("%s: invalid params\n", __func__);
  52. return -EINVAL;
  53. }
  54. /*
  55. * NRT sessions - clock scaling is based on OPP table.
  56. * - No load based rejection.
  57. * RT sessions - clock scaling and session admission based on load.
  58. */
  59. if (is_thumbnail_session(inst) || !is_realtime_session(inst))
  60. load = 0;
  61. else
  62. load = msm_vidc_get_mbps(inst);
  63. return load;
  64. }
  65. static int fill_dynamic_stats(struct msm_vidc_inst *inst,
  66. struct vidc_bus_vote_data *vote_data)
  67. {
  68. struct msm_vidc_input_cr_data *temp, *next;
  69. u32 cf = MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR;
  70. u32 cr = MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO;
  71. u32 input_cr = MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO;
  72. u32 frame_size;
  73. if (inst->power.fw_cr)
  74. cr = inst->power.fw_cr;
  75. if (inst->power.fw_cf) {
  76. cf = inst->power.fw_cf;
  77. frame_size = (msm_vidc_get_mbs_per_frame(inst) / (32 * 8) * 3) / 2;
  78. if (frame_size)
  79. cf = cf / frame_size;
  80. }
  81. list_for_each_entry_safe(temp, next, &inst->enc_input_crs, list)
  82. input_cr = min(input_cr, temp->input_cr);
  83. vote_data->compression_ratio = cr;
  84. vote_data->complexity_factor = cf;
  85. vote_data->input_cr = input_cr;
  86. /* Sanitize CF values from HW */
  87. cf = clamp_t(u32, cf, MSM_VIDC_MIN_UBWC_COMPLEXITY_FACTOR,
  88. MSM_VIDC_MAX_UBWC_COMPLEXITY_FACTOR);
  89. cr = clamp_t(u32, cr, MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO,
  90. MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO);
  91. input_cr = clamp_t(u32, input_cr, MSM_VIDC_MIN_UBWC_COMPRESSION_RATIO,
  92. MSM_VIDC_MAX_UBWC_COMPRESSION_RATIO);
  93. vote_data->compression_ratio = cr;
  94. vote_data->complexity_factor = cf;
  95. vote_data->input_cr = input_cr;
  96. i_vpr_l(inst,
  97. "Input CR = %d Recon CR = %d Complexity Factor = %d\n",
  98. vote_data->input_cr, vote_data->compression_ratio,
  99. vote_data->complexity_factor);
  100. return 0;
  101. }
  102. static int msm_vidc_set_buses(struct msm_vidc_inst* inst)
  103. {
  104. int rc = 0;
  105. struct msm_vidc_core* core;
  106. struct msm_vidc_inst* temp;
  107. u64 total_bw_ddr = 0, total_bw_llcc = 0;
  108. u64 curr_time_ns;
  109. if (!inst || !inst->core) {
  110. d_vpr_e("%s: invalid params\n", __func__);
  111. return -EINVAL;
  112. }
  113. core = inst->core;
  114. if (!core || !core->platform || !core->platform->data.bus_bw_nrt) {
  115. d_vpr_e("%s: invalid params\n", __func__);
  116. return -EINVAL;
  117. }
  118. mutex_lock(&core->lock);
  119. curr_time_ns = ktime_get_ns();
  120. list_for_each_entry(temp, &core->instances, list) {
  121. /* skip inactive session bus bandwidth */
  122. if (!is_active_session(temp->last_qbuf_time_ns, curr_time_ns)) {
  123. temp->active = false;
  124. continue;
  125. }
  126. if (temp->power.power_mode == VIDC_POWER_TURBO) {
  127. total_bw_ddr = total_bw_llcc = INT_MAX;
  128. break;
  129. }
  130. if (!is_realtime_session(inst)) {
  131. temp->power.ddr_bw = core->platform->data.bus_bw_nrt[0];
  132. temp->power.sys_cache_bw = core->platform->data.bus_bw_nrt[0];
  133. }
  134. total_bw_ddr += temp->power.ddr_bw;
  135. total_bw_llcc += temp->power.sys_cache_bw;
  136. }
  137. mutex_unlock(&core->lock);
  138. if (msm_vidc_ddr_bw) {
  139. d_vpr_l("msm_vidc_ddr_bw %d\n", msm_vidc_ddr_bw);
  140. total_bw_ddr = msm_vidc_ddr_bw;
  141. }
  142. if (msm_vidc_llc_bw) {
  143. d_vpr_l("msm_vidc_llc_bw %d\n", msm_vidc_llc_bw);
  144. total_bw_llcc = msm_vidc_llc_bw;
  145. }
  146. rc = venus_hfi_scale_buses(inst, total_bw_ddr, total_bw_llcc);
  147. if (rc)
  148. return rc;
  149. return 0;
  150. }
  151. int msm_vidc_scale_buses(struct msm_vidc_inst *inst)
  152. {
  153. int rc = 0;
  154. struct msm_vidc_core *core;
  155. struct vidc_bus_vote_data *vote_data;
  156. struct v4l2_format *out_f;
  157. struct v4l2_format *inp_f;
  158. int codec = 0, frame_rate, buf_ts_fps;
  159. if (!inst || !inst->core || !inst->capabilities) {
  160. d_vpr_e("%s: invalid params: %pK\n", __func__, inst);
  161. return -EINVAL;
  162. }
  163. core = inst->core;
  164. if (!core->dt) {
  165. i_vpr_e(inst, "%s: invalid dt params\n", __func__);
  166. return -EINVAL;
  167. }
  168. vote_data = &inst->bus_data;
  169. vote_data->power_mode = VIDC_POWER_NORMAL;
  170. if (inst->power.buffer_counter < DCVS_WINDOW || is_image_session(inst))
  171. vote_data->power_mode = VIDC_POWER_TURBO;
  172. if (vote_data->power_mode == VIDC_POWER_TURBO)
  173. goto set_buses;
  174. out_f = &inst->fmts[OUTPUT_PORT];
  175. inp_f = &inst->fmts[INPUT_PORT];
  176. switch (inst->domain) {
  177. case MSM_VIDC_DECODER:
  178. codec = inp_f->fmt.pix_mp.pixelformat;
  179. break;
  180. case MSM_VIDC_ENCODER:
  181. codec = out_f->fmt.pix_mp.pixelformat;
  182. break;
  183. default:
  184. i_vpr_e(inst, "%s: invalid session_type %#x\n",
  185. __func__, inst->domain);
  186. break;
  187. }
  188. frame_rate = inst->capabilities->cap[FRAME_RATE].value;
  189. vote_data->codec = inst->codec;
  190. vote_data->input_width = inp_f->fmt.pix_mp.width;
  191. vote_data->input_height = inp_f->fmt.pix_mp.height;
  192. vote_data->output_width = out_f->fmt.pix_mp.width;
  193. vote_data->output_height = out_f->fmt.pix_mp.height;
  194. vote_data->lcu_size = (codec == V4L2_PIX_FMT_HEVC ||
  195. codec == V4L2_PIX_FMT_VP9) ? 32 : 16;
  196. vote_data->fps = msm_vidc_get_fps(inst);
  197. buf_ts_fps = msm_vidc_calc_window_avg_framerate(inst);
  198. if (buf_ts_fps > vote_data->fps) {
  199. i_vpr_l(inst, "%s: bitstream: fps %d, client rate %u\n", __func__,
  200. buf_ts_fps, vote_data->fps);
  201. vote_data->fps = buf_ts_fps;
  202. }
  203. if (inst->domain == MSM_VIDC_ENCODER) {
  204. vote_data->domain = MSM_VIDC_ENCODER;
  205. vote_data->bitrate = inst->capabilities->cap[BIT_RATE].value;
  206. vote_data->rotation = inst->capabilities->cap[ROTATION].value;
  207. vote_data->b_frames_enabled =
  208. inst->capabilities->cap[B_FRAME].value > 0;
  209. /* scale bitrate if operating rate is larger than fps */
  210. if (vote_data->fps > (frame_rate >> 16) &&
  211. (frame_rate >> 16)) {
  212. vote_data->bitrate = vote_data->bitrate /
  213. (frame_rate >> 16) * vote_data->fps;
  214. }
  215. vote_data->num_formats = 1;
  216. vote_data->color_formats[0] = v4l2_colorformat_to_driver(
  217. inst->fmts[INPUT_PORT].fmt.pix_mp.pixelformat, __func__);
  218. } else if (inst->domain == MSM_VIDC_DECODER) {
  219. u32 color_format;
  220. vote_data->domain = MSM_VIDC_DECODER;
  221. vote_data->bitrate = inst->max_input_data_size * vote_data->fps * 8;
  222. color_format = v4l2_colorformat_to_driver(
  223. inst->fmts[OUTPUT_PORT].fmt.pix_mp.pixelformat, __func__);
  224. if (is_linear_colorformat(color_format)) {
  225. vote_data->num_formats = 2;
  226. /*
  227. * 0 index - dpb colorformat
  228. * 1 index - opb colorformat
  229. */
  230. if (is_10bit_colorformat(color_format)) {
  231. vote_data->color_formats[0] = MSM_VIDC_FMT_TP10C;
  232. } else {
  233. vote_data->color_formats[0] = MSM_VIDC_FMT_NV12;
  234. }
  235. vote_data->color_formats[1] = color_format;
  236. } else {
  237. vote_data->num_formats = 1;
  238. vote_data->color_formats[0] = color_format;
  239. }
  240. }
  241. vote_data->work_mode = inst->capabilities->cap[STAGE].value;
  242. if (core->dt->sys_cache_res_set)
  243. vote_data->use_sys_cache = true;
  244. vote_data->num_vpp_pipes = core->capabilities[NUM_VPP_PIPE].value;
  245. fill_dynamic_stats(inst, vote_data);
  246. call_session_op(core, calc_bw, inst, vote_data);
  247. inst->power.ddr_bw = vote_data->calc_bw_ddr;
  248. inst->power.sys_cache_bw = vote_data->calc_bw_llcc;
  249. set_buses:
  250. inst->power.power_mode = vote_data->power_mode;
  251. rc = msm_vidc_set_buses(inst);
  252. if (rc)
  253. return rc;
  254. return 0;
  255. }
  256. int msm_vidc_set_clocks(struct msm_vidc_inst* inst)
  257. {
  258. int rc = 0;
  259. struct msm_vidc_core* core;
  260. struct msm_vidc_inst* temp;
  261. u64 freq;
  262. u64 rate = 0;
  263. bool increment, decrement;
  264. u64 curr_time_ns;
  265. int i = 0;
  266. if (!inst || !inst->core) {
  267. d_vpr_e("%s: invalid params\n", __func__);
  268. return -EINVAL;
  269. }
  270. core = inst->core;
  271. if (!core->dt || !core->dt->allowed_clks_tbl) {
  272. d_vpr_e("%s: invalid dt params\n", __func__);
  273. return -EINVAL;
  274. }
  275. mutex_lock(&core->lock);
  276. increment = false;
  277. decrement = true;
  278. freq = 0;
  279. curr_time_ns = ktime_get_ns();
  280. list_for_each_entry(temp, &core->instances, list) {
  281. /* skip inactive session clock rate */
  282. if (!is_active_session(temp->last_qbuf_time_ns, curr_time_ns)) {
  283. temp->active = false;
  284. continue;
  285. }
  286. freq += temp->power.min_freq;
  287. if (msm_vidc_clock_voting) {
  288. d_vpr_l("msm_vidc_clock_voting %d\n", msm_vidc_clock_voting);
  289. freq = msm_vidc_clock_voting;
  290. decrement = false;
  291. break;
  292. }
  293. /* increment even if one session requested for it */
  294. if (temp->power.dcvs_flags & MSM_VIDC_DCVS_INCR)
  295. increment = true;
  296. /* decrement only if all sessions requested for it */
  297. if (!(temp->power.dcvs_flags & MSM_VIDC_DCVS_DECR))
  298. decrement = false;
  299. }
  300. /*
  301. * keep checking from lowest to highest rate until
  302. * table rate >= requested rate
  303. */
  304. for (i = core->dt->allowed_clks_tbl_size - 1; i >= 0; i--) {
  305. rate = core->dt->allowed_clks_tbl[i].clock_rate;
  306. if (rate >= freq)
  307. break;
  308. }
  309. if (i < 0)
  310. i = 0;
  311. if (increment) {
  312. if (i > 0)
  313. rate = core->dt->allowed_clks_tbl[i - 1].clock_rate;
  314. } else if (decrement) {
  315. if (i < (int) (core->dt->allowed_clks_tbl_size - 1))
  316. rate = core->dt->allowed_clks_tbl[i + 1].clock_rate;
  317. }
  318. core->power.clk_freq = (u32)rate;
  319. i_vpr_p(inst, "%s: clock rate %lu requested %lu increment %d decrement %d\n",
  320. __func__, rate, freq, increment, decrement);
  321. mutex_unlock(&core->lock);
  322. rc = venus_hfi_scale_clocks(inst, rate);
  323. if (rc)
  324. return rc;
  325. return 0;
  326. }
  327. static int msm_vidc_apply_dcvs(struct msm_vidc_inst *inst)
  328. {
  329. int rc = 0;
  330. int bufs_with_fw = 0;
  331. struct msm_vidc_power *power;
  332. if (!inst) {
  333. d_vpr_e("%s: invalid params %pK\n", __func__, inst);
  334. return -EINVAL;
  335. }
  336. /* skip dcvs */
  337. if (!inst->power.dcvs_mode)
  338. return 0;
  339. power = &inst->power;
  340. if (is_decode_session(inst)) {
  341. bufs_with_fw = msm_vidc_num_buffers(inst,
  342. MSM_VIDC_BUF_OUTPUT, MSM_VIDC_ATTR_QUEUED);
  343. } else {
  344. bufs_with_fw = msm_vidc_num_buffers(inst,
  345. MSM_VIDC_BUF_INPUT, MSM_VIDC_ATTR_QUEUED);
  346. }
  347. /* +1 as one buffer is going to be queued after the function */
  348. bufs_with_fw += 1;
  349. /*
  350. * DCVS decides clock level based on below algorithm
  351. *
  352. * Limits :
  353. * min_threshold : Buffers required for reference by FW.
  354. * nom_threshold : Midpoint of Min and Max thresholds
  355. * max_threshold : Min Threshold + DCVS extra buffers, allocated
  356. * for smooth flow.
  357. * 1) When buffers outside FW are reaching client's extra buffers,
  358. * FW is slow and will impact pipeline, Increase clock.
  359. * 2) When pending buffers with FW are less than FW requested,
  360. * pipeline has cushion to absorb FW slowness, Decrease clocks.
  361. * 3) When DCVS has engaged(Inc or Dec):
  362. * For decode:
  363. * - Pending buffers with FW transitions past the nom_threshold,
  364. * switch to calculated load, this smoothens the clock transitions.
  365. * For encode:
  366. * - Always switch to calculated load.
  367. * 4) Otherwise maintain previous Load config.
  368. */
  369. if (bufs_with_fw >= power->max_threshold) {
  370. power->dcvs_flags = MSM_VIDC_DCVS_INCR;
  371. goto exit;
  372. } else if (bufs_with_fw < power->min_threshold) {
  373. power->dcvs_flags = MSM_VIDC_DCVS_DECR;
  374. goto exit;
  375. }
  376. /* encoder: dcvs window handling */
  377. if (is_encode_session(inst)) {
  378. power->dcvs_flags = 0;
  379. goto exit;
  380. }
  381. /* decoder: dcvs window handling */
  382. if ((power->dcvs_flags & MSM_VIDC_DCVS_DECR && bufs_with_fw >= power->nom_threshold) ||
  383. (power->dcvs_flags & MSM_VIDC_DCVS_INCR && bufs_with_fw <= power->nom_threshold)) {
  384. power->dcvs_flags = 0;
  385. }
  386. exit:
  387. i_vpr_p(inst, "dcvs: bufs_with_fw %d th[%d %d %d] flags %#x\n",
  388. bufs_with_fw, power->min_threshold,
  389. power->nom_threshold, power->max_threshold,
  390. power->dcvs_flags);
  391. return rc;
  392. }
  393. int msm_vidc_scale_clocks(struct msm_vidc_inst *inst)
  394. {
  395. struct msm_vidc_core* core;
  396. if (!inst || !inst->core) {
  397. d_vpr_e("%s: invalid params\n", __func__);
  398. return -EINVAL;
  399. }
  400. core = inst->core;
  401. if (inst->power.buffer_counter < DCVS_WINDOW || is_image_session(inst)) {
  402. inst->power.min_freq = msm_vidc_max_freq(inst);
  403. inst->power.dcvs_flags = 0;
  404. } else if (msm_vidc_clock_voting) {
  405. inst->power.min_freq = msm_vidc_clock_voting;
  406. inst->power.dcvs_flags = 0;
  407. } else {
  408. inst->power.min_freq =
  409. call_session_op(core, calc_freq, inst, inst->max_input_data_size);
  410. msm_vidc_apply_dcvs(inst);
  411. }
  412. inst->power.curr_freq = inst->power.min_freq;
  413. msm_vidc_set_clocks(inst);
  414. return 0;
  415. }
  416. int msm_vidc_scale_power(struct msm_vidc_inst *inst, bool scale_buses)
  417. {
  418. struct msm_vidc_core *core;
  419. struct msm_vidc_buffer *vbuf;
  420. u32 data_size = 0;
  421. if (!inst || !inst->core) {
  422. d_vpr_e("%s: invalid params %pK\n", __func__, inst);
  423. return -EINVAL;
  424. }
  425. core = inst->core;
  426. if (!inst->active) {
  427. /* scale buses for inactive -> active session */
  428. scale_buses = true;
  429. inst->active = true;
  430. }
  431. list_for_each_entry(vbuf, &inst->buffers.input.list, list)
  432. data_size = max(data_size, vbuf->data_size);
  433. inst->max_input_data_size = data_size;
  434. /* no pending inputs - skip scale power */
  435. if (!inst->max_input_data_size)
  436. return 0;
  437. if (msm_vidc_scale_clocks(inst))
  438. i_vpr_e(inst, "failed to scale clock\n");
  439. if (scale_buses) {
  440. if (msm_vidc_scale_buses(inst))
  441. i_vpr_e(inst, "failed to scale bus\n");
  442. }
  443. i_vpr_hp(inst,
  444. "power: inst: clk %lld ddr %d llcc %d dcvs flags %#x, core: clk %lld ddr %lld llcc %lld\n",
  445. inst->power.curr_freq, inst->power.ddr_bw,
  446. inst->power.sys_cache_bw, inst->power.dcvs_flags,
  447. core->power.clk_freq, core->power.bw_ddr,
  448. core->power.bw_llcc);
  449. trace_msm_vidc_perf_power_scale(inst, core->power.clk_freq,
  450. core->power.bw_ddr, core->power.bw_llcc);
  451. return 0;
  452. }
  453. void msm_vidc_dcvs_data_reset(struct msm_vidc_inst *inst)
  454. {
  455. struct msm_vidc_power *dcvs;
  456. u32 min_count, actual_count, max_count;
  457. if (!inst) {
  458. d_vpr_e("%s: invalid params\n", __func__);
  459. return;
  460. }
  461. dcvs = &inst->power;
  462. if (is_encode_session(inst)) {
  463. min_count = inst->buffers.input.min_count;
  464. actual_count = inst->buffers.input.actual_count;
  465. max_count = min((min_count + DCVS_ENC_EXTRA_INPUT_BUFFERS), actual_count);
  466. } else if (is_decode_session(inst)) {
  467. min_count = inst->buffers.output.min_count;
  468. actual_count = inst->buffers.output.actual_count;
  469. max_count = min((min_count + DCVS_DEC_EXTRA_OUTPUT_BUFFERS), actual_count);
  470. } else {
  471. i_vpr_e(inst, "%s: invalid domain type %d\n",
  472. __func__, inst->domain);
  473. return;
  474. }
  475. dcvs->min_threshold = min_count;
  476. dcvs->max_threshold = max_count;
  477. dcvs->dcvs_window = min_count < max_count ? max_count - min_count : 0;
  478. dcvs->nom_threshold = dcvs->min_threshold + (dcvs->dcvs_window / 2);
  479. dcvs->dcvs_flags = 0;
  480. i_vpr_p(inst, "%s: dcvs: thresholds [%d %d %d] flags %#x\n",
  481. __func__, dcvs->min_threshold,
  482. dcvs->nom_threshold, dcvs->max_threshold,
  483. dcvs->dcvs_flags);
  484. }
  485. void msm_vidc_power_data_reset(struct msm_vidc_inst *inst)
  486. {
  487. int rc = 0;
  488. if (!inst || !inst->core) {
  489. d_vpr_e("%s: invalid params\n", __func__);
  490. return;
  491. }
  492. i_vpr_hp(inst, "%s\n", __func__);
  493. msm_vidc_dcvs_data_reset(inst);
  494. inst->power.buffer_counter = 0;
  495. inst->power.fw_cr = 0;
  496. inst->power.fw_cf = INT_MAX;
  497. rc = msm_vidc_scale_power(inst, true);
  498. if (rc)
  499. i_vpr_e(inst, "%s: failed to scale power\n", __func__);
  500. }