hubp.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. struct hubp {
  29. struct hubp_funcs *funcs;
  30. struct dc_context *ctx;
  31. struct dc_plane_address request_address;
  32. struct dc_plane_address current_address;
  33. int inst;
  34. /* run time states */
  35. int opp_id;
  36. int mpcc_id;
  37. struct dc_cursor_attributes curs_attr;
  38. bool power_gated;
  39. };
  40. struct hubp_funcs {
  41. void (*hubp_setup)(
  42. struct hubp *hubp,
  43. struct _vcs_dpi_display_dlg_regs_st *dlg_regs,
  44. struct _vcs_dpi_display_ttu_regs_st *ttu_regs,
  45. struct _vcs_dpi_display_rq_regs_st *rq_regs,
  46. struct _vcs_dpi_display_pipe_dest_params_st *pipe_dest);
  47. void (*dcc_control)(struct hubp *hubp, bool enable,
  48. bool independent_64b_blks);
  49. void (*mem_program_viewport)(
  50. struct hubp *hubp,
  51. const struct rect *viewport,
  52. const struct rect *viewport_c);
  53. bool (*hubp_program_surface_flip_and_addr)(
  54. struct hubp *hubp,
  55. const struct dc_plane_address *address,
  56. bool flip_immediate);
  57. void (*hubp_program_pte_vm)(
  58. struct hubp *hubp,
  59. enum surface_pixel_format format,
  60. union dc_tiling_info *tiling_info,
  61. enum dc_rotation_angle rotation);
  62. void (*hubp_set_vm_system_aperture_settings)(
  63. struct hubp *hubp,
  64. struct vm_system_aperture_param *apt);
  65. void (*hubp_set_vm_context0_settings)(
  66. struct hubp *hubp,
  67. const struct vm_context0_param *vm0);
  68. void (*hubp_program_surface_config)(
  69. struct hubp *hubp,
  70. enum surface_pixel_format format,
  71. union dc_tiling_info *tiling_info,
  72. union plane_size *plane_size,
  73. enum dc_rotation_angle rotation,
  74. struct dc_plane_dcc_param *dcc,
  75. bool horizontal_mirror);
  76. bool (*hubp_is_flip_pending)(struct hubp *hubp);
  77. void (*hubp_update_dchub)(struct hubp *hubp,
  78. struct dchub_init_data *dh_data);
  79. void (*set_blank)(struct hubp *hubp, bool blank);
  80. void (*set_hubp_blank_en)(struct hubp *hubp, bool blank);
  81. void (*set_cursor_attributes)(
  82. struct hubp *hubp,
  83. const struct dc_cursor_attributes *attr);
  84. void (*set_cursor_position)(
  85. struct hubp *hubp,
  86. const struct dc_cursor_position *pos,
  87. const struct dc_cursor_mi_param *param);
  88. void (*hubp_disconnect)(struct hubp *hubp);
  89. };
  90. #endif