hubp.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Copyright 2012-15 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: AMD
  23. *
  24. */
  25. #ifndef __DAL_HUBP_H__
  26. #define __DAL_HUBP_H__
  27. #include "mem_input.h"
  28. enum cursor_pitch {
  29. CURSOR_PITCH_64_PIXELS = 0,
  30. CURSOR_PITCH_128_PIXELS,
  31. CURSOR_PITCH_256_PIXELS
  32. };
  33. enum cursor_lines_per_chunk {
  34. CURSOR_LINE_PER_CHUNK_2 = 1,
  35. CURSOR_LINE_PER_CHUNK_4,
  36. CURSOR_LINE_PER_CHUNK_8,
  37. CURSOR_LINE_PER_CHUNK_16
  38. };
  39. struct hubp {
  40. struct hubp_funcs *funcs;
  41. struct dc_context *ctx;
  42. struct dc_plane_address request_address;
  43. struct dc_plane_address current_address;
  44. int inst;
  45. /* run time states */
  46. int opp_id;
  47. int mpcc_id;
  48. struct dc_cursor_attributes curs_attr;
  49. bool power_gated;
  50. };
  51. struct hubp_funcs {
  52. void (*hubp_setup)(
  53. struct hubp *hubp,
  54. struct _vcs_dpi_display_dlg_regs_st *dlg_regs,
  55. struct _vcs_dpi_display_ttu_regs_st *ttu_regs,
  56. struct _vcs_dpi_display_rq_regs_st *rq_regs,
  57. struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest);
  58. void (*dcc_control)(struct hubp *hubp, bool enable,
  59. bool independent_64b_blks);
  60. void (*mem_program_viewport)(
  61. struct hubp *hubp,
  62. const struct rect *viewport,
  63. const struct rect *viewport_c);
  64. bool (*hubp_program_surface_flip_and_addr)(
  65. struct hubp *hubp,
  66. const struct dc_plane_address *address,
  67. bool flip_immediate);
  68. void (*hubp_program_pte_vm)(
  69. struct hubp *hubp,
  70. enum surface_pixel_format format,
  71. union dc_tiling_info *tiling_info,
  72. enum dc_rotation_angle rotation);
  73. void (*hubp_set_vm_system_aperture_settings)(
  74. struct hubp *hubp,
  75. struct vm_system_aperture_param *apt);
  76. void (*hubp_set_vm_context0_settings)(
  77. struct hubp *hubp,
  78. const struct vm_context0_param *vm0);
  79. void (*hubp_program_surface_config)(
  80. struct hubp *hubp,
  81. enum surface_pixel_format format,
  82. union dc_tiling_info *tiling_info,
  83. union plane_size *plane_size,
  84. enum dc_rotation_angle rotation,
  85. struct dc_plane_dcc_param *dcc,
  86. bool horizontal_mirror);
  87. bool (*hubp_is_flip_pending)(struct hubp *hubp);
  88. void (*hubp_update_dchub)(struct hubp *hubp,
  89. struct dchub_init_data *dh_data);
  90. void (*set_blank)(struct hubp *hubp, bool blank);
  91. void (*set_hubp_blank_en)(struct hubp *hubp, bool blank);
  92. void (*set_cursor_attributes)(
  93. struct hubp *hubp,
  94. const struct dc_cursor_attributes *attr);
  95. void (*set_cursor_position)(
  96. struct hubp *hubp,
  97. const struct dc_cursor_position *pos,
  98. const struct dc_cursor_mi_param *param);
  99. void (*hubp_disconnect)(struct hubp *hubp);
  100. void (*hubp_clk_cntl)(struct hubp *hubp, bool enable);
  101. void (*hubp_vtg_sel)(struct hubp *hubp, uint32_t otg_inst);
  102. void (*hubp_read_state)(struct hubp *hubp);
  103. void (*hubp_disable_control)(struct hubp *hubp, bool disable_hubp);
  104. unsigned int (*hubp_get_underflow_status)(struct hubp *hubp);
  105. };
  106. #endif