mdp5_cfg.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright (c) 2014 The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef __MDP5_CFG_H__
  14. #define __MDP5_CFG_H__
  15. #include "msm_drv.h"
  16. /*
  17. * mdp5_cfg
  18. *
  19. * This module configures the dynamic offsets used by mdp5.xml.h
  20. * (initialized in mdp5_cfg.c)
  21. */
  22. extern const struct mdp5_cfg_hw *mdp5_cfg;
  23. #define MAX_CTL 8
  24. #define MAX_BASES 8
  25. #define MAX_SMP_BLOCKS 44
  26. #define MAX_CLIENTS 32
  27. typedef DECLARE_BITMAP(mdp5_smp_state_t, MAX_SMP_BLOCKS);
  28. #define MDP5_SUB_BLOCK_DEFINITION \
  29. int count; \
  30. uint32_t base[MAX_BASES]
  31. struct mdp5_sub_block {
  32. MDP5_SUB_BLOCK_DEFINITION;
  33. };
  34. struct mdp5_lm_block {
  35. MDP5_SUB_BLOCK_DEFINITION;
  36. uint32_t nb_stages; /* number of stages per blender */
  37. };
  38. struct mdp5_smp_block {
  39. int mmb_count; /* number of SMP MMBs */
  40. int mmb_size; /* MMB: size in bytes */
  41. mdp5_smp_state_t reserved_state;/* SMP MMBs statically allocated */
  42. int reserved[MAX_CLIENTS]; /* # of MMBs allocated per client */
  43. };
  44. struct mdp5_cfg_hw {
  45. char *name;
  46. struct mdp5_smp_block smp;
  47. struct mdp5_sub_block ctl;
  48. struct mdp5_sub_block pipe_vig;
  49. struct mdp5_sub_block pipe_rgb;
  50. struct mdp5_sub_block pipe_dma;
  51. struct mdp5_lm_block lm;
  52. struct mdp5_sub_block dspp;
  53. struct mdp5_sub_block ad;
  54. struct mdp5_sub_block intf;
  55. uint32_t max_clk;
  56. };
  57. /* platform config data (ie. from DT, or pdata) */
  58. struct mdp5_cfg_platform {
  59. struct iommu_domain *iommu;
  60. };
  61. struct mdp5_cfg {
  62. const struct mdp5_cfg_hw *hw;
  63. struct mdp5_cfg_platform platform;
  64. };
  65. struct mdp5_kms;
  66. struct mdp5_cfg_handler;
  67. const struct mdp5_cfg_hw *mdp5_cfg_get_hw_config(struct mdp5_cfg_handler *cfg_hnd);
  68. struct mdp5_cfg *mdp5_cfg_get_config(struct mdp5_cfg_handler *cfg_hnd);
  69. int mdp5_cfg_get_hw_rev(struct mdp5_cfg_handler *cfg_hnd);
  70. struct mdp5_cfg_handler *mdp5_cfg_init(struct mdp5_kms *mdp5_kms,
  71. uint32_t major, uint32_t minor);
  72. void mdp5_cfg_destroy(struct mdp5_cfg_handler *cfg_hnd);
  73. #endif /* __MDP5_CFG_H__ */