msm_vidc_power.c 16 KB

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