1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright 2023 Advanced Micro Devices, Inc. 4 * 5 * Permission is hereby granted, free of charge, to any person obtaining a 6 * copy of this software and associated documentation files (the "Software"), 7 * to deal in the Software without restriction, including without limitation 8 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 * and/or sell copies of the Software, and to permit persons to whom the 10 * Software is furnished to do so, subject to the following conditions: 11 * 12 * The above copyright notice and this permission notice shall be included in 13 * all copies or substantial portions of the Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR 19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 21 * OTHER DEALINGS IN THE SOFTWARE. 22 * 23 * Authors: AMD 24 * 25 */ 26 27 #ifndef __DISPLAY_MODE_LIB_DEFINES_H__ 28 #define __DISPLAY_MODE_LIB_DEFINES_H__ 29 30 #define DCN_DML__DML_STANDALONE 1 31 #define DCN_DML__DML_STANDALONE__1 1 32 #define DCN_DML__PRESENT 1 33 #define DCN_DML__PRESENT__1 1 34 #define DCN_DML__NUM_PLANE 8 35 #define DCN_DML__NUM_PLANE__8 1 36 #define DCN_DML__NUM_CURSOR 1 37 #define DCN_DML__NUM_CURSOR__1 1 38 #define DCN_DML__NUM_PWR_STATE 30 39 #define DCN_DML__NUM_PWR_STATE__30 1 40 #define DCN_DML__VM_PRESENT 1 41 #define DCN_DML__VM_PRESENT__1 1 42 #define DCN_DML__HOST_VM_PRESENT 1 43 #define DCN_DML__HOST_VM_PRESENT__1 1 44 #define DCN_DML__DWB 1 45 46 #include "dml_depedencies.h" 47 48 #include "dml_logging.h" 49 #include "dml_assert.h" 50 51 // To enable a lot of debug msg 52 #define __DML_VBA_DEBUG__ 53 #define __DML_VBA_ENABLE_INLINE_CHECK_ 0 54 #define __DML_VBA_MIN_VSTARTUP__ 9 //<brief At which vstartup the DML start to try if the mode can be supported 55 #define __DML_ARB_TO_RET_DELAY__ 7 + 95 //<brief Delay in DCFCLK from ARB to DET (1st num is ARB to SDPIF, 2nd number is SDPIF to DET) 56 #define __DML_MIN_DCFCLK_FACTOR__ 1.15 //<brief fudge factor for min dcfclk calclation 57 #define __DML_MAX_VRATIO_PRE__ 4.0 //<brief Prefetch schedule max vratio 58 #define __DML_MAX_VRATIO_PRE_OTO__ 4.0 //<brief Prefetch schedule max vratio for one to one scheduling calculation for prefetch 59 #define __DML_MAX_VRATIO_PRE_ENHANCE_PREFETCH_ACC__ 6.0 //<brief Prefetch schedule max vratio when enhance prefetch schedule acceleration is enabled and vstartup is earliest possible already 60 #define __DML_NUM_PLANES__ DCN_DML__NUM_PLANE 61 #define __DML_NUM_CURSORS__ DCN_DML__NUM_CURSOR 62 #define __DML_DPP_INVALID__ 0 63 #define __DML_NUM_DMB__ DCN_DML__DWB 64 #define __DML_PIPE_NO_PLANE__ 99 65 66 #define __DML_MAX_STATE_ARRAY_SIZE__ DCN_DML__NUM_PWR_STATE 67 68 // Compilation define 69 #define __DML_DLL_EXPORT__ 70 71 typedef int dml_int_t; // int is 32-bit in C/C++, but Integer datatype is 16-bit in VBA. this should map to Long in VBA 72 typedef unsigned int dml_uint_t; 73 typedef double dml_float_t; 74 75 // Note: bool is 8-bit in C/C++, but Boolean is 16-bit in VBA, use "short" in C/C++ DLL so the struct work when vba uses DLL 76 // Or the VBA side don't use Boolean, just use "Byte", then C side can use bool 77 typedef bool dml_bool_t; 78 79 #endif 80