mtk_drm_arr.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef _MTK_DRM_ARR_H_
  2. #define _MTK_DRM_ARR_H_
  3. /*************************************************************************
  4. * mtk_dsi_lfr_con records LFR Related parameters belows:
  5. *
  6. *[ 1- 0] lfr_mode: Low frame rate mode 0:Disable
  7. *[ 3- 2] lfr_type: Low frame rate transmission type
  8. *[ 4- 4] lfr_enable: Enables low frame rate
  9. *[ 5- 5] lfr_update: Low frame rate update in dynamic mode
  10. *[ 6- 6] lfr_vse_dis: Disables low frame rate VSE
  11. *[ 8-13] lfr_skip_num: Low frame rate skip frame number
  12. *
  13. *--lfr_mode -- 0: Disable, 1:static mode, 2:Dynamic mode, 3:Both
  14. *--lfr_type -- 0: LP mode, 1: Vsync, 2: Hsync, 3: Vsync + Hsync
  15. *--lfr_enable -- 0: Disable, 1: Enable
  16. *--lfr_update -- 0: No effect, 1: Update frame
  17. *--lfr_vse_dis-- 0: Enable VSE packet, 1: Disable VSE packet
  18. *************************************************************************/
  19. enum LFR_MODE {
  20. LFR_MODE_DISABLE = 0,
  21. LFR_MODE_STATIC_MODE,
  22. LFR_MODE_DYNAMIC_MODE,
  23. LFR_MODE_BOTH_MODE,
  24. LFR_MODE_NUM
  25. };
  26. enum LFR_TYPE {
  27. LFR_TYPE_LP_MODE = 0,
  28. LFR_TYPE_VSYNC_ONLY,
  29. LFR_TYPE_HSYNC_ONLY,
  30. LFR_TYPE_BOTH_MODE,
  31. LFR_TYPE_NUM
  32. };
  33. struct mtk_dsi_lfr_con {
  34. unsigned int lfr_mode;
  35. unsigned int lfr_type;
  36. unsigned int lfr_enable;
  37. unsigned int lfr_update;
  38. unsigned int lfr_vse_dis;
  39. unsigned int lfr_skip_num;
  40. unsigned int lfr_mask;
  41. };
  42. /*************************************************************************
  43. * mtk_dsi_lfr_sta records LFR state and skip count:
  44. *
  45. *[ 5 - 0] lfr_skip_count: Low frame rate skip frame counter
  46. *[ 8 - 8] lfr_skip_sta: Low frame rate skip frame status
  47. *************************************************************************/
  48. struct mtk_dsi_lfr_sta {
  49. unsigned int lfr_skip_count;
  50. unsigned int lfr_skip_sta;
  51. };
  52. /*DISP_OPT_ARR_PHASE_1
  53. * register call back for fpsgo or other kernel modules
  54. * who want't to monitor frame rate changing
  55. */
  56. /*interface with fpsgo*/
  57. typedef void (*FPS_CHG_CALLBACK)(unsigned int new_fps);
  58. int drm_register_fps_chg_callback(
  59. FPS_CHG_CALLBACK fps_chg_cb);
  60. int drm_unregister_fps_chg_callback(
  61. FPS_CHG_CALLBACK fps_chg_cb);
  62. /*interface with primary_display*/
  63. void drm_invoke_fps_chg_callbacks(unsigned int new_fps);
  64. #endif