smi_common.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef __SMI_COMMON_H__
  2. #define __SMI_COMMON_H__
  3. #include <aee.h>
  4. #include "smi_configuration.h"
  5. #ifdef CONFIG_MTK_CMDQ
  6. #include "cmdq_core.h"
  7. #endif
  8. #define SMI_CLIENT_DISP 0
  9. #define SMI_CLIENT_WFD 1
  10. #define SMI_EVENT_DIRECT_LINK (0x1 << 0)
  11. #define SMI_EVENT_DECOUPLE (0x1 << 1)
  12. #define SMI_EVENT_OVL_CASCADE (0x1 << 2)
  13. #define SMI_EVENT_OVL1_EXTERNAL (0x1 << 3)
  14. #define SMIMSG(string, args...) pr_debug("[pid=%d]" string, current->tgid, ##args)
  15. #define SMIMSG2(string, args...) pr_debug(string, ##args)
  16. #ifdef CONFIG_MTK_CMDQ
  17. #define SMIMSG3(onoff, string, args...)\
  18. do {\
  19. if (onoff == 1)\
  20. cmdq_core_save_first_dump(string, ##args);\
  21. SMIMSG(string, ##args);\
  22. } while (0)
  23. #else
  24. #define SMIMSG3(string, args...) SMIMSG(string, ##args)
  25. #endif
  26. #define SMITMP(string, args...) pr_debug("[pid=%d]"string, current->tgid, ##args)
  27. #define SMIERR(string, args...) pr_debug("error: " string, ##args)
  28. #define smi_aee_print(string, args...)\
  29. do {\
  30. char smi_name[100];\
  31. snprintf(smi_name, 100, "[" SMI_LOG_TAG "]" string, ##args); \
  32. } while (0)
  33. /*
  34. #define SMIERR(string, args...)\
  35. do {\
  36. pr_debug("error: " string, ##args); \
  37. aee_kernel_warning(SMI_LOG_TAG, "error: "string, ##args); \
  38. } while (0)
  39. #define smi_aee_print(string, args...)\
  40. do {\
  41. char smi_name[100];\
  42. snprintf(smi_name, 100, "[" SMI_LOG_TAG "]" string, ##args); \
  43. aee_kernel_warning(smi_name, "["SMI_LOG_TAG"]error:"string, ##args); \
  44. } while (0)
  45. */
  46. /* Please use the function to instead gLarbBaseAddr to prevent the NULL pointer access error */
  47. /* when the corrosponding larb is not exist */
  48. /* extern unsigned int gLarbBaseAddr[SMI_LARB_NR]; */
  49. extern unsigned long get_larb_base_addr(int larb_id);
  50. /* extern char *smi_port_name[][21]; */
  51. /* for slow motion force 30 fps */
  52. extern int primary_display_force_set_vsync_fps(unsigned int fps);
  53. extern unsigned int primary_display_get_fps(void);
  54. extern void smi_client_status_change_notify(int module, int mode);
  55. extern void smi_dumpLarb(unsigned int index);
  56. extern void smi_dumpCommon(void);
  57. /* void register_base_dump(void); */
  58. extern struct SMI_PROFILE_CONFIG smi_profile_config[SMI_PROFILE_CONFIG_NUM];
  59. extern void smi_set_nonconstant_variable(void);
  60. extern void save_default_common_val(int *is_default_value_saved, unsigned int *default_val_smi_array);
  61. extern int smi_bus_regs_setting(int profile, struct SMI_SETTING *settings);
  62. #endif