Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2017 Advanced Micro Devices, Inc.
0003  *
0004  * Permission is hereby granted, free of charge, to any person obtaining a
0005  * copy of this software and associated documentation files (the "Software"),
0006  * to deal in the Software without restriction, including without limitation
0007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
0008  * and/or sell copies of the Software, and to permit persons to whom the
0009  * Software is furnished to do so, subject to the following conditions:
0010  *
0011  * The above copyright notice and this permission notice shall be included in
0012  * all copies or substantial portions of the Software.
0013  *
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
0017  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
0018  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
0019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
0020  * OTHER DEALINGS IN THE SOFTWARE.
0021  *
0022  * Authors: AMD
0023  *
0024  */
0025 #ifndef __DISPLAY_MODE_LIB_H__
0026 #define __DISPLAY_MODE_LIB_H__
0027 
0028 #include "dm_services.h"
0029 #include "dc_features.h"
0030 #include "display_mode_structs.h"
0031 #include "display_mode_enums.h"
0032 #include "display_mode_vba.h"
0033 
0034 enum dml_project {
0035     DML_PROJECT_UNDEFINED,
0036     DML_PROJECT_RAVEN1,
0037     DML_PROJECT_NAVI10,
0038     DML_PROJECT_NAVI10v2,
0039     DML_PROJECT_DCN201,
0040     DML_PROJECT_DCN21,
0041     DML_PROJECT_DCN30,
0042     DML_PROJECT_DCN31,
0043     DML_PROJECT_DCN31_FPGA,
0044     DML_PROJECT_DCN314,
0045     DML_PROJECT_DCN32,
0046 };
0047 
0048 struct display_mode_lib;
0049 
0050 struct dml_funcs {
0051     void (*rq_dlg_get_dlg_reg)(
0052             struct display_mode_lib *mode_lib,
0053             display_dlg_regs_st *dlg_regs,
0054             display_ttu_regs_st *ttu_regs,
0055             const display_e2e_pipe_params_st *e2e_pipe_param,
0056             const unsigned int num_pipes,
0057             const unsigned int pipe_idx,
0058             const bool cstate_en,
0059             const bool pstate_en,
0060             const bool vm_en,
0061             const bool ignore_viewport_pos,
0062             const bool immediate_flip_support);
0063     void (*rq_dlg_get_rq_reg)(
0064         struct display_mode_lib *mode_lib,
0065         display_rq_regs_st *rq_regs,
0066         const display_pipe_params_st *pipe_param);
0067     // DLG interfaces have different function parameters in DCN32.
0068     // Create new function pointers to address the changes
0069     void (*rq_dlg_get_dlg_reg_v2)(
0070             struct display_mode_lib *mode_lib,
0071             display_dlg_regs_st *dlg_regs,
0072             display_ttu_regs_st *ttu_regs,
0073             display_e2e_pipe_params_st *e2e_pipe_param,
0074             const unsigned int num_pipes,
0075             const unsigned int pipe_idx);
0076     void (*rq_dlg_get_rq_reg_v2)(display_rq_regs_st *rq_regs,
0077             struct display_mode_lib *mode_lib,
0078             const display_e2e_pipe_params_st *e2e_pipe_param,
0079             const unsigned int num_pipes,
0080             const unsigned int pipe_idx);
0081     void (*recalculate)(struct display_mode_lib *mode_lib);
0082     void (*validate)(struct display_mode_lib *mode_lib);
0083 };
0084 
0085 struct display_mode_lib {
0086     struct _vcs_dpi_ip_params_st ip;
0087     struct _vcs_dpi_soc_bounding_box_st soc;
0088     enum dml_project project;
0089     struct vba_vars_st vba;
0090     struct dal_logger *logger;
0091     struct dml_funcs funcs;
0092     struct _vcs_dpi_display_e2e_pipe_params_st dml_pipe_state[6];
0093 };
0094 
0095 void dml_init_instance(struct display_mode_lib *lib,
0096         const struct _vcs_dpi_soc_bounding_box_st *soc_bb,
0097         const struct _vcs_dpi_ip_params_st *ip_params,
0098         enum dml_project project);
0099 
0100 const char *dml_get_status_message(enum dm_validation_status status);
0101 
0102 void dml_log_pipe_params(
0103         struct display_mode_lib *mode_lib,
0104         display_e2e_pipe_params_st *pipes,
0105         int pipe_cnt);
0106 
0107 void dml_log_mode_support_params(struct display_mode_lib *mode_lib);
0108 #endif