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