sde_vbif.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #define pr_fmt(fmt) "[drm:%s:%d] " fmt, __func__, __LINE__
  6. #include <linux/debugfs.h>
  7. #include "sde_vbif.h"
  8. #include "sde_hw_vbif.h"
  9. #include "sde_trace.h"
  10. #include "sde_rotator_vbif.h"
  11. #define MAX_XIN_CLIENT 16
  12. /**
  13. * _sde_vbif_wait_for_xin_halt - wait for the xin to halt
  14. * @vbif: Pointer to hardware vbif driver
  15. * @xin_id: Client interface identifier
  16. * @return: 0 if success; error code otherwise
  17. */
  18. static int _sde_vbif_wait_for_xin_halt(struct sde_hw_vbif *vbif, u32 xin_id)
  19. {
  20. ktime_t timeout;
  21. bool status;
  22. int rc;
  23. if (!vbif || !vbif->cap || !vbif->ops.get_xin_halt_status) {
  24. SDE_ERROR("invalid arguments vbif %d\n", !vbif);
  25. return -EINVAL;
  26. }
  27. timeout = ktime_add_us(ktime_get(), vbif->cap->xin_halt_timeout);
  28. for (;;) {
  29. status = vbif->ops.get_xin_halt_status(vbif, xin_id);
  30. if (status)
  31. break;
  32. if (ktime_compare_safe(ktime_get(), timeout) > 0) {
  33. status = vbif->ops.get_xin_halt_status(vbif, xin_id);
  34. break;
  35. }
  36. usleep_range(501, 1000);
  37. }
  38. if (!status) {
  39. rc = -ETIMEDOUT;
  40. SDE_ERROR("VBIF %d client %d not halting. TIMEDOUT.\n",
  41. vbif->idx - VBIF_0, xin_id);
  42. } else {
  43. rc = 0;
  44. SDE_DEBUG("VBIF %d client %d is halted\n",
  45. vbif->idx - VBIF_0, xin_id);
  46. }
  47. return rc;
  48. }
  49. static int _sde_vbif_wait_for_axi_halt(struct sde_hw_vbif *vbif)
  50. {
  51. int rc;
  52. if (!vbif || !vbif->cap || !vbif->ops.get_axi_halt_status) {
  53. SDE_ERROR("invalid arguments vbif %d\n", !vbif);
  54. return -EINVAL;
  55. }
  56. rc = vbif->ops.get_axi_halt_status(vbif);
  57. if (rc)
  58. SDE_ERROR("VBIF %d AXI port(s) not halting. TIMEDOUT.\n",
  59. vbif->idx - VBIF_0);
  60. else
  61. SDE_DEBUG("VBIF %d AXI port(s) halted\n",
  62. vbif->idx - VBIF_0);
  63. return rc;
  64. }
  65. int sde_vbif_halt_plane_xin(struct sde_kms *sde_kms, u32 xin_id, u32 clk_ctrl)
  66. {
  67. struct sde_hw_vbif *vbif = NULL;
  68. struct sde_hw_mdp *mdp;
  69. bool forced_on = false;
  70. bool status;
  71. int rc = 0;
  72. if (!sde_kms) {
  73. SDE_ERROR("invalid argument\n");
  74. return -EINVAL;
  75. }
  76. if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
  77. SDE_DEBUG("vbif operations not permitted\n");
  78. return 0;
  79. }
  80. vbif = sde_kms->hw_vbif[VBIF_RT];
  81. mdp = sde_kms->hw_mdp;
  82. if (!vbif || !mdp || !vbif->ops.get_xin_halt_status ||
  83. !vbif->ops.set_xin_halt ||
  84. !mdp->ops.setup_clk_force_ctrl) {
  85. SDE_ERROR("invalid vbif or mdp arguments\n");
  86. return -EINVAL;
  87. }
  88. mutex_lock(&vbif->mutex);
  89. SDE_EVT32_VERBOSE(vbif->idx, xin_id);
  90. /*
  91. * If status is 0, then make sure client clock is not gated
  92. * while halting by forcing it ON only if it was not previously
  93. * forced on. If status is 1 then its already halted.
  94. */
  95. status = vbif->ops.get_xin_halt_status(vbif, xin_id);
  96. if (status) {
  97. mutex_unlock(&vbif->mutex);
  98. return 0;
  99. }
  100. forced_on = mdp->ops.setup_clk_force_ctrl(mdp, clk_ctrl, true);
  101. /* send halt request for unused plane's xin client */
  102. vbif->ops.set_xin_halt(vbif, xin_id, true);
  103. rc = _sde_vbif_wait_for_xin_halt(vbif, xin_id);
  104. if (rc) {
  105. SDE_ERROR(
  106. "wait failed for pipe halt:xin_id %u, clk_ctrl %u, rc %u\n",
  107. xin_id, clk_ctrl, rc);
  108. SDE_EVT32(xin_id, clk_ctrl, rc, SDE_EVTLOG_ERROR);
  109. }
  110. /* open xin client to enable transactions */
  111. vbif->ops.set_xin_halt(vbif, xin_id, false);
  112. if (forced_on)
  113. mdp->ops.setup_clk_force_ctrl(mdp, clk_ctrl, false);
  114. mutex_unlock(&vbif->mutex);
  115. return rc;
  116. }
  117. /**
  118. * _sde_vbif_apply_dynamic_ot_limit - determine OT based on usecase parameters
  119. * @vbif: Pointer to hardware vbif driver
  120. * @ot_lim: Pointer to OT limit to be modified
  121. * @params: Pointer to usecase parameters
  122. */
  123. static void _sde_vbif_apply_dynamic_ot_limit(struct sde_hw_vbif *vbif,
  124. u32 *ot_lim, struct sde_vbif_set_ot_params *params)
  125. {
  126. u64 pps;
  127. const struct sde_vbif_dynamic_ot_tbl *tbl;
  128. u32 i;
  129. if (!vbif || !(vbif->cap->features & BIT(SDE_VBIF_QOS_OTLIM)))
  130. return;
  131. /* Dynamic OT setting done only for WFD */
  132. if (!params->is_wfd)
  133. return;
  134. pps = params->frame_rate;
  135. pps *= params->width;
  136. pps *= params->height;
  137. tbl = params->rd ? &vbif->cap->dynamic_ot_rd_tbl :
  138. &vbif->cap->dynamic_ot_wr_tbl;
  139. for (i = 0; i < tbl->count; i++) {
  140. if (pps <= tbl->cfg[i].pps) {
  141. *ot_lim = tbl->cfg[i].ot_limit;
  142. break;
  143. }
  144. }
  145. SDE_DEBUG("vbif:%d xin:%d w:%d h:%d fps:%d pps:%llu ot:%u\n",
  146. vbif->idx - VBIF_0, params->xin_id,
  147. params->width, params->height, params->frame_rate,
  148. pps, *ot_lim);
  149. }
  150. /**
  151. * _sde_vbif_get_ot_limit - get OT based on usecase & configuration parameters
  152. * @vbif: Pointer to hardware vbif driver
  153. * @params: Pointer to usecase parameters
  154. * @return: OT limit
  155. */
  156. static u32 _sde_vbif_get_ot_limit(struct sde_hw_vbif *vbif,
  157. struct sde_vbif_set_ot_params *params)
  158. {
  159. u32 ot_lim = 0;
  160. u32 val;
  161. if (!vbif || !vbif->cap) {
  162. SDE_ERROR("invalid arguments vbif %d\n", !vbif);
  163. return -EINVAL;
  164. }
  165. if (vbif->cap->default_ot_wr_limit && !params->rd)
  166. ot_lim = vbif->cap->default_ot_wr_limit;
  167. else if (vbif->cap->default_ot_rd_limit && params->rd)
  168. ot_lim = vbif->cap->default_ot_rd_limit;
  169. /*
  170. * If default ot is not set from dt/catalog,
  171. * then do not configure it.
  172. */
  173. if (ot_lim == 0)
  174. goto exit;
  175. /* Modify the limits if the target and the use case requires it */
  176. _sde_vbif_apply_dynamic_ot_limit(vbif, &ot_lim, params);
  177. if (vbif && vbif->ops.get_limit_conf) {
  178. val = vbif->ops.get_limit_conf(vbif,
  179. params->xin_id, params->rd);
  180. if (val == ot_lim)
  181. ot_lim = 0;
  182. }
  183. exit:
  184. SDE_DEBUG("vbif:%d xin:%d ot_lim:%d\n",
  185. vbif->idx - VBIF_0, params->xin_id, ot_lim);
  186. return ot_lim;
  187. }
  188. /**
  189. * sde_vbif_set_ot_limit - set OT based on usecase & configuration parameters
  190. * @vbif: Pointer to hardware vbif driver
  191. * @params: Pointer to usecase parameters
  192. *
  193. * Note this function would block waiting for bus halt.
  194. */
  195. void sde_vbif_set_ot_limit(struct sde_kms *sde_kms,
  196. struct sde_vbif_set_ot_params *params)
  197. {
  198. struct sde_hw_vbif *vbif = NULL;
  199. struct sde_hw_mdp *mdp;
  200. bool forced_on = false;
  201. u32 ot_lim;
  202. int ret, i;
  203. if (!sde_kms) {
  204. SDE_ERROR("invalid arguments\n");
  205. return;
  206. }
  207. if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
  208. SDE_DEBUG("vbif operations not permitted\n");
  209. return;
  210. }
  211. mdp = sde_kms->hw_mdp;
  212. for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
  213. if (sde_kms->hw_vbif[i] &&
  214. sde_kms->hw_vbif[i]->idx == params->vbif_idx) {
  215. vbif = sde_kms->hw_vbif[i];
  216. break;
  217. }
  218. }
  219. if (!vbif || !mdp) {
  220. SDE_DEBUG("invalid arguments vbif %d mdp %d\n",
  221. vbif != NULL, mdp != NULL);
  222. return;
  223. }
  224. if (!mdp->ops.setup_clk_force_ctrl ||
  225. !vbif->ops.set_limit_conf ||
  226. !vbif->ops.set_xin_halt)
  227. return;
  228. mutex_lock(&vbif->mutex);
  229. SDE_EVT32_VERBOSE(vbif->idx, params->xin_id);
  230. /* set write_gather_en for all write clients */
  231. if (vbif->ops.set_write_gather_en && !params->rd)
  232. vbif->ops.set_write_gather_en(vbif, params->xin_id);
  233. ot_lim = _sde_vbif_get_ot_limit(vbif, params) & 0xFF;
  234. if (ot_lim == 0)
  235. goto exit;
  236. trace_sde_perf_set_ot(params->num, params->xin_id, ot_lim,
  237. params->vbif_idx);
  238. forced_on = mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, true);
  239. vbif->ops.set_limit_conf(vbif, params->xin_id, params->rd, ot_lim);
  240. vbif->ops.set_xin_halt(vbif, params->xin_id, true);
  241. ret = _sde_vbif_wait_for_xin_halt(vbif, params->xin_id);
  242. if (ret)
  243. SDE_EVT32(vbif->idx, params->xin_id);
  244. vbif->ops.set_xin_halt(vbif, params->xin_id, false);
  245. if (forced_on)
  246. mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, false);
  247. exit:
  248. mutex_unlock(&vbif->mutex);
  249. }
  250. void mdp_vbif_lock(struct platform_device *parent_pdev, bool enable)
  251. {
  252. struct drm_device *ddev;
  253. struct sde_kms *sde_kms;
  254. struct sde_hw_vbif *vbif = NULL;
  255. int i;
  256. ddev = platform_get_drvdata(parent_pdev);
  257. if (!ddev || !ddev_to_msm_kms(ddev)) {
  258. SDE_ERROR("invalid drm device\n");
  259. return;
  260. }
  261. sde_kms = to_sde_kms(ddev_to_msm_kms(ddev));
  262. for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
  263. if (sde_kms->hw_vbif[i] &&
  264. sde_kms->hw_vbif[i]->idx == VBIF_RT) {
  265. vbif = sde_kms->hw_vbif[i];
  266. break;
  267. }
  268. }
  269. if (!vbif) {
  270. SDE_DEBUG("invalid vbif structure\n");
  271. return;
  272. }
  273. if (enable)
  274. mutex_lock(&vbif->mutex);
  275. else
  276. mutex_unlock(&vbif->mutex);
  277. }
  278. bool sde_vbif_set_xin_halt(struct sde_kms *sde_kms,
  279. struct sde_vbif_set_xin_halt_params *params)
  280. {
  281. struct sde_hw_vbif *vbif = NULL;
  282. struct sde_hw_mdp *mdp;
  283. bool forced_on = false;
  284. int ret, i;
  285. if (!sde_kms || !params) {
  286. SDE_ERROR("invalid arguments\n");
  287. return false;
  288. }
  289. if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
  290. SDE_DEBUG("vbif operations not permitted\n");
  291. return true;
  292. }
  293. mdp = sde_kms->hw_mdp;
  294. for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
  295. if (sde_kms->hw_vbif[i] &&
  296. sde_kms->hw_vbif[i]->idx == params->vbif_idx) {
  297. vbif = sde_kms->hw_vbif[i];
  298. break;
  299. }
  300. }
  301. if (!vbif || !mdp) {
  302. SDE_DEBUG("invalid arguments vbif %d mdp %d\n",
  303. vbif != NULL, mdp != NULL);
  304. return false;
  305. }
  306. if (!mdp->ops.setup_clk_force_ctrl ||
  307. !vbif->ops.set_xin_halt)
  308. return false;
  309. mutex_lock(&vbif->mutex);
  310. SDE_EVT32_VERBOSE(vbif->idx, params->xin_id);
  311. if (params->enable) {
  312. forced_on = mdp->ops.setup_clk_force_ctrl(mdp,
  313. params->clk_ctrl, true);
  314. vbif->ops.set_xin_halt(vbif, params->xin_id, true);
  315. ret = _sde_vbif_wait_for_xin_halt(vbif, params->xin_id);
  316. if (ret)
  317. SDE_EVT32(vbif->idx, params->xin_id, SDE_EVTLOG_ERROR);
  318. } else {
  319. vbif->ops.set_xin_halt(vbif, params->xin_id, false);
  320. if (params->forced_on)
  321. mdp->ops.setup_clk_force_ctrl(mdp,
  322. params->clk_ctrl, false);
  323. }
  324. mutex_unlock(&vbif->mutex);
  325. return forced_on;
  326. }
  327. void sde_vbif_set_qos_remap(struct sde_kms *sde_kms,
  328. struct sde_vbif_set_qos_params *params)
  329. {
  330. struct sde_hw_vbif *vbif = NULL;
  331. struct sde_hw_mdp *mdp;
  332. bool forced_on = false;
  333. const struct sde_vbif_qos_tbl *qos_tbl;
  334. int i;
  335. if (!sde_kms || !params || !sde_kms->hw_mdp) {
  336. SDE_ERROR("invalid arguments\n");
  337. return;
  338. }
  339. if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
  340. SDE_DEBUG("vbif operations not permitted\n");
  341. return;
  342. }
  343. mdp = sde_kms->hw_mdp;
  344. for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
  345. if (sde_kms->hw_vbif[i] &&
  346. sde_kms->hw_vbif[i]->idx == params->vbif_idx) {
  347. vbif = sde_kms->hw_vbif[i];
  348. break;
  349. }
  350. }
  351. if (!vbif || !vbif->cap) {
  352. SDE_ERROR("invalid vbif %d\n", params->vbif_idx);
  353. return;
  354. }
  355. if (!vbif->ops.set_qos_remap || !mdp->ops.setup_clk_force_ctrl) {
  356. SDE_DEBUG("qos remap not supported\n");
  357. return;
  358. }
  359. if (params->client_type > VBIF_MAX_CLIENT) {
  360. SDE_ERROR("invalid client type:%d\n", params->client_type);
  361. return;
  362. }
  363. qos_tbl = &vbif->cap->qos_tbl[params->client_type];
  364. if (!qos_tbl->npriority_lvl || !qos_tbl->priority_lvl) {
  365. SDE_DEBUG("qos tbl not defined\n");
  366. return;
  367. }
  368. mutex_lock(&vbif->mutex);
  369. forced_on = mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, true);
  370. for (i = 0; i < qos_tbl->npriority_lvl; i++) {
  371. SDE_DEBUG("vbif:%d xin:%d lvl:%d/%d\n",
  372. params->vbif_idx, params->xin_id, i,
  373. qos_tbl->priority_lvl[i]);
  374. vbif->ops.set_qos_remap(vbif, params->xin_id, i,
  375. qos_tbl->priority_lvl[i]);
  376. }
  377. if (forced_on)
  378. mdp->ops.setup_clk_force_ctrl(mdp, params->clk_ctrl, false);
  379. mutex_unlock(&vbif->mutex);
  380. }
  381. void sde_vbif_clear_errors(struct sde_kms *sde_kms)
  382. {
  383. struct sde_hw_vbif *vbif;
  384. u32 i, pnd, src;
  385. if (!sde_kms) {
  386. SDE_ERROR("invalid argument\n");
  387. return;
  388. }
  389. if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
  390. SDE_DEBUG("vbif operations not permitted\n");
  391. return;
  392. }
  393. for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
  394. vbif = sde_kms->hw_vbif[i];
  395. if (vbif && vbif->ops.clear_errors) {
  396. mutex_lock(&vbif->mutex);
  397. vbif->ops.clear_errors(vbif, &pnd, &src);
  398. if (pnd || src) {
  399. SDE_EVT32(i, pnd, src);
  400. SDE_DEBUG("VBIF %d: pnd 0x%X, src 0x%X\n",
  401. vbif->idx - VBIF_0, pnd, src);
  402. }
  403. mutex_unlock(&vbif->mutex);
  404. }
  405. }
  406. }
  407. void sde_vbif_init_memtypes(struct sde_kms *sde_kms)
  408. {
  409. struct sde_hw_vbif *vbif;
  410. int i, j;
  411. if (!sde_kms) {
  412. SDE_ERROR("invalid argument\n");
  413. return;
  414. }
  415. if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
  416. SDE_DEBUG("vbif operations not permitted\n");
  417. return;
  418. }
  419. for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
  420. vbif = sde_kms->hw_vbif[i];
  421. if (vbif && vbif->cap && vbif->ops.set_mem_type) {
  422. mutex_lock(&vbif->mutex);
  423. for (j = 0; j < vbif->cap->memtype_count; j++)
  424. vbif->ops.set_mem_type(
  425. vbif, j, vbif->cap->memtype[j]);
  426. mutex_unlock(&vbif->mutex);
  427. }
  428. }
  429. }
  430. void sde_vbif_axi_halt_request(struct sde_kms *sde_kms)
  431. {
  432. struct sde_hw_vbif *vbif;
  433. int i;
  434. if (!sde_kms) {
  435. SDE_ERROR("invalid argument\n");
  436. return;
  437. }
  438. if (!sde_kms_is_vbif_operation_allowed(sde_kms)) {
  439. SDE_DEBUG("vbif operations not permitted\n");
  440. return;
  441. }
  442. for (i = 0; i < ARRAY_SIZE(sde_kms->hw_vbif); i++) {
  443. vbif = sde_kms->hw_vbif[i];
  444. if (vbif && vbif->cap && vbif->ops.set_axi_halt) {
  445. mutex_lock(&vbif->mutex);
  446. vbif->ops.set_axi_halt(vbif);
  447. _sde_vbif_wait_for_axi_halt(vbif);
  448. mutex_unlock(&vbif->mutex);
  449. }
  450. }
  451. }
  452. int sde_vbif_halt_xin_mask(struct sde_kms *sde_kms, u32 xin_id_mask,
  453. bool halt)
  454. {
  455. struct sde_hw_vbif *vbif;
  456. int i = 0, status, rc;
  457. if (!sde_kms) {
  458. SDE_ERROR("invalid argument\n");
  459. return -EINVAL;
  460. }
  461. vbif = sde_kms->hw_vbif[VBIF_RT];
  462. if (!vbif->ops.get_xin_halt_status || !vbif->ops.set_xin_halt)
  463. return 0;
  464. SDE_EVT32(xin_id_mask, halt);
  465. for (i = 0; i < MAX_XIN_CLIENT; i++) {
  466. if (xin_id_mask & BIT(i)) {
  467. /* unhalt the xin-clients */
  468. if (!halt) {
  469. vbif->ops.set_xin_halt(vbif, i, false);
  470. continue;
  471. }
  472. status = vbif->ops.get_xin_halt_status(vbif, i);
  473. if (status)
  474. continue;
  475. /* halt xin-clients and wait for ack */
  476. vbif->ops.set_xin_halt(vbif, i, true);
  477. rc = _sde_vbif_wait_for_xin_halt(vbif, i);
  478. if (rc) {
  479. SDE_ERROR("xin_halt failed for xin:%d, rc:%d\n",
  480. i, rc);
  481. SDE_EVT32(xin_id_mask, i, rc, SDE_EVTLOG_ERROR);
  482. return rc;
  483. }
  484. }
  485. }
  486. return 0;
  487. }
  488. #ifdef CONFIG_DEBUG_FS
  489. void sde_debugfs_vbif_destroy(struct sde_kms *sde_kms)
  490. {
  491. debugfs_remove_recursive(sde_kms->debugfs_vbif);
  492. sde_kms->debugfs_vbif = NULL;
  493. }
  494. int sde_debugfs_vbif_init(struct sde_kms *sde_kms, struct dentry *debugfs_root)
  495. {
  496. char vbif_name[32];
  497. struct dentry *debugfs_vbif;
  498. int i, j;
  499. sde_kms->debugfs_vbif = debugfs_create_dir("vbif", debugfs_root);
  500. if (!sde_kms->debugfs_vbif) {
  501. SDE_ERROR("failed to create vbif debugfs\n");
  502. return -EINVAL;
  503. }
  504. for (i = 0; i < sde_kms->catalog->vbif_count; i++) {
  505. struct sde_vbif_cfg *vbif = &sde_kms->catalog->vbif[i];
  506. snprintf(vbif_name, sizeof(vbif_name), "%d", vbif->id);
  507. debugfs_vbif = debugfs_create_dir(vbif_name,
  508. sde_kms->debugfs_vbif);
  509. debugfs_create_u32("features", 0400, debugfs_vbif,
  510. (u32 *)&vbif->features);
  511. debugfs_create_u32("xin_halt_timeout", 0400, debugfs_vbif,
  512. (u32 *)&vbif->xin_halt_timeout);
  513. debugfs_create_u32("default_rd_ot_limit", 0400, debugfs_vbif,
  514. (u32 *)&vbif->default_ot_rd_limit);
  515. debugfs_create_u32("default_wr_ot_limit", 0400, debugfs_vbif,
  516. (u32 *)&vbif->default_ot_wr_limit);
  517. for (j = 0; j < vbif->dynamic_ot_rd_tbl.count; j++) {
  518. struct sde_vbif_dynamic_ot_cfg *cfg =
  519. &vbif->dynamic_ot_rd_tbl.cfg[j];
  520. snprintf(vbif_name, sizeof(vbif_name),
  521. "dynamic_ot_rd_%d_pps", j);
  522. debugfs_create_u64(vbif_name, 0400, debugfs_vbif,
  523. (u64 *)&cfg->pps);
  524. snprintf(vbif_name, sizeof(vbif_name),
  525. "dynamic_ot_rd_%d_ot_limit", j);
  526. debugfs_create_u32(vbif_name, 0400, debugfs_vbif,
  527. (u32 *)&cfg->ot_limit);
  528. }
  529. for (j = 0; j < vbif->dynamic_ot_wr_tbl.count; j++) {
  530. struct sde_vbif_dynamic_ot_cfg *cfg =
  531. &vbif->dynamic_ot_wr_tbl.cfg[j];
  532. snprintf(vbif_name, sizeof(vbif_name),
  533. "dynamic_ot_wr_%d_pps", j);
  534. debugfs_create_u64(vbif_name, 0400, debugfs_vbif,
  535. (u64 *)&cfg->pps);
  536. snprintf(vbif_name, sizeof(vbif_name),
  537. "dynamic_ot_wr_%d_ot_limit", j);
  538. debugfs_create_u32(vbif_name, 0400, debugfs_vbif,
  539. (u32 *)&cfg->ot_limit);
  540. }
  541. }
  542. return 0;
  543. }
  544. #endif