Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Copyright 2012-15 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 
0026 #include "dm_services.h"
0027 
0028 /*
0029  * Pre-requisites: headers required by header of this unit
0030  */
0031 #include "include/gpio_types.h"
0032 
0033 /*
0034  * Header of this unit
0035  */
0036 
0037 #include "hw_translate.h"
0038 
0039 /*
0040  * Post-requisites: headers required by this unit
0041  */
0042 
0043 #if defined(CONFIG_DRM_AMD_DC_SI)
0044 #include "dce60/hw_translate_dce60.h"
0045 #endif
0046 #include "dce80/hw_translate_dce80.h"
0047 #include "dce110/hw_translate_dce110.h"
0048 #include "dce120/hw_translate_dce120.h"
0049 #include "dcn10/hw_translate_dcn10.h"
0050 #include "dcn20/hw_translate_dcn20.h"
0051 #include "dcn21/hw_translate_dcn21.h"
0052 #include "dcn30/hw_translate_dcn30.h"
0053 #include "dcn315/hw_translate_dcn315.h"
0054 #include "dcn32/hw_translate_dcn32.h"
0055 
0056 /*
0057  * This unit
0058  */
0059 
0060 bool dal_hw_translate_init(
0061     struct hw_translate *translate,
0062     enum dce_version dce_version,
0063     enum dce_environment dce_environment)
0064 {
0065     switch (dce_version) {
0066 #if defined(CONFIG_DRM_AMD_DC_SI)
0067     case DCE_VERSION_6_0:
0068     case DCE_VERSION_6_1:
0069     case DCE_VERSION_6_4:
0070         dal_hw_translate_dce60_init(translate);
0071         return true;
0072 #endif
0073     case DCE_VERSION_8_0:
0074     case DCE_VERSION_8_1:
0075     case DCE_VERSION_8_3:
0076         dal_hw_translate_dce80_init(translate);
0077         return true;
0078     case DCE_VERSION_10_0:
0079     case DCE_VERSION_11_0:
0080     case DCE_VERSION_11_2:
0081     case DCE_VERSION_11_22:
0082         dal_hw_translate_dce110_init(translate);
0083         return true;
0084     case DCE_VERSION_12_0:
0085     case DCE_VERSION_12_1:
0086         dal_hw_translate_dce120_init(translate);
0087         return true;
0088     case DCN_VERSION_1_0:
0089     case DCN_VERSION_1_01:
0090         dal_hw_translate_dcn10_init(translate);
0091         return true;
0092     case DCN_VERSION_2_0:
0093         dal_hw_translate_dcn20_init(translate);
0094         return true;
0095     case DCN_VERSION_2_01:
0096     case DCN_VERSION_2_1:
0097         dal_hw_translate_dcn21_init(translate);
0098         return true;
0099     case DCN_VERSION_3_0:
0100     case DCN_VERSION_3_01:
0101     case DCN_VERSION_3_02:
0102     case DCN_VERSION_3_03:
0103     case DCN_VERSION_3_1:
0104     case DCN_VERSION_3_14:
0105     case DCN_VERSION_3_16:
0106         dal_hw_translate_dcn30_init(translate);
0107         return true;
0108     case DCN_VERSION_3_15:
0109         dal_hw_translate_dcn315_init(translate);
0110         return true;
0111     case DCN_VERSION_3_2:
0112     case DCN_VERSION_3_21:
0113         dal_hw_translate_dcn32_init(translate);
0114         return true;
0115     default:
0116         BREAK_TO_DEBUGGER();
0117         return false;
0118     }
0119 }