sde_kms.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /*
  2. * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
  3. * Copyright (C) 2013 Red Hat
  4. * Author: Rob Clark <[email protected]>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published by
  8. * the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __SDE_KMS_H__
  19. #define __SDE_KMS_H__
  20. #include <linux/msm_ion.h>
  21. #include <linux/pm_domain.h>
  22. #include <linux/pm_qos.h>
  23. #include "msm_drv.h"
  24. #include "msm_kms.h"
  25. #include "msm_mmu.h"
  26. #include "msm_gem.h"
  27. #include "sde_dbg.h"
  28. #include "sde_hw_catalog.h"
  29. #include "sde_hw_ctl.h"
  30. #include "sde_hw_lm.h"
  31. #include "sde_hw_pingpong.h"
  32. #include "sde_hw_interrupts.h"
  33. #include "sde_hw_wb.h"
  34. #include "sde_hw_top.h"
  35. #include "sde_hw_uidle.h"
  36. #include "sde_rm.h"
  37. #include "sde_power_handle.h"
  38. #include "sde_irq.h"
  39. #include "sde_core_perf.h"
  40. #define DRMID(x) ((x) ? (x)->base.id : -1)
  41. /**
  42. * SDE_DEBUG - macro for kms/plane/crtc/encoder/connector logs
  43. * @fmt: Pointer to format string
  44. */
  45. #define SDE_DEBUG(fmt, ...) \
  46. do { \
  47. if (unlikely(drm_debug & DRM_UT_KMS)) \
  48. DRM_DEBUG(fmt, ##__VA_ARGS__); \
  49. else \
  50. pr_debug(fmt, ##__VA_ARGS__); \
  51. } while (0)
  52. /**
  53. * SDE_INFO - macro for kms/plane/crtc/encoder/connector logs
  54. * @fmt: Pointer to format string
  55. */
  56. #define SDE_INFO(fmt, ...) \
  57. do { \
  58. if (unlikely(drm_debug & DRM_UT_KMS)) \
  59. DRM_INFO(fmt, ##__VA_ARGS__); \
  60. else \
  61. pr_info(fmt, ##__VA_ARGS__); \
  62. } while (0)
  63. /**
  64. * SDE_DEBUG_DRIVER - macro for hardware driver logging
  65. * @fmt: Pointer to format string
  66. */
  67. #define SDE_DEBUG_DRIVER(fmt, ...) \
  68. do { \
  69. if (unlikely(drm_debug & DRM_UT_DRIVER)) \
  70. DRM_ERROR(fmt, ##__VA_ARGS__); \
  71. else \
  72. pr_debug(fmt, ##__VA_ARGS__); \
  73. } while (0)
  74. #define SDE_ERROR(fmt, ...) pr_err("[sde error]" fmt, ##__VA_ARGS__)
  75. #define POPULATE_RECT(rect, a, b, c, d, Q16_flag) \
  76. do { \
  77. (rect)->x = (Q16_flag) ? (a) >> 16 : (a); \
  78. (rect)->y = (Q16_flag) ? (b) >> 16 : (b); \
  79. (rect)->w = (Q16_flag) ? (c) >> 16 : (c); \
  80. (rect)->h = (Q16_flag) ? (d) >> 16 : (d); \
  81. } while (0)
  82. #define CHECK_LAYER_BOUNDS(offset, size, max_size) \
  83. (((size) > (max_size)) || ((offset) > ((max_size) - (size))))
  84. /**
  85. * ktime_compare_safe - compare two ktime structures
  86. * This macro is similar to the standard ktime_compare() function, but
  87. * attempts to also handle ktime overflows.
  88. * @A: First ktime value
  89. * @B: Second ktime value
  90. * Returns: -1 if A < B, 0 if A == B, 1 if A > B
  91. */
  92. #define ktime_compare_safe(A, B) \
  93. ktime_compare(ktime_sub((A), (B)), ktime_set(0, 0))
  94. #define SDE_NAME_SIZE 12
  95. /* timeout in frames waiting for frame done */
  96. #define SDE_FRAME_DONE_TIMEOUT 60
  97. /* max active secure client counts allowed */
  98. #define MAX_ALLOWED_SECURE_CLIENT_CNT 1
  99. /* max active crtc when secure client is active */
  100. #define MAX_ALLOWED_CRTC_CNT_DURING_SECURE 1
  101. /* max virtual encoders per secure crtc */
  102. #define MAX_ALLOWED_ENCODER_CNT_PER_SECURE_CRTC 1
  103. /* defines the operations required for secure state transition */
  104. #define SDE_KMS_OPS_SECURE_STATE_CHANGE BIT(0)
  105. #define SDE_KMS_OPS_WAIT_FOR_TX_DONE BIT(1)
  106. #define SDE_KMS_OPS_CLEANUP_PLANE_FB BIT(2)
  107. #define SDE_KMS_OPS_PREPARE_PLANE_FB BIT(3)
  108. /* ESD status check interval in miliseconds */
  109. #define STATUS_CHECK_INTERVAL_MS 5000
  110. /**
  111. * enum sde_kms_smmu_state: smmu state
  112. * @ATTACHED: all the context banks are attached.
  113. * @DETACHED: all the context banks are detached.
  114. * @DETACHED_SEC: secure context bank is detached.
  115. * @ATTACH_ALL_REQ: transient state of attaching context banks.
  116. * @DETACH_ALL_REQ: transient state of detaching context banks.
  117. * @DETACH_SEC_REQ: tranisent state of secure context bank is detached
  118. * @ATTACH_SEC_REQ: transient state of attaching secure context bank.
  119. */
  120. enum sde_kms_smmu_state {
  121. ATTACHED = 0,
  122. DETACHED,
  123. DETACHED_SEC,
  124. ATTACH_ALL_REQ,
  125. DETACH_ALL_REQ,
  126. DETACH_SEC_REQ,
  127. ATTACH_SEC_REQ,
  128. };
  129. /**
  130. * enum sde_kms_smmu_state_transition_type: state transition type
  131. * @NONE: no pending state transitions
  132. * @PRE_COMMIT: state transitions should be done before processing the commit
  133. * @POST_COMMIT: state transitions to be done after processing the commit.
  134. */
  135. enum sde_kms_smmu_state_transition_type {
  136. NONE,
  137. PRE_COMMIT,
  138. POST_COMMIT
  139. };
  140. /**
  141. * enum sde_kms_sui_misr_state: state request for enabling/disabling MISR
  142. * @NONE: no request
  143. * @ENABLE_SUI_MISR_REQ: request to enable sui MISR
  144. * @DISABLE_SUI_MISR_REQ: request to disable sui MISR
  145. */
  146. enum sde_kms_sui_misr_state {
  147. SUI_MISR_NONE,
  148. SUI_MISR_ENABLE_REQ,
  149. SUI_MISR_DISABLE_REQ
  150. };
  151. /*
  152. * @FRAME_DONE_WAIT_DEFAULT: waits for frame N pp_done interrupt before
  153. * triggering frame N+1.
  154. * @FRAME_DONE_WAIT_SERIALIZE: serialize pp_done and ctl_start irq for frame
  155. * N without next frame trigger wait.
  156. * @FRAME_DONE_WAIT_POSTED_START: Do not wait for pp_done interrupt for any
  157. * frame. Wait will trigger only for error case.
  158. */
  159. enum frame_trigger_mode_type {
  160. FRAME_DONE_WAIT_DEFAULT,
  161. FRAME_DONE_WAIT_SERIALIZE,
  162. FRAME_DONE_WAIT_POSTED_START,
  163. };
  164. /**
  165. * struct sde_kms_smmu_state_data: stores the smmu state and transition type
  166. * @state: current state of smmu context banks
  167. * @secure_level: secure level cached from crtc
  168. * @transition_type: transition request type
  169. * @transition_error: whether there is error while transitioning the state
  170. */
  171. struct sde_kms_smmu_state_data {
  172. uint32_t state;
  173. uint32_t secure_level;
  174. uint32_t transition_type;
  175. uint32_t transition_error;
  176. uint32_t sui_misr_state;
  177. };
  178. /*
  179. * struct sde_irq_callback - IRQ callback handlers
  180. * @list: list to callback
  181. * @func: intr handler
  182. * @arg: argument for the handler
  183. */
  184. struct sde_irq_callback {
  185. struct list_head list;
  186. void (*func)(void *arg, int irq_idx);
  187. void *arg;
  188. };
  189. /**
  190. * struct sde_irq: IRQ structure contains callback registration info
  191. * @total_irq: total number of irq_idx obtained from HW interrupts mapping
  192. * @irq_cb_tbl: array of IRQ callbacks setting
  193. * @enable_counts array of IRQ enable counts
  194. * @cb_lock: callback lock
  195. * @debugfs_file: debugfs file for irq statistics
  196. */
  197. struct sde_irq {
  198. u32 total_irqs;
  199. struct list_head *irq_cb_tbl;
  200. atomic_t *enable_counts;
  201. atomic_t *irq_counts;
  202. spinlock_t cb_lock;
  203. struct dentry *debugfs_file;
  204. };
  205. struct sde_kms {
  206. struct msm_kms base;
  207. struct drm_device *dev;
  208. int core_rev;
  209. struct sde_mdss_cfg *catalog;
  210. struct generic_pm_domain genpd;
  211. bool genpd_init;
  212. struct msm_gem_address_space *aspace[MSM_SMMU_DOMAIN_MAX];
  213. struct sde_power_event *power_event;
  214. /* directory entry for debugfs */
  215. struct dentry *debugfs_vbif;
  216. /* io/register spaces: */
  217. void __iomem *mmio, *vbif[VBIF_MAX], *reg_dma, *sid, *sw_fuse;
  218. unsigned long mmio_len, vbif_len[VBIF_MAX], reg_dma_len, sid_len;
  219. unsigned long sw_fuse_len;
  220. struct regulator *vdd;
  221. struct regulator *mmagic;
  222. struct regulator *venus;
  223. struct sde_irq_controller irq_controller;
  224. struct sde_hw_intr *hw_intr;
  225. struct sde_irq irq_obj;
  226. int irq_num; /* mdss irq number */
  227. bool irq_enabled;
  228. struct sde_core_perf perf;
  229. /* saved atomic state during system suspend */
  230. struct drm_atomic_state *suspend_state;
  231. bool suspend_block;
  232. struct sde_rm rm;
  233. bool rm_init;
  234. struct sde_splash_data splash_data;
  235. struct sde_hw_vbif *hw_vbif[VBIF_MAX];
  236. struct sde_hw_mdp *hw_mdp;
  237. struct sde_hw_uidle *hw_uidle;
  238. struct sde_hw_sid *hw_sid;
  239. struct sde_hw_sw_fuse *hw_sw_fuse;
  240. int dsi_display_count;
  241. void **dsi_displays;
  242. int wb_display_count;
  243. void **wb_displays;
  244. int dp_display_count;
  245. void **dp_displays;
  246. int dp_stream_count;
  247. bool has_danger_ctrl;
  248. struct sde_kms_smmu_state_data smmu_state;
  249. atomic_t detach_sec_cb;
  250. atomic_t detach_all_cb;
  251. struct mutex secure_transition_lock;
  252. bool first_kickoff;
  253. bool qdss_enabled;
  254. };
  255. struct vsync_info {
  256. u32 frame_count;
  257. u32 line_count;
  258. };
  259. #define to_sde_kms(x) container_of(x, struct sde_kms, base)
  260. /**
  261. * sde_is_custom_client - whether or not to enable non-standard customizations
  262. *
  263. * Return: Whether or not the 'sdeclient' module parameter was set on boot up
  264. */
  265. bool sde_is_custom_client(void);
  266. /**
  267. * sde_kms_power_resource_is_enabled - whether or not power resource is enabled
  268. * @dev: Pointer to drm device
  269. * Return: true if power resource is enabled; false otherwise
  270. */
  271. static inline bool sde_kms_power_resource_is_enabled(struct drm_device *dev)
  272. {
  273. if (!dev)
  274. return false;
  275. return pm_runtime_enabled(dev->dev);
  276. }
  277. /**
  278. * sde_kms_is_suspend_state - whether or not the system is pm suspended
  279. * @dev: Pointer to drm device
  280. * Return: Suspend status
  281. */
  282. static inline bool sde_kms_is_suspend_state(struct drm_device *dev)
  283. {
  284. if (!ddev_to_msm_kms(dev))
  285. return false;
  286. return to_sde_kms(ddev_to_msm_kms(dev))->suspend_state != NULL;
  287. }
  288. /**
  289. * sde_kms_is_suspend_blocked - whether or not commits are blocked due to pm
  290. * suspend status
  291. * @dev: Pointer to drm device
  292. * Return: True if commits should be rejected due to pm suspend
  293. */
  294. static inline bool sde_kms_is_suspend_blocked(struct drm_device *dev)
  295. {
  296. if (!sde_kms_is_suspend_state(dev))
  297. return false;
  298. return to_sde_kms(ddev_to_msm_kms(dev))->suspend_block;
  299. }
  300. /**
  301. * sde_kms_is_secure_session_inprogress - to indicate if secure-session is in
  302. * currently in-progress based on the current smmu_state
  303. *
  304. * @sde_kms: Pointer to sde_kms
  305. *
  306. * return: true if secure-session is in progress; false otherwise
  307. */
  308. static inline bool sde_kms_is_secure_session_inprogress(struct sde_kms *sde_kms)
  309. {
  310. bool ret = false;
  311. if (!sde_kms)
  312. return false;
  313. mutex_lock(&sde_kms->secure_transition_lock);
  314. if (((sde_kms->catalog->sui_ns_allowed) &&
  315. (sde_kms->smmu_state.secure_level == SDE_DRM_SEC_ONLY) &&
  316. ((sde_kms->smmu_state.state == DETACHED_SEC) ||
  317. (sde_kms->smmu_state.state == DETACH_SEC_REQ) ||
  318. (sde_kms->smmu_state.state == ATTACH_SEC_REQ)))
  319. || (((sde_kms->smmu_state.state == DETACHED) ||
  320. (sde_kms->smmu_state.state == DETACH_ALL_REQ) ||
  321. (sde_kms->smmu_state.state == ATTACH_ALL_REQ))))
  322. ret = true;
  323. mutex_unlock(&sde_kms->secure_transition_lock);
  324. return ret;
  325. }
  326. /**
  327. * sde_kms_is_vbif_operation_allowed - resticts the VBIF programming
  328. * during secure-ui, if the sec_ui_misr feature is enabled
  329. *
  330. * @sde_kms: Pointer to sde_kms
  331. *
  332. * return: false if secure-session is in progress; true otherwise
  333. */
  334. static inline bool sde_kms_is_vbif_operation_allowed(struct sde_kms *sde_kms)
  335. {
  336. if (!sde_kms)
  337. return false;
  338. if (!sde_kms->catalog->sui_misr_supported)
  339. return true;
  340. return !sde_kms_is_secure_session_inprogress(sde_kms);
  341. }
  342. /**
  343. * sde_kms_is_cp_operation_allowed - resticts the CP programming
  344. * during secure-ui, if the non-secure context banks are detached
  345. *
  346. * @sde_kms: Pointer to sde_kms
  347. */
  348. static inline bool sde_kms_is_cp_operation_allowed(struct sde_kms *sde_kms)
  349. {
  350. if (!sde_kms || !sde_kms->catalog)
  351. return false;
  352. if (sde_kms->catalog->sui_ns_allowed)
  353. return true;
  354. return !sde_kms_is_secure_session_inprogress(sde_kms);
  355. }
  356. /**
  357. * Debugfs functions - extra helper functions for debugfs support
  358. *
  359. * Main debugfs documentation is located at,
  360. *
  361. * Documentation/filesystems/debugfs.txt
  362. *
  363. * @sde_debugfs_get_root: Get root dentry for SDE_KMS's debugfs node
  364. */
  365. /**
  366. * sde_debugfs_get_root - Return root directory entry for KMS's debugfs
  367. *
  368. * The return value should be passed as the 'parent' argument to subsequent
  369. * debugfs create calls.
  370. *
  371. * @sde_kms: Pointer to SDE's KMS structure
  372. *
  373. * Return: dentry pointer for SDE's debugfs location
  374. */
  375. void *sde_debugfs_get_root(struct sde_kms *sde_kms);
  376. /**
  377. * SDE info management functions
  378. * These functions/definitions allow for building up a 'sde_info' structure
  379. * containing one or more "key=value\n" entries.
  380. */
  381. #define SDE_KMS_INFO_MAX_SIZE 4096
  382. /**
  383. * struct sde_kms_info - connector information structure container
  384. * @data: Array of information character data
  385. * @len: Current length of information data
  386. * @staged_len: Temporary data buffer length, commit to
  387. * len using sde_kms_info_stop
  388. * @start: Whether or not a partial data entry was just started
  389. */
  390. struct sde_kms_info {
  391. char data[SDE_KMS_INFO_MAX_SIZE];
  392. uint32_t len;
  393. uint32_t staged_len;
  394. bool start;
  395. };
  396. /**
  397. * SDE_KMS_INFO_DATA - Macro for accessing sde_kms_info data bytes
  398. * @S: Pointer to sde_kms_info structure
  399. * Returns: Pointer to byte data
  400. */
  401. #define SDE_KMS_INFO_DATA(S) ((S) ? ((struct sde_kms_info *)(S))->data \
  402. : NULL)
  403. /**
  404. * SDE_KMS_INFO_DATALEN - Macro for accessing sde_kms_info data length
  405. * it adds an extra character length to count null.
  406. * @S: Pointer to sde_kms_info structure
  407. * Returns: Size of available byte data
  408. */
  409. #define SDE_KMS_INFO_DATALEN(S) ((S) ? ((struct sde_kms_info *)(S))->len + 1 \
  410. : 0)
  411. /**
  412. * sde_kms_info_reset - reset sde_kms_info structure
  413. * @info: Pointer to sde_kms_info structure
  414. */
  415. void sde_kms_info_reset(struct sde_kms_info *info);
  416. /**
  417. * sde_kms_info_add_keyint - add integer value to 'sde_kms_info'
  418. * @info: Pointer to sde_kms_info structure
  419. * @key: Pointer to key string
  420. * @value: Signed 64-bit integer value
  421. */
  422. void sde_kms_info_add_keyint(struct sde_kms_info *info,
  423. const char *key,
  424. int64_t value);
  425. /**
  426. * sde_kms_info_add_keystr - add string value to 'sde_kms_info'
  427. * @info: Pointer to sde_kms_info structure
  428. * @key: Pointer to key string
  429. * @value: Pointer to string value
  430. */
  431. void sde_kms_info_add_keystr(struct sde_kms_info *info,
  432. const char *key,
  433. const char *value);
  434. /**
  435. * sde_kms_info_start - begin adding key to 'sde_kms_info'
  436. * Usage:
  437. * sde_kms_info_start(key)
  438. * sde_kms_info_append(val_1)
  439. * ...
  440. * sde_kms_info_append(val_n)
  441. * sde_kms_info_stop
  442. * @info: Pointer to sde_kms_info structure
  443. * @key: Pointer to key string
  444. */
  445. void sde_kms_info_start(struct sde_kms_info *info,
  446. const char *key);
  447. /**
  448. * sde_kms_info_append - append value string to 'sde_kms_info'
  449. * Usage:
  450. * sde_kms_info_start(key)
  451. * sde_kms_info_append(val_1)
  452. * ...
  453. * sde_kms_info_append(val_n)
  454. * sde_kms_info_stop
  455. * @info: Pointer to sde_kms_info structure
  456. * @str: Pointer to partial value string
  457. */
  458. void sde_kms_info_append(struct sde_kms_info *info,
  459. const char *str);
  460. /**
  461. * sde_kms_info_append_format - append format code string to 'sde_kms_info'
  462. * Usage:
  463. * sde_kms_info_start(key)
  464. * sde_kms_info_append_format(fourcc, modifier)
  465. * ...
  466. * sde_kms_info_stop
  467. * @info: Pointer to sde_kms_info structure
  468. * @pixel_format: FOURCC format code
  469. * @modifier: 64-bit drm format modifier
  470. */
  471. void sde_kms_info_append_format(struct sde_kms_info *info,
  472. uint32_t pixel_format,
  473. uint64_t modifier);
  474. /**
  475. * sde_kms_info_stop - finish adding key to 'sde_kms_info'
  476. * Usage:
  477. * sde_kms_info_start(key)
  478. * sde_kms_info_append(val_1)
  479. * ...
  480. * sde_kms_info_append(val_n)
  481. * sde_kms_info_stop
  482. * @info: Pointer to sde_kms_info structure
  483. */
  484. void sde_kms_info_stop(struct sde_kms_info *info);
  485. /**
  486. * sde_kms_rect_intersect - intersect two rectangles
  487. * @r1: first rectangle
  488. * @r2: scissor rectangle
  489. * @result: result rectangle, all 0's on no intersection found
  490. */
  491. void sde_kms_rect_intersect(const struct sde_rect *r1,
  492. const struct sde_rect *r2,
  493. struct sde_rect *result);
  494. /**
  495. * sde_kms_rect_merge_rectangles - merge a rectangle list into one rect
  496. * @rois: pointer to the list of rois
  497. * @result: output rectangle, all 0 on error
  498. */
  499. void sde_kms_rect_merge_rectangles(const struct msm_roi_list *rois,
  500. struct sde_rect *result);
  501. /**
  502. * sde_kms_rect_is_equal - compares two rects
  503. * @r1: rect value to compare
  504. * @r2: rect value to compare
  505. *
  506. * Returns 1 if the rects are same, 0 otherwise.
  507. */
  508. static inline bool sde_kms_rect_is_equal(struct sde_rect *r1,
  509. struct sde_rect *r2)
  510. {
  511. if ((!r1 && r2) || (r1 && !r2))
  512. return false;
  513. if (!r1 && !r2)
  514. return true;
  515. return r1->x == r2->x && r1->y == r2->y && r1->w == r2->w &&
  516. r1->h == r2->h;
  517. }
  518. /**
  519. * sde_kms_rect_is_null - returns true if the width or height of a rect is 0
  520. * @rect: rectangle to check for zero size
  521. * @Return: True if width or height of rectangle is 0
  522. */
  523. static inline bool sde_kms_rect_is_null(const struct sde_rect *r)
  524. {
  525. if (!r)
  526. return true;
  527. return (!r->w || !r->h);
  528. }
  529. /**
  530. * Vblank enable/disable functions
  531. */
  532. int sde_enable_vblank(struct msm_kms *kms, struct drm_crtc *crtc);
  533. void sde_disable_vblank(struct msm_kms *kms, struct drm_crtc *crtc);
  534. /**
  535. * smmu attach/detach functions
  536. * @sde_kms: poiner to sde_kms structure
  537. * @secure_only: if true only secure contexts are attached/detached, else
  538. * all contexts are attached/detached/
  539. */
  540. int sde_kms_mmu_attach(struct sde_kms *sde_kms, bool secure_only);
  541. int sde_kms_mmu_detach(struct sde_kms *sde_kms, bool secure_only);
  542. /**
  543. * sde_kms_timeline_status - provides current timeline status
  544. * @dev: Pointer to drm device
  545. */
  546. void sde_kms_timeline_status(struct drm_device *dev);
  547. /**
  548. * sde_kms_handle_recovery - handler function for FIFO overflow issue
  549. * @encoder: pointer to drm encoder structure
  550. * return: 0 on success; error code otherwise
  551. */
  552. int sde_kms_handle_recovery(struct drm_encoder *encoder);
  553. #endif /* __sde_kms_H__ */