Initial commit: Linux kernel 4.19 for Unplugged OS

This commit is contained in:
ziv committed 2025-10-06 13:52:42 +00:00
commit d30235b04c
80519 files changed
+35800681

No files matched your search

@@ -0,0 +1,50 @@
#
# Copyright 2017 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
#
# Makefile for the 'utils' sub-component of DAL.
# It provides the general basic services required by other DAL
# subcomponents.
ifneq ($(call cc-option, -mpreferred-stack-boundary=4),)
cc_stack_align := -mpreferred-stack-boundary=4
else ifneq ($(call cc-option, -mstack-alignment=16),)
cc_stack_align := -mstack-alignment=16
endif
dml_ccflags := -mhard-float -msse $(cc_stack_align)
ifdef CONFIG_CC_IS_CLANG
dml_ccflags += -msse2
endif
CFLAGS_display_mode_lib.o := $(dml_ccflags)
CFLAGS_display_pipe_clocks.o := $(dml_ccflags)
CFLAGS_dml1_display_rq_dlg_calc.o := $(dml_ccflags)
CFLAGS_display_rq_dlg_helpers.o := $(dml_ccflags)
CFLAGS_dml_common_defs.o := $(dml_ccflags)
DML = display_mode_lib.o display_rq_dlg_helpers.o dml1_display_rq_dlg_calc.o \
dml_common_defs.o
AMD_DAL_DML = $(addprefix $(AMDDALPATH)/dc/dml/,$(DML))
AMD_DISPLAY_FILES += $(AMD_DAL_DML)
@@ -0,0 +1,559 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DC_FEATURES_H__
#define __DC_FEATURES_H__
// local features
#define DC__PRESENT 1
#define DC__PRESENT__1 1
#define DC__NUM_DPP 4
#define DC__VOLTAGE_STATES 7
#define DC__NUM_DPP__4 1
#define DC__NUM_DPP__0_PRESENT 1
#define DC__NUM_DPP__1_PRESENT 1
#define DC__NUM_DPP__2_PRESENT 1
#define DC__NUM_DPP__3_PRESENT 1
#define DC__NUM_DPP__MAX 8
#define DC__NUM_DPP__MAX__8 1
#define DC__PIPE_10BIT 0
#define DC__PIPE_10BIT__0 1
#define DC__PIPE_10BIT__MAX 1
#define DC__PIPE_10BIT__MAX__1 1
#define DC__NUM_OPP 4
#define DC__NUM_OPP__4 1
#define DC__NUM_OPP__0_PRESENT 1
#define DC__NUM_OPP__1_PRESENT 1
#define DC__NUM_OPP__2_PRESENT 1
#define DC__NUM_OPP__3_PRESENT 1
#define DC__NUM_OPP__MAX 6
#define DC__NUM_OPP__MAX__6 1
#define DC__NUM_DSC 0
#define DC__NUM_DSC__0 1
#define DC__NUM_DSC__MAX 6
#define DC__NUM_DSC__MAX__6 1
#define DC__NUM_ABM 1
#define DC__NUM_ABM__1 1
#define DC__NUM_ABM__0_PRESENT 1
#define DC__NUM_ABM__MAX 2
#define DC__NUM_ABM__MAX__2 1
#define DC__ODM_PRESENT 0
#define DC__ODM_PRESENT__0 1
#define DC__NUM_OTG 4
#define DC__NUM_OTG__4 1
#define DC__NUM_OTG__0_PRESENT 1
#define DC__NUM_OTG__1_PRESENT 1
#define DC__NUM_OTG__2_PRESENT 1
#define DC__NUM_OTG__3_PRESENT 1
#define DC__NUM_OTG__MAX 6
#define DC__NUM_OTG__MAX__6 1
#define DC__NUM_DWB 2
#define DC__NUM_DWB__2 1
#define DC__NUM_DWB__0_PRESENT 1
#define DC__NUM_DWB__1_PRESENT 1
#define DC__NUM_DWB__MAX 2
#define DC__NUM_DWB__MAX__2 1
#define DC__NUM_DIG 4
#define DC__NUM_DIG__4 1
#define DC__NUM_DIG__0_PRESENT 1
#define DC__NUM_DIG__1_PRESENT 1
#define DC__NUM_DIG__2_PRESENT 1
#define DC__NUM_DIG__3_PRESENT 1
#define DC__NUM_DIG__MAX 6
#define DC__NUM_DIG__MAX__6 1
#define DC__NUM_AUX 4
#define DC__NUM_AUX__4 1
#define DC__NUM_AUX__0_PRESENT 1
#define DC__NUM_AUX__1_PRESENT 1
#define DC__NUM_AUX__2_PRESENT 1
#define DC__NUM_AUX__3_PRESENT 1
#define DC__NUM_AUX__MAX 6
#define DC__NUM_AUX__MAX__6 1
#define DC__NUM_AUDIO_STREAMS 4
#define DC__NUM_AUDIO_STREAMS__4 1
#define DC__NUM_AUDIO_STREAMS__0_PRESENT 1
#define DC__NUM_AUDIO_STREAMS__1_PRESENT 1
#define DC__NUM_AUDIO_STREAMS__2_PRESENT 1
#define DC__NUM_AUDIO_STREAMS__3_PRESENT 1
#define DC__NUM_AUDIO_STREAMS__MAX 8
#define DC__NUM_AUDIO_STREAMS__MAX__8 1
#define DC__NUM_AUDIO_ENDPOINTS 6
#define DC__NUM_AUDIO_ENDPOINTS__6 1
#define DC__NUM_AUDIO_ENDPOINTS__0_PRESENT 1
#define DC__NUM_AUDIO_ENDPOINTS__1_PRESENT 1
#define DC__NUM_AUDIO_ENDPOINTS__2_PRESENT 1
#define DC__NUM_AUDIO_ENDPOINTS__3_PRESENT 1
#define DC__NUM_AUDIO_ENDPOINTS__4_PRESENT 1
#define DC__NUM_AUDIO_ENDPOINTS__5_PRESENT 1
#define DC__NUM_AUDIO_ENDPOINTS__MAX 8
#define DC__NUM_AUDIO_ENDPOINTS__MAX__8 1
#define DC__NUM_AUDIO_INPUT_STREAMS 0
#define DC__NUM_AUDIO_INPUT_STREAMS__0 1
#define DC__NUM_AUDIO_INPUT_STREAMS__MAX 8
#define DC__NUM_AUDIO_INPUT_STREAMS__MAX__8 1
#define DC__NUM_AUDIO_INPUT_ENDPOINTS 0
#define DC__NUM_AUDIO_INPUT_ENDPOINTS__0 1
#define DC__NUM_AUDIO_INPUT_ENDPOINTS__MAX 8
#define DC__NUM_AUDIO_INPUT_ENDPOINTS__MAX__8 1
#define DC__NUM_CURSOR 1
#define DC__NUM_CURSOR__1 1
#define DC__NUM_CURSOR__0_PRESENT 1
#define DC__NUM_CURSOR__MAX 2
#define DC__NUM_CURSOR__MAX__2 1
#define DC__DIGITAL_BYPASS_PRESENT 0
#define DC__DIGITAL_BYPASS_PRESENT__0 1
#define DC__HCID_HWMAJVER 1
#define DC__HCID_HWMAJVER__1 1
#define DC__HCID_HWMINVER 0
#define DC__HCID_HWMINVER__0 1
#define DC__HCID_HWREV 0
#define DC__HCID_HWREV__0 1
#define DC__ROMSTRAP_PRESENT 0
#define DC__ROMSTRAP_PRESENT__0 1
#define DC__NUM_RBBMIF_DECODES 30
#define DC__NUM_RBBMIF_DECODES__30 1
#define DC__NUM_DBG_REGS 36
#define DC__NUM_DBG_REGS__36 1
#define DC__NUM_PIPES_UNDERLAY 0
#define DC__NUM_PIPES_UNDERLAY__0 1
#define DC__NUM_PIPES_UNDERLAY__MAX 2
#define DC__NUM_PIPES_UNDERLAY__MAX__2 1
#define DC__NUM_VCE_ENGINE 1
#define DC__NUM_VCE_ENGINE__1 1
#define DC__NUM_VCE_ENGINE__0_PRESENT 1
#define DC__NUM_VCE_ENGINE__MAX 2
#define DC__NUM_VCE_ENGINE__MAX__2 1
#define DC__OTG_EXTERNAL_SYNC_PRESENT 0
#define DC__OTG_EXTERNAL_SYNC_PRESENT__0 1
#define DC__OTG_CRC_PRESENT 1
#define DC__OTG_CRC_PRESENT__1 1
#define DC__VIP_PRESENT 0
#define DC__VIP_PRESENT__0 1
#define DC__DTMTEST_PRESENT 0
#define DC__DTMTEST_PRESENT__0 1
#define DC__POWER_GATE_PRESENT 1
#define DC__POWER_GATE_PRESENT__1 1
#define DC__MEM_PG 1
#define DC__MEM_PG__1 1
#define DC__FMT_SRC_SEL_PRESENT 0
#define DC__FMT_SRC_SEL_PRESENT__0 1
#define DC__DIG_FEATURES__HDMI_PRESENT 1
#define DC__DIG_FEATURES__HDMI_PRESENT__1 1
#define DC__DIG_FEATURES__DP_PRESENT 1
#define DC__DIG_FEATURES__DP_PRESENT__1 1
#define DC__DIG_FEATURES__DP_MST_PRESENT 1
#define DC__DIG_FEATURES__DP_MST_PRESENT__1 1
#define DC__DIG_LP_FEATURES__HDMI_PRESENT 0
#define DC__DIG_LP_FEATURES__HDMI_PRESENT__0 1
#define DC__DIG_LP_FEATURES__DP_PRESENT 1
#define DC__DIG_LP_FEATURES__DP_PRESENT__1 1
#define DC__DIG_LP_FEATURES__DP_MST_PRESENT 0
#define DC__DIG_LP_FEATURES__DP_MST_PRESENT__0 1
#define DC__DIG_RESYNC_FIFO_SIZE 14
#define DC__DIG_RESYNC_FIFO_SIZE__14 1
#define DC__DIG_RESYNC_FIFO_SIZE__0_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__1_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__2_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__3_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__4_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__5_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__6_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__7_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__8_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__9_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__10_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__11_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__12_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__13_PRESENT 1
#define DC__DIG_RESYNC_FIFO_SIZE__MAX 16
#define DC__DIG_RESYNC_FIFO_SIZE__MAX__16 1
#define DC__DAC_RESYNC_FIFO_SIZE 12
#define DC__DAC_RESYNC_FIFO_SIZE__12 1
#define DC__DAC_RESYNC_FIFO_SIZE__0_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__1_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__2_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__3_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__4_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__5_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__6_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__7_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__8_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__9_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__10_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__11_PRESENT 1
#define DC__DAC_RESYNC_FIFO_SIZE__MAX 16
#define DC__DAC_RESYNC_FIFO_SIZE__MAX__16 1
#define DC__DVO_RESYNC_FIFO_SIZE 12
#define DC__DVO_RESYNC_FIFO_SIZE__12 1
#define DC__DVO_RESYNC_FIFO_SIZE__0_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__1_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__2_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__3_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__4_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__5_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__6_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__7_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__8_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__9_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__10_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__11_PRESENT 1
#define DC__DVO_RESYNC_FIFO_SIZE__MAX 16
#define DC__DVO_RESYNC_FIFO_SIZE__MAX__16 1
#define DC__MEM_CDC_PRESENT 1
#define DC__MEM_CDC_PRESENT__1 1
#define DC__NUM_HPD 4
#define DC__NUM_HPD__4 1
#define DC__NUM_HPD__0_PRESENT 1
#define DC__NUM_HPD__1_PRESENT 1
#define DC__NUM_HPD__2_PRESENT 1
#define DC__NUM_HPD__3_PRESENT 1
#define DC__NUM_HPD__MAX 6
#define DC__NUM_HPD__MAX__6 1
#define DC__NUM_DDC_PAIRS 4
#define DC__NUM_DDC_PAIRS__4 1
#define DC__NUM_DDC_PAIRS__0_PRESENT 1
#define DC__NUM_DDC_PAIRS__1_PRESENT 1
#define DC__NUM_DDC_PAIRS__2_PRESENT 1
#define DC__NUM_DDC_PAIRS__3_PRESENT 1
#define DC__NUM_DDC_PAIRS__MAX 6
#define DC__NUM_DDC_PAIRS__MAX__6 1
#define DC__NUM_AUDIO_PLL 0
#define DC__NUM_AUDIO_PLL__0 1
#define DC__NUM_AUDIO_PLL__MAX 2
#define DC__NUM_AUDIO_PLL__MAX__2 1
#define DC__NUM_PIXEL_PLL 1
#define DC__NUM_PIXEL_PLL__1 1
#define DC__NUM_PIXEL_PLL__0_PRESENT 1
#define DC__NUM_PIXEL_PLL__MAX 4
#define DC__NUM_PIXEL_PLL__MAX__4 1
#define DC__NUM_CASCADED_PLL 0
#define DC__NUM_CASCADED_PLL__0 1
#define DC__NUM_CASCADED_PLL__MAX 3
#define DC__NUM_CASCADED_PLL__MAX__3 1
#define DC__PIXCLK_FROM_PHYPLL 1
#define DC__PIXCLK_FROM_PHYPLL__1 1
#define DC__NB_STUTTER_MODE_PRESENT 0
#define DC__NB_STUTTER_MODE_PRESENT__0 1
#define DC__I2S0_AND_SPDIF0_PRESENT 0
#define DC__I2S0_AND_SPDIF0_PRESENT__0 1
#define DC__I2S1_PRESENT 0
#define DC__I2S1_PRESENT__0 1
#define DC__SPDIF1_PRESENT 0
#define DC__SPDIF1_PRESENT__0 1
#define DC__DSI_PRESENT 0
#define DC__DSI_PRESENT__0 1
#define DC__DACA_PRESENT 0
#define DC__DACA_PRESENT__0 1
#define DC__DACB_PRESENT 0
#define DC__DACB_PRESENT__0 1
#define DC__NUM_PIPES 4
#define DC__NUM_PIPES__4 1
#define DC__NUM_PIPES__0_PRESENT 1
#define DC__NUM_PIPES__1_PRESENT 1
#define DC__NUM_PIPES__2_PRESENT 1
#define DC__NUM_PIPES__3_PRESENT 1
#define DC__NUM_PIPES__MAX 6
#define DC__NUM_PIPES__MAX__6 1
#define DC__NUM_DIG_LP 0
#define DC__NUM_DIG_LP__0 1
#define DC__NUM_DIG_LP__MAX 2
#define DC__NUM_DIG_LP__MAX__2 1
#define DC__DPDEBUG_PRESENT 0
#define DC__DPDEBUG_PRESENT__0 1
#define DC__DISPLAY_WB_PRESENT 1
#define DC__DISPLAY_WB_PRESENT__1 1
#define DC__NUM_CWB 0
#define DC__NUM_CWB__0 1
#define DC__NUM_CWB__MAX 2
#define DC__NUM_CWB__MAX__2 1
#define DC__MVP_PRESENT 0
#define DC__MVP_PRESENT__0 1
#define DC__DVO_PRESENT 0
#define DC__DVO_PRESENT__0 1
#define DC__ABM_PRESENT 0
#define DC__ABM_PRESENT__0 1
#define DC__BPHYC_PLL_PRESENT 0
#define DC__BPHYC_PLL_PRESENT__0 1
#define DC__BPHYC_UNIPHY_PRESENT 0
#define DC__BPHYC_UNIPHY_PRESENT__0 1
#define DC__PHY_BROADCAST_PRESENT 0
#define DC__PHY_BROADCAST_PRESENT__0 1
#define DC__NUM_OF_DCRX_SD 0
#define DC__NUM_OF_DCRX_SD__0 1
#define DC__DVO_17BIT_MAPPING 0
#define DC__DVO_17BIT_MAPPING__0 1
#define DC__AVSYNC_PRESENT 0
#define DC__AVSYNC_PRESENT__0 1
#define DC__NUM_OF_DCRX_PORTS 0
#define DC__NUM_OF_DCRX_PORTS__0 1
#define DC__NUM_OF_DCRX_PORTS__MAX 1
#define DC__NUM_OF_DCRX_PORTS__MAX__1 1
#define DC__NUM_PHY 4
#define DC__NUM_PHY__4 1
#define DC__NUM_PHY__0_PRESENT 1
#define DC__NUM_PHY__1_PRESENT 1
#define DC__NUM_PHY__2_PRESENT 1
#define DC__NUM_PHY__3_PRESENT 1
#define DC__NUM_PHY__MAX 7
#define DC__NUM_PHY__MAX__7 1
#define DC__NUM_PHY_LP 0
#define DC__NUM_PHY_LP__0 1
#define DC__NUM_PHY_LP__MAX 2
#define DC__NUM_PHY_LP__MAX__2 1
#define DC__SYNC_CELL vid_sync_gf14lpp
#define DC__SYNC_CELL__VID_SYNC_GF14LPP 1
#define DC__USE_NEW_VSS 1
#define DC__USE_NEW_VSS__1 1
#define DC__SYNC_CELL_DISPCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_DISPCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_DVOCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_DVOCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_PIXCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_PIXCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_SYMCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_SYMCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_DPPCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_DPPCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_DPREFCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_DPREFCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_REFCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_REFCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_PCIE_REFCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_PCIE_REFCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_MVPCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_MVPCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_SCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_SCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_DCEFCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_DCEFCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_AMCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_AMCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_DSICLK_NUM_LATCHES 6
#define DC__SYNC_CELL_DSICLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_BYTECLK_NUM_LATCHES 6
#define DC__SYNC_CELL_BYTECLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_ESCCLK_NUM_LATCHES 6
#define DC__SYNC_CELL_ESCCLK_NUM_LATCHES__6 1
#define DC__SYNC_CELL_DB_CLK_NUM_LATCHES 6
#define DC__SYNC_CELL_DB_CLK_NUM_LATCHES__6 1
#define UNIPHYA_PRESENT 1
#define UNIPHYA_PRESENT__1 1
#define DC__UNIPHYA_PRESENT 1
#define DC__UNIPHYA_PRESENT__1 1
#define UNIPHYB_PRESENT 1
#define UNIPHYB_PRESENT__1 1
#define DC__UNIPHYB_PRESENT 1
#define DC__UNIPHYB_PRESENT__1 1
#define UNIPHYC_PRESENT 1
#define UNIPHYC_PRESENT__1 1
#define DC__UNIPHYC_PRESENT 1
#define DC__UNIPHYC_PRESENT__1 1
#define UNIPHYD_PRESENT 1
#define UNIPHYD_PRESENT__1 1
#define DC__UNIPHYD_PRESENT 1
#define DC__UNIPHYD_PRESENT__1 1
#define UNIPHYE_PRESENT 0
#define UNIPHYE_PRESENT__0 1
#define DC__UNIPHYE_PRESENT 0
#define DC__UNIPHYE_PRESENT__0 1
#define UNIPHYF_PRESENT 0
#define UNIPHYF_PRESENT__0 1
#define DC__UNIPHYF_PRESENT 0
#define DC__UNIPHYF_PRESENT__0 1
#define UNIPHYG_PRESENT 0
#define UNIPHYG_PRESENT__0 1
#define DC__UNIPHYG_PRESENT 0
#define DC__UNIPHYG_PRESENT__0 1
#define DC__TMDS_LINK tmds_link_dual
#define DC__TMDS_LINK__TMDS_LINK_DUAL 1
#define DC__WBSCL_PIXBW 8
#define DC__WBSCL_PIXBW__8 1
#define DC__DWB_CSC_PRESENT 0
#define DC__DWB_CSC_PRESENT__0 1
#define DC__DWB_LUMA_SCL_PRESENT 0
#define DC__DWB_LUMA_SCL_PRESENT__0 1
#define DC__DENTIST_INTERFACE_PRESENT 1
#define DC__DENTIST_INTERFACE_PRESENT__1 1
#define DC__GENERICA_PRESENT 1
#define DC__GENERICA_PRESENT__1 1
#define DC__GENERICB_PRESENT 1
#define DC__GENERICB_PRESENT__1 1
#define DC__GENERICC_PRESENT 0
#define DC__GENERICC_PRESENT__0 1
#define DC__GENERICD_PRESENT 0
#define DC__GENERICD_PRESENT__0 1
#define DC__GENERICE_PRESENT 0
#define DC__GENERICE_PRESENT__0 1
#define DC__GENERICF_PRESENT 0
#define DC__GENERICF_PRESENT__0 1
#define DC__GENERICG_PRESENT 0
#define DC__GENERICG_PRESENT__0 1
#define DC__UNIPHY_VOLTAGE_MODE 1
#define DC__UNIPHY_VOLTAGE_MODE__1 1
#define DC__BLON_TYPE dedicated
#define DC__BLON_TYPE__DEDICATED 1
#define DC__UNIPHY_STAGGER_CH_PRESENT 1
#define DC__UNIPHY_STAGGER_CH_PRESENT__1 1
#define DC__XDMA_PRESENT 0
#define DC__XDMA_PRESENT__0 1
#define XDMA__PRESENT 0
#define XDMA__PRESENT__0 1
#define DC__DP_MEM_PG 0
#define DC__DP_MEM_PG__0 1
#define DP__MEM_PG 0
#define DP__MEM_PG__0 1
#define DC__AFMT_MEM_PG 0
#define DC__AFMT_MEM_PG__0 1
#define AFMT__MEM_PG 0
#define AFMT__MEM_PG__0 1
#define DC__HDMI_MEM_PG 0
#define DC__HDMI_MEM_PG__0 1
#define HDMI__MEM_PG 0
#define HDMI__MEM_PG__0 1
#define DC__I2C_MEM_PG 0
#define DC__I2C_MEM_PG__0 1
#define I2C__MEM_PG 0
#define I2C__MEM_PG__0 1
#define DC__DSCL_MEM_PG 0
#define DC__DSCL_MEM_PG__0 1
#define DSCL__MEM_PG 0
#define DSCL__MEM_PG__0 1
#define DC__CM_MEM_PG 0
#define DC__CM_MEM_PG__0 1
#define CM__MEM_PG 0
#define CM__MEM_PG__0 1
#define DC__OBUF_MEM_PG 0
#define DC__OBUF_MEM_PG__0 1
#define OBUF__MEM_PG 0
#define OBUF__MEM_PG__0 1
#define DC__WBIF_MEM_PG 1
#define DC__WBIF_MEM_PG__1 1
#define WBIF__MEM_PG 1
#define WBIF__MEM_PG__1 1
#define DC__VGA_MEM_PG 0
#define DC__VGA_MEM_PG__0 1
#define VGA__MEM_PG 0
#define VGA__MEM_PG__0 1
#define DC__FMT_MEM_PG 0
#define DC__FMT_MEM_PG__0 1
#define FMT__MEM_PG 0
#define FMT__MEM_PG__0 1
#define DC__ODM_MEM_PG 0
#define DC__ODM_MEM_PG__0 1
#define ODM__MEM_PG 0
#define ODM__MEM_PG__0 1
#define DC__DSI_MEM_PG 0
#define DC__DSI_MEM_PG__0 1
#define DSI__MEM_PG 0
#define DSI__MEM_PG__0 1
#define DC__AZ_MEM_PG 1
#define DC__AZ_MEM_PG__1 1
#define AZ__MEM_PG 1
#define AZ__MEM_PG__1 1
#define DC__WBSCL_MEM1P1024X64QS_MEM_PG 1
#define DC__WBSCL_MEM1P1024X64QS_MEM_PG__1 1
#define WBSCL_MEM1P1024X64QS__MEM_PG 1
#define WBSCL_MEM1P1024X64QS__MEM_PG__1 1
#define DC__WBSCL_MEM1P528X64QS_MEM_PG 1
#define DC__WBSCL_MEM1P528X64QS_MEM_PG__1 1
#define WBSCL_MEM1P528X64QS__MEM_PG 1
#define WBSCL_MEM1P528X64QS__MEM_PG__1 1
#define DC__DMCU_MEM1P1024X32BQS_MEM_PG 1
#define DC__DMCU_MEM1P1024X32BQS_MEM_PG__1 1
#define DMCU_MEM1P1024X32BQS__MEM_PG 1
#define DMCU_MEM1P1024X32BQS__MEM_PG__1 1
#define DC__HUBBUB_SDP_TAG_INT_MEM_PG 0
#define DC__HUBBUB_SDP_TAG_INT_MEM_PG__0 1
#define HUBBUB_SDP_TAG_INT__MEM_PG 0
#define HUBBUB_SDP_TAG_INT__MEM_PG__0 1
#define DC__HUBBUB_SDP_TAG_EXT_MEM_PG 0
#define DC__HUBBUB_SDP_TAG_EXT_MEM_PG__0 1
#define HUBBUB_SDP_TAG_EXT__MEM_PG 0
#define HUBBUB_SDP_TAG_EXT__MEM_PG__0 1
#define DC__HUBBUB_RET_ZERO_MEM_PG 0
#define DC__HUBBUB_RET_ZERO_MEM_PG__0 1
#define HUBBUB_RET_ZERO__MEM_PG 0
#define HUBBUB_RET_ZERO__MEM_PG__0 1
#define DC__HUBBUB_RET_ROB_MEM_PG 0
#define DC__HUBBUB_RET_ROB_MEM_PG__0 1
#define HUBBUB_RET_ROB__MEM_PG 0
#define HUBBUB_RET_ROB__MEM_PG__0 1
#define DC__HUBPRET_CUR_ROB_MEM_PG 0
#define DC__HUBPRET_CUR_ROB_MEM_PG__0 1
#define HUBPRET_CUR_ROB__MEM_PG 0
#define HUBPRET_CUR_ROB__MEM_PG__0 1
#define DC__HUBPRET_CUR_CDC_MEM_PG 0
#define DC__HUBPRET_CUR_CDC_MEM_PG__0 1
#define HUBPRET_CUR_CDC__MEM_PG 0
#define HUBPRET_CUR_CDC__MEM_PG__0 1
#define DC__HUBPREQ_MPTE_MEM_PG 0
#define DC__HUBPREQ_MPTE_MEM_PG__0 1
#define HUBPREQ_MPTE__MEM_PG 0
#define HUBPREQ_MPTE__MEM_PG__0 1
#define DC__HUBPREQ_META_MEM_PG 0
#define DC__HUBPREQ_META_MEM_PG__0 1
#define HUBPREQ_META__MEM_PG 0
#define HUBPREQ_META__MEM_PG__0 1
#define DC__HUBPREQ_DPTE_MEM_PG 0
#define DC__HUBPREQ_DPTE_MEM_PG__0 1
#define HUBPREQ_DPTE__MEM_PG 0
#define HUBPREQ_DPTE__MEM_PG__0 1
#define DC__HUBPRET_DET_MEM_PG 0
#define DC__HUBPRET_DET_MEM_PG__0 1
#define HUBPRET_DET__MEM_PG 0
#define HUBPRET_DET__MEM_PG__0 1
#define DC__HUBPRET_PIX_CDC_MEM_PG 0
#define DC__HUBPRET_PIX_CDC_MEM_PG__0 1
#define HUBPRET_PIX_CDC__MEM_PG 0
#define HUBPRET_PIX_CDC__MEM_PG__0 1
#define DC__TOP_BLKS__DCCG 1
#define DC__TOP_BLKS__DCHUBBUB 1
#define DC__TOP_BLKS__DCHUBP 1
#define DC__TOP_BLKS__HDA 1
#define DC__TOP_BLKS__DIO 1
#define DC__TOP_BLKS__DCIO 1
#define DC__TOP_BLKS__DMU 1
#define DC__TOP_BLKS__DPP 1
#define DC__TOP_BLKS__MPC 1
#define DC__TOP_BLKS__OPP 1
#define DC__TOP_BLKS__OPTC 1
#define DC__TOP_BLKS__MMHUBBUB 1
#define DC__TOP_BLKS__WB 1
#define DC__TOP_BLKS__MAX 13
#define DC__TOP_BLKS__MAX__13 1
#define DC__DCHUBP_DPP_SF_PIXEL_CREDITS 9
#define DC__DCHUBP_DPP_SF_PIXEL_CREDITS__9 1
#define DC__DPP_MPC_SF_PIXEL_CREDITS 9
#define DC__DPP_MPC_SF_PIXEL_CREDITS__9 1
#define DC__MPC_OPP_SF_PIXEL_CREDITS 8
#define DC__MPC_OPP_SF_PIXEL_CREDITS__8 1
#define DC__OPP_OPTC_SF_PIXEL_CREDITS 8
#define DC__OPP_OPTC_SF_PIXEL_CREDITS__8 1
#define DC__SFR_SFT_ROUND_TRIP_DELAY 5
#define DC__SFR_SFT_ROUND_TRIP_DELAY__5 1
#define DC__REPEATER_PROJECT_MAX 8
#define DC__REPEATER_PROJECT_MAX__8 1
#define DC__SURFACE_422_CAPABLE 0
#define DC__SURFACE_422_CAPABLE__0 1
#endif
@@ -0,0 +1,124 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DISPLAY_MODE_ENUMS_H__
#define __DISPLAY_MODE_ENUMS_H__
enum output_encoder_class {
dm_dp = 0, dm_hdmi = 1, dm_wb = 2, dm_edp
};
enum output_format_class {
dm_444 = 0, dm_420 = 1, dm_n422, dm_s422
};
enum source_format_class {
dm_444_16 = 0,
dm_444_32 = 1,
dm_444_64 = 2,
dm_420_8 = 3,
dm_420_10 = 4,
dm_422_8 = 5,
dm_422_10 = 6,
dm_444_8 = 7,
dm_mono_8,
dm_mono_16
};
enum output_bpc_class {
dm_out_6 = 0, dm_out_8 = 1, dm_out_10 = 2, dm_out_12 = 3, dm_out_16 = 4
};
enum scan_direction_class {
dm_horz = 0, dm_vert = 1
};
enum dm_swizzle_mode {
dm_sw_linear = 0,
dm_sw_256b_s = 1,
dm_sw_256b_d = 2,
dm_sw_SPARE_0 = 3,
dm_sw_SPARE_1 = 4,
dm_sw_4kb_s = 5,
dm_sw_4kb_d = 6,
dm_sw_SPARE_2 = 7,
dm_sw_SPARE_3 = 8,
dm_sw_64kb_s = 9,
dm_sw_64kb_d = 10,
dm_sw_SPARE_4 = 11,
dm_sw_SPARE_5 = 12,
dm_sw_var_s = 13,
dm_sw_var_d = 14,
dm_sw_SPARE_6 = 15,
dm_sw_SPARE_7 = 16,
dm_sw_64kb_s_t = 17,
dm_sw_64kb_d_t = 18,
dm_sw_SPARE_10 = 19,
dm_sw_SPARE_11 = 20,
dm_sw_4kb_s_x = 21,
dm_sw_4kb_d_x = 22,
dm_sw_SPARE_12 = 23,
dm_sw_SPARE_13 = 24,
dm_sw_64kb_s_x = 25,
dm_sw_64kb_d_x = 26,
dm_sw_SPARE_14 = 27,
dm_sw_SPARE_15 = 28,
dm_sw_var_s_x = 29,
dm_sw_var_d_x = 30,
dm_sw_64kb_r_x,
dm_sw_gfx7_2d_thin_lvp,
dm_sw_gfx7_2d_thin_gl
};
enum lb_depth {
dm_lb_10 = 0, dm_lb_8 = 1, dm_lb_6 = 2, dm_lb_12 = 3, dm_lb_16
};
enum voltage_state {
dm_vmin = 0, dm_vmid = 1, dm_vnom = 2, dm_vmax = 3
};
enum source_macro_tile_size {
dm_4k_tile = 0, dm_64k_tile = 1, dm_256k_tile = 2
};
enum cursor_bpp {
dm_cur_2bit = 0, dm_cur_32bit = 1, dm_cur_64bit = 2
};
enum clock_change_support {
dm_dram_clock_change_uninitialized = 0,
dm_dram_clock_change_vactive,
dm_dram_clock_change_vblank,
dm_dram_clock_change_unsupported
};
enum output_standard {
dm_std_uninitialized = 0, dm_std_cvtr2, dm_std_cvt
};
enum mpc_combine_affinity {
dm_mpc_always_when_possible,
dm_mpc_reduce_voltage,
dm_mpc_reduce_voltage_and_clocks
};
enum self_refresh_affinity {
dm_try_to_allow_self_refresh_and_mclk_switch,
dm_allow_self_refresh_and_mclk_switch,
dm_allow_self_refresh,
dm_neither_self_refresh_nor_mclk_switch
};
#endif
@@ -0,0 +1,64 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#include "display_mode_lib.h"
#include "dc_features.h"
extern const struct _vcs_dpi_ip_params_st dcn1_0_ip;
extern const struct _vcs_dpi_soc_bounding_box_st dcn1_0_soc;
static void set_soc_bounding_box(struct _vcs_dpi_soc_bounding_box_st *soc, enum dml_project project)
{
switch (project) {
case DML_PROJECT_RAVEN1:
*soc = dcn1_0_soc;
break;
default:
ASSERT(0);
break;
}
}
static void set_ip_params(struct _vcs_dpi_ip_params_st *ip, enum dml_project project)
{
switch (project) {
case DML_PROJECT_RAVEN1:
*ip = dcn1_0_ip;
break;
default:
ASSERT(0);
break;
}
}
void dml_init_instance(struct display_mode_lib *lib, enum dml_project project)
{
if (lib->project != project) {
set_soc_bounding_box(&lib->soc, project);
set_ip_params(&lib->ip, project);
lib->project = project;
}
}
@@ -0,0 +1,46 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DISPLAY_MODE_LIB_H__
#define __DISPLAY_MODE_LIB_H__
#include "dml_common_defs.h"
#include "dml1_display_rq_dlg_calc.h"
enum dml_project {
DML_PROJECT_UNDEFINED,
DML_PROJECT_RAVEN1
};
struct display_mode_lib {
struct _vcs_dpi_ip_params_st ip;
struct _vcs_dpi_soc_bounding_box_st soc;
enum dml_project project;
struct dal_logger *logger;
};
void dml_init_instance(struct display_mode_lib *lib, enum dml_project project);
#endif
@@ -0,0 +1,577 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DISPLAY_MODE_STRUCTS_H__
#define __DISPLAY_MODE_STRUCTS_H__
typedef struct _vcs_dpi_voltage_scaling_st voltage_scaling_st;
typedef struct _vcs_dpi_soc_bounding_box_st soc_bounding_box_st;
typedef struct _vcs_dpi_ip_params_st ip_params_st;
typedef struct _vcs_dpi_display_pipe_source_params_st display_pipe_source_params_st;
typedef struct _vcs_dpi_display_output_params_st display_output_params_st;
typedef struct _vcs_dpi_display_bandwidth_st display_bandwidth_st;
typedef struct _vcs_dpi_scaler_ratio_depth_st scaler_ratio_depth_st;
typedef struct _vcs_dpi_scaler_taps_st scaler_taps_st;
typedef struct _vcs_dpi_display_pipe_dest_params_st display_pipe_dest_params_st;
typedef struct _vcs_dpi_display_pipe_params_st display_pipe_params_st;
typedef struct _vcs_dpi_display_clocks_and_cfg_st display_clocks_and_cfg_st;
typedef struct _vcs_dpi_display_e2e_pipe_params_st display_e2e_pipe_params_st;
typedef struct _vcs_dpi_dchub_buffer_sizing_st dchub_buffer_sizing_st;
typedef struct _vcs_dpi_watermarks_perf_st watermarks_perf_st;
typedef struct _vcs_dpi_cstate_pstate_watermarks_st cstate_pstate_watermarks_st;
typedef struct _vcs_dpi_wm_calc_pipe_params_st wm_calc_pipe_params_st;
typedef struct _vcs_dpi_vratio_pre_st vratio_pre_st;
typedef struct _vcs_dpi_display_data_rq_misc_params_st display_data_rq_misc_params_st;
typedef struct _vcs_dpi_display_data_rq_sizing_params_st display_data_rq_sizing_params_st;
typedef struct _vcs_dpi_display_data_rq_dlg_params_st display_data_rq_dlg_params_st;
typedef struct _vcs_dpi_display_cur_rq_dlg_params_st display_cur_rq_dlg_params_st;
typedef struct _vcs_dpi_display_rq_dlg_params_st display_rq_dlg_params_st;
typedef struct _vcs_dpi_display_rq_sizing_params_st display_rq_sizing_params_st;
typedef struct _vcs_dpi_display_rq_misc_params_st display_rq_misc_params_st;
typedef struct _vcs_dpi_display_rq_params_st display_rq_params_st;
typedef struct _vcs_dpi_display_dlg_regs_st display_dlg_regs_st;
typedef struct _vcs_dpi_display_ttu_regs_st display_ttu_regs_st;
typedef struct _vcs_dpi_display_data_rq_regs_st display_data_rq_regs_st;
typedef struct _vcs_dpi_display_rq_regs_st display_rq_regs_st;
typedef struct _vcs_dpi_display_dlg_sys_params_st display_dlg_sys_params_st;
typedef struct _vcs_dpi_display_dlg_prefetch_param_st display_dlg_prefetch_param_st;
typedef struct _vcs_dpi_display_pipe_clock_st display_pipe_clock_st;
typedef struct _vcs_dpi_display_arb_params_st display_arb_params_st;
struct _vcs_dpi_voltage_scaling_st {
int state;
double dscclk_mhz;
double dcfclk_mhz;
double socclk_mhz;
double dram_speed_mts;
double fabricclk_mhz;
double dispclk_mhz;
double phyclk_mhz;
double dppclk_mhz;
};
struct _vcs_dpi_soc_bounding_box_st {
double sr_exit_time_us;
double sr_enter_plus_exit_time_us;
double urgent_latency_us;
double urgent_latency_pixel_data_only_us;
double urgent_latency_pixel_mixed_with_vm_data_us;
double urgent_latency_vm_data_only_us;
double writeback_latency_us;
double ideal_dram_bw_after_urgent_percent;
double pct_ideal_dram_sdp_bw_after_urgent_pixel_only; // PercentOfIdealDRAMFabricAndSDPPortBWReceivedAfterUrgLatencyPixelDataOnly
double pct_ideal_dram_sdp_bw_after_urgent_pixel_and_vm;
double pct_ideal_dram_sdp_bw_after_urgent_vm_only;
double max_avg_sdp_bw_use_normal_percent;
double max_avg_dram_bw_use_normal_percent;
unsigned int max_request_size_bytes;
double downspread_percent;
double dram_page_open_time_ns;
double dram_rw_turnaround_time_ns;
double dram_return_buffer_per_channel_bytes;
double dram_channel_width_bytes;
double fabric_datapath_to_dcn_data_return_bytes;
double dcn_downspread_percent;
double dispclk_dppclk_vco_speed_mhz;
double dfs_vco_period_ps;
unsigned int urgent_out_of_order_return_per_channel_pixel_only_bytes;
unsigned int urgent_out_of_order_return_per_channel_pixel_and_vm_bytes;
unsigned int urgent_out_of_order_return_per_channel_vm_only_bytes;
unsigned int round_trip_ping_latency_dcfclk_cycles;
unsigned int urgent_out_of_order_return_per_channel_bytes;
unsigned int channel_interleave_bytes;
unsigned int num_banks;
unsigned int num_chans;
unsigned int vmm_page_size_bytes;
double dram_clock_change_latency_us;
double writeback_dram_clock_change_latency_us;
unsigned int return_bus_width_bytes;
unsigned int voltage_override;
double xfc_bus_transport_time_us;
double xfc_xbuf_latency_tolerance_us;
int use_urgent_burst_bw;
double max_hscl_ratio;
double max_vscl_ratio;
struct _vcs_dpi_voltage_scaling_st clock_limits[7];
};
struct _vcs_dpi_ip_params_st {
bool gpuvm_enable;
bool hostvm_enable;
unsigned int gpuvm_max_page_table_levels;
unsigned int hostvm_max_page_table_levels;
unsigned int hostvm_cached_page_table_levels;
unsigned int pte_group_size_bytes;
unsigned int max_inter_dcn_tile_repeaters;
unsigned int num_dsc;
unsigned int odm_capable;
unsigned int rob_buffer_size_kbytes;
unsigned int det_buffer_size_kbytes;
unsigned int dpte_buffer_size_in_pte_reqs;
unsigned int pde_proc_buffer_size_64k_reqs;
unsigned int dpp_output_buffer_pixels;
unsigned int opp_output_buffer_lines;
unsigned int pixel_chunk_size_kbytes;
unsigned char pte_enable;
unsigned int pte_chunk_size_kbytes;
unsigned int meta_chunk_size_kbytes;
unsigned int writeback_chunk_size_kbytes;
unsigned int line_buffer_size_bits;
unsigned int max_line_buffer_lines;
unsigned int writeback_luma_buffer_size_kbytes;
unsigned int writeback_chroma_buffer_size_kbytes;
unsigned int writeback_chroma_line_buffer_width_pixels;
unsigned int max_page_table_levels;
unsigned int max_num_dpp;
unsigned int max_num_otg;
unsigned int cursor_chunk_size;
unsigned int cursor_buffer_size;
unsigned int max_num_wb;
unsigned int max_dchub_pscl_bw_pix_per_clk;
unsigned int max_pscl_lb_bw_pix_per_clk;
unsigned int max_lb_vscl_bw_pix_per_clk;
unsigned int max_vscl_hscl_bw_pix_per_clk;
double max_hscl_ratio;
double max_vscl_ratio;
unsigned int hscl_mults;
unsigned int vscl_mults;
unsigned int max_hscl_taps;
unsigned int max_vscl_taps;
unsigned int xfc_supported;
unsigned int xfc_fill_constant_bytes;
double dispclk_ramp_margin_percent;
double xfc_fill_bw_overhead_percent;
double underscan_factor;
unsigned int min_vblank_lines;
unsigned int dppclk_delay_subtotal;
unsigned int dispclk_delay_subtotal;
unsigned int dcfclk_cstate_latency;
unsigned int dppclk_delay_scl;
unsigned int dppclk_delay_scl_lb_only;
unsigned int dppclk_delay_cnvc_formatter;
unsigned int dppclk_delay_cnvc_cursor;
unsigned int is_line_buffer_bpp_fixed;
unsigned int line_buffer_fixed_bpp;
unsigned int dcc_supported;
unsigned int IsLineBufferBppFixed;
unsigned int LineBufferFixedBpp;
unsigned int can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one;
unsigned int bug_forcing_LC_req_same_size_fixed;
};
struct _vcs_dpi_display_xfc_params_st {
double xfc_tslv_vready_offset_us;
double xfc_tslv_vupdate_width_us;
double xfc_tslv_vupdate_offset_us;
int xfc_slv_chunk_size_bytes;
};
struct _vcs_dpi_display_pipe_source_params_st {
int source_format;
unsigned char dcc;
unsigned int dcc_override;
unsigned int dcc_rate;
unsigned char dcc_use_global;
unsigned char vm;
bool gpuvm; // gpuvm enabled
bool hostvm; // hostvm enabled
bool gpuvm_levels_force_en;
unsigned int gpuvm_levels_force;
bool hostvm_levels_force_en;
unsigned int hostvm_levels_force;
int source_scan;
int sw_mode;
int macro_tile_size;
unsigned char is_display_sw;
unsigned int viewport_width;
unsigned int viewport_height;
unsigned int viewport_y_y;
unsigned int viewport_y_c;
unsigned int viewport_width_c;
unsigned int viewport_height_c;
unsigned int data_pitch;
unsigned int data_pitch_c;
unsigned int meta_pitch;
unsigned int meta_pitch_c;
unsigned int cur0_src_width;
int cur0_bpp;
unsigned int cur1_src_width;
int cur1_bpp;
int num_cursors;
unsigned char is_hsplit;
unsigned char dynamic_metadata_enable;
unsigned int dynamic_metadata_lines_before_active;
unsigned int dynamic_metadata_xmit_bytes;
unsigned int hsplit_grp;
unsigned char xfc_enable;
unsigned char xfc_slave;
struct _vcs_dpi_display_xfc_params_st xfc_params;
};
struct writeback_st {
int wb_src_height;
int wb_dst_width;
int wb_dst_height;
int wb_pixel_format;
int wb_htaps_luma;
int wb_vtaps_luma;
int wb_htaps_chroma;
int wb_vtaps_chroma;
double wb_hratio;
double wb_vratio;
};
struct _vcs_dpi_display_output_params_st {
int dp_lanes;
int output_bpp;
int dsc_enable;
int wb_enable;
int num_active_wb;
int output_bpc;
int output_type;
int output_format;
int output_standard;
int dsc_slices;
struct writeback_st wb;
};
struct _vcs_dpi_display_bandwidth_st {
double total_bw_consumed_gbps;
double guaranteed_urgent_return_bw_gbps;
};
struct _vcs_dpi_scaler_ratio_depth_st {
double hscl_ratio;
double vscl_ratio;
double hscl_ratio_c;
double vscl_ratio_c;
double vinit;
double vinit_c;
double vinit_bot;
double vinit_bot_c;
int lb_depth;
int scl_enable;
};
struct _vcs_dpi_scaler_taps_st {
unsigned int htaps;
unsigned int vtaps;
unsigned int htaps_c;
unsigned int vtaps_c;
};
struct _vcs_dpi_display_pipe_dest_params_st {
unsigned int recout_width;
unsigned int recout_height;
unsigned int full_recout_width;
unsigned int full_recout_height;
unsigned int hblank_start;
unsigned int hblank_end;
unsigned int vblank_start;
unsigned int vblank_end;
unsigned int htotal;
unsigned int vtotal;
unsigned int vactive;
unsigned int hactive;
unsigned int vstartup_start;
unsigned int vupdate_offset;
unsigned int vupdate_width;
unsigned int vready_offset;
unsigned char interlaced;
unsigned char underscan;
double pixel_rate_mhz;
unsigned char synchronized_vblank_all_planes;
unsigned char otg_inst;
unsigned char odm_split_cnt;
unsigned char odm_combine;
unsigned char use_maximum_vstartup;
};
struct _vcs_dpi_display_pipe_params_st {
display_pipe_source_params_st src;
display_pipe_dest_params_st dest;
scaler_ratio_depth_st scale_ratio_depth;
scaler_taps_st scale_taps;
};
struct _vcs_dpi_display_clocks_and_cfg_st {
int voltage;
double dppclk_mhz;
double refclk_mhz;
double dispclk_mhz;
double dcfclk_mhz;
double socclk_mhz;
};
struct _vcs_dpi_display_e2e_pipe_params_st {
display_pipe_params_st pipe;
display_output_params_st dout;
display_clocks_and_cfg_st clks_cfg;
};
struct _vcs_dpi_dchub_buffer_sizing_st {
unsigned int swath_width_y;
unsigned int swath_height_y;
unsigned int swath_height_c;
unsigned int detail_buffer_size_y;
};
struct _vcs_dpi_watermarks_perf_st {
double stutter_eff_in_active_region_percent;
double urgent_latency_supported_us;
double non_urgent_latency_supported_us;
double dram_clock_change_margin_us;
double dram_access_eff_percent;
};
struct _vcs_dpi_cstate_pstate_watermarks_st {
double cstate_exit_us;
double cstate_enter_plus_exit_us;
double pstate_change_us;
};
struct _vcs_dpi_wm_calc_pipe_params_st {
unsigned int num_dpp;
int voltage;
int output_type;
double dcfclk_mhz;
double socclk_mhz;
double dppclk_mhz;
double pixclk_mhz;
unsigned char interlace_en;
unsigned char pte_enable;
unsigned char dcc_enable;
double dcc_rate;
double bytes_per_pixel_c;
double bytes_per_pixel_y;
unsigned int swath_width_y;
unsigned int swath_height_y;
unsigned int swath_height_c;
unsigned int det_buffer_size_y;
double h_ratio;
double v_ratio;
unsigned int h_taps;
unsigned int h_total;
unsigned int v_total;
unsigned int v_active;
unsigned int e2e_index;
double display_pipe_line_delivery_time;
double read_bw;
unsigned int lines_in_det_y;
unsigned int lines_in_det_y_rounded_down_to_swath;
double full_det_buffering_time;
double dcfclk_deepsleep_mhz_per_plane;
};
struct _vcs_dpi_vratio_pre_st {
double vratio_pre_l;
double vratio_pre_c;
};
struct _vcs_dpi_display_data_rq_misc_params_st {
unsigned int full_swath_bytes;
unsigned int stored_swath_bytes;
unsigned int blk256_height;
unsigned int blk256_width;
unsigned int req_height;
unsigned int req_width;
};
struct _vcs_dpi_display_data_rq_sizing_params_st {
unsigned int chunk_bytes;
unsigned int min_chunk_bytes;
unsigned int meta_chunk_bytes;
unsigned int min_meta_chunk_bytes;
unsigned int mpte_group_bytes;
unsigned int dpte_group_bytes;
};
struct _vcs_dpi_display_data_rq_dlg_params_st {
unsigned int swath_width_ub;
unsigned int swath_height;
unsigned int req_per_swath_ub;
unsigned int meta_pte_bytes_per_frame_ub;
unsigned int dpte_req_per_row_ub;
unsigned int dpte_groups_per_row_ub;
unsigned int dpte_row_height;
unsigned int dpte_bytes_per_row_ub;
unsigned int meta_chunks_per_row_ub;
unsigned int meta_req_per_row_ub;
unsigned int meta_row_height;
unsigned int meta_bytes_per_row_ub;
};
struct _vcs_dpi_display_cur_rq_dlg_params_st {
unsigned char enable;
unsigned int swath_height;
unsigned int req_per_line;
};
struct _vcs_dpi_display_rq_dlg_params_st {
display_data_rq_dlg_params_st rq_l;
display_data_rq_dlg_params_st rq_c;
display_cur_rq_dlg_params_st rq_cur0;
};
struct _vcs_dpi_display_rq_sizing_params_st {
display_data_rq_sizing_params_st rq_l;
display_data_rq_sizing_params_st rq_c;
};
struct _vcs_dpi_display_rq_misc_params_st {
display_data_rq_misc_params_st rq_l;
display_data_rq_misc_params_st rq_c;
};
struct _vcs_dpi_display_rq_params_st {
unsigned char yuv420;
unsigned char yuv420_10bpc;
display_rq_misc_params_st misc;
display_rq_sizing_params_st sizing;
display_rq_dlg_params_st dlg;
};
struct _vcs_dpi_display_dlg_regs_st {
unsigned int refcyc_h_blank_end;
unsigned int dlg_vblank_end;
unsigned int min_dst_y_next_start;
unsigned int refcyc_per_htotal;
unsigned int refcyc_x_after_scaler;
unsigned int dst_y_after_scaler;
unsigned int dst_y_prefetch;
unsigned int dst_y_per_vm_vblank;
unsigned int dst_y_per_row_vblank;
unsigned int dst_y_per_vm_flip;
unsigned int dst_y_per_row_flip;
unsigned int ref_freq_to_pix_freq;
unsigned int vratio_prefetch;
unsigned int vratio_prefetch_c;
unsigned int refcyc_per_pte_group_vblank_l;
unsigned int refcyc_per_pte_group_vblank_c;
unsigned int refcyc_per_meta_chunk_vblank_l;
unsigned int refcyc_per_meta_chunk_vblank_c;
unsigned int refcyc_per_pte_group_flip_l;
unsigned int refcyc_per_pte_group_flip_c;
unsigned int refcyc_per_meta_chunk_flip_l;
unsigned int refcyc_per_meta_chunk_flip_c;
unsigned int dst_y_per_pte_row_nom_l;
unsigned int dst_y_per_pte_row_nom_c;
unsigned int refcyc_per_pte_group_nom_l;
unsigned int refcyc_per_pte_group_nom_c;
unsigned int dst_y_per_meta_row_nom_l;
unsigned int dst_y_per_meta_row_nom_c;
unsigned int refcyc_per_meta_chunk_nom_l;
unsigned int refcyc_per_meta_chunk_nom_c;
unsigned int refcyc_per_line_delivery_pre_l;
unsigned int refcyc_per_line_delivery_pre_c;
unsigned int refcyc_per_line_delivery_l;
unsigned int refcyc_per_line_delivery_c;
unsigned int chunk_hdl_adjust_cur0;
unsigned int chunk_hdl_adjust_cur1;
unsigned int vready_after_vcount0;
unsigned int dst_y_offset_cur0;
unsigned int dst_y_offset_cur1;
unsigned int xfc_reg_transfer_delay;
unsigned int xfc_reg_precharge_delay;
unsigned int xfc_reg_remote_surface_flip_latency;
unsigned int xfc_reg_prefetch_margin;
unsigned int dst_y_delta_drq_limit;
};
struct _vcs_dpi_display_ttu_regs_st {
unsigned int qos_level_low_wm;
unsigned int qos_level_high_wm;
unsigned int min_ttu_vblank;
unsigned int qos_level_flip;
unsigned int refcyc_per_req_delivery_l;
unsigned int refcyc_per_req_delivery_c;
unsigned int refcyc_per_req_delivery_cur0;
unsigned int refcyc_per_req_delivery_cur1;
unsigned int refcyc_per_req_delivery_pre_l;
unsigned int refcyc_per_req_delivery_pre_c;
unsigned int refcyc_per_req_delivery_pre_cur0;
unsigned int refcyc_per_req_delivery_pre_cur1;
unsigned int qos_level_fixed_l;
unsigned int qos_level_fixed_c;
unsigned int qos_level_fixed_cur0;
unsigned int qos_level_fixed_cur1;
unsigned int qos_ramp_disable_l;
unsigned int qos_ramp_disable_c;
unsigned int qos_ramp_disable_cur0;
unsigned int qos_ramp_disable_cur1;
};
struct _vcs_dpi_display_data_rq_regs_st {
unsigned int chunk_size;
unsigned int min_chunk_size;
unsigned int meta_chunk_size;
unsigned int min_meta_chunk_size;
unsigned int dpte_group_size;
unsigned int mpte_group_size;
unsigned int swath_height;
unsigned int pte_row_height_linear;
};
struct _vcs_dpi_display_rq_regs_st {
display_data_rq_regs_st rq_regs_l;
display_data_rq_regs_st rq_regs_c;
unsigned int drq_expansion_mode;
unsigned int prq_expansion_mode;
unsigned int mrq_expansion_mode;
unsigned int crq_expansion_mode;
unsigned int plane1_base_address;
};
struct _vcs_dpi_display_dlg_sys_params_st {
double t_mclk_wm_us;
double t_urg_wm_us;
double t_sr_wm_us;
double t_extra_us;
double mem_trip_us;
double t_srx_delay_us;
double deepsleep_dcfclk_mhz;
double total_flip_bw;
unsigned int total_flip_bytes;
};
struct _vcs_dpi_display_dlg_prefetch_param_st {
double prefetch_bw;
unsigned int flip_bytes;
};
struct _vcs_dpi_display_pipe_clock_st {
double dcfclk_mhz;
double dispclk_mhz;
double socclk_mhz;
double dscclk_mhz[6];
double dppclk_mhz[6];
};
struct _vcs_dpi_display_arb_params_st {
int max_req_outstanding;
int min_req_outstanding;
int sat_level_us;
};
#endif /*__DISPLAY_MODE_STRUCTS_H__*/
@@ -0,0 +1,393 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#include "display_rq_dlg_helpers.h"
#include "dml_logger.h"
void print__rq_params_st(struct display_mode_lib *mode_lib, display_rq_params_st rq_param)
{
dml_print("DML_RQ_DLG_CALC: ***************************\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_RQ_PARAM_ST\n");
dml_print("DML_RQ_DLG_CALC: <LUMA>\n");
print__data_rq_sizing_params_st(mode_lib, rq_param.sizing.rq_l);
dml_print("DML_RQ_DLG_CALC: <CHROMA> ===\n");
print__data_rq_sizing_params_st(mode_lib, rq_param.sizing.rq_c);
dml_print("DML_RQ_DLG_CALC: <LUMA>\n");
print__data_rq_dlg_params_st(mode_lib, rq_param.dlg.rq_l);
dml_print("DML_RQ_DLG_CALC: <CHROMA>\n");
print__data_rq_dlg_params_st(mode_lib, rq_param.dlg.rq_c);
dml_print("DML_RQ_DLG_CALC: <LUMA>\n");
print__data_rq_misc_params_st(mode_lib, rq_param.misc.rq_l);
dml_print("DML_RQ_DLG_CALC: <CHROMA>\n");
print__data_rq_misc_params_st(mode_lib, rq_param.misc.rq_c);
dml_print("DML_RQ_DLG_CALC: ***************************\n");
}
void print__data_rq_sizing_params_st(struct display_mode_lib *mode_lib, display_data_rq_sizing_params_st rq_sizing)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_DATA_RQ_SIZING_PARAM_ST\n");
dml_print("DML_RQ_DLG_CALC: chunk_bytes = %0d\n", rq_sizing.chunk_bytes);
dml_print("DML_RQ_DLG_CALC: min_chunk_bytes = %0d\n", rq_sizing.min_chunk_bytes);
dml_print("DML_RQ_DLG_CALC: meta_chunk_bytes = %0d\n", rq_sizing.meta_chunk_bytes);
dml_print(
"DML_RQ_DLG_CALC: min_meta_chunk_bytes = %0d\n",
rq_sizing.min_meta_chunk_bytes);
dml_print("DML_RQ_DLG_CALC: mpte_group_bytes = %0d\n", rq_sizing.mpte_group_bytes);
dml_print("DML_RQ_DLG_CALC: dpte_group_bytes = %0d\n", rq_sizing.dpte_group_bytes);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__data_rq_dlg_params_st(struct display_mode_lib *mode_lib, display_data_rq_dlg_params_st rq_dlg_param)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_DATA_RQ_DLG_PARAM_ST\n");
dml_print(
"DML_RQ_DLG_CALC: swath_width_ub = %0d\n",
rq_dlg_param.swath_width_ub);
dml_print(
"DML_RQ_DLG_CALC: swath_height = %0d\n",
rq_dlg_param.swath_height);
dml_print(
"DML_RQ_DLG_CALC: req_per_swath_ub = %0d\n",
rq_dlg_param.req_per_swath_ub);
dml_print(
"DML_RQ_DLG_CALC: meta_pte_bytes_per_frame_ub = %0d\n",
rq_dlg_param.meta_pte_bytes_per_frame_ub);
dml_print(
"DML_RQ_DLG_CALC: dpte_req_per_row_ub = %0d\n",
rq_dlg_param.dpte_req_per_row_ub);
dml_print(
"DML_RQ_DLG_CALC: dpte_groups_per_row_ub = %0d\n",
rq_dlg_param.dpte_groups_per_row_ub);
dml_print(
"DML_RQ_DLG_CALC: dpte_row_height = %0d\n",
rq_dlg_param.dpte_row_height);
dml_print(
"DML_RQ_DLG_CALC: dpte_bytes_per_row_ub = %0d\n",
rq_dlg_param.dpte_bytes_per_row_ub);
dml_print(
"DML_RQ_DLG_CALC: meta_chunks_per_row_ub = %0d\n",
rq_dlg_param.meta_chunks_per_row_ub);
dml_print(
"DML_RQ_DLG_CALC: meta_req_per_row_ub = %0d\n",
rq_dlg_param.meta_req_per_row_ub);
dml_print(
"DML_RQ_DLG_CALC: meta_row_height = %0d\n",
rq_dlg_param.meta_row_height);
dml_print(
"DML_RQ_DLG_CALC: meta_bytes_per_row_ub = %0d\n",
rq_dlg_param.meta_bytes_per_row_ub);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__data_rq_misc_params_st(struct display_mode_lib *mode_lib, display_data_rq_misc_params_st rq_misc_param)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_DATA_RQ_MISC_PARAM_ST\n");
dml_print(
"DML_RQ_DLG_CALC: full_swath_bytes = %0d\n",
rq_misc_param.full_swath_bytes);
dml_print(
"DML_RQ_DLG_CALC: stored_swath_bytes = %0d\n",
rq_misc_param.stored_swath_bytes);
dml_print("DML_RQ_DLG_CALC: blk256_width = %0d\n", rq_misc_param.blk256_width);
dml_print("DML_RQ_DLG_CALC: blk256_height = %0d\n", rq_misc_param.blk256_height);
dml_print("DML_RQ_DLG_CALC: req_width = %0d\n", rq_misc_param.req_width);
dml_print("DML_RQ_DLG_CALC: req_height = %0d\n", rq_misc_param.req_height);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__rq_dlg_params_st(struct display_mode_lib *mode_lib, display_rq_dlg_params_st rq_dlg_param)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_RQ_DLG_PARAM_ST\n");
dml_print("DML_RQ_DLG_CALC: <LUMA>\n");
print__data_rq_dlg_params_st(mode_lib, rq_dlg_param.rq_l);
dml_print("DML_RQ_DLG_CALC: <CHROMA>\n");
print__data_rq_dlg_params_st(mode_lib, rq_dlg_param.rq_c);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__dlg_sys_params_st(struct display_mode_lib *mode_lib, display_dlg_sys_params_st dlg_sys_param)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_RQ_DLG_PARAM_ST\n");
dml_print("DML_RQ_DLG_CALC: t_mclk_wm_us = %3.2f\n", dlg_sys_param.t_mclk_wm_us);
dml_print("DML_RQ_DLG_CALC: t_urg_wm_us = %3.2f\n", dlg_sys_param.t_urg_wm_us);
dml_print("DML_RQ_DLG_CALC: t_sr_wm_us = %3.2f\n", dlg_sys_param.t_sr_wm_us);
dml_print("DML_RQ_DLG_CALC: t_extra_us = %3.2f\n", dlg_sys_param.t_extra_us);
dml_print(
"DML_RQ_DLG_CALC: t_srx_delay_us = %3.2f\n",
dlg_sys_param.t_srx_delay_us);
dml_print(
"DML_RQ_DLG_CALC: deepsleep_dcfclk_mhz = %3.2f\n",
dlg_sys_param.deepsleep_dcfclk_mhz);
dml_print(
"DML_RQ_DLG_CALC: total_flip_bw = %3.2f\n",
dlg_sys_param.total_flip_bw);
dml_print(
"DML_RQ_DLG_CALC: total_flip_bytes = %i\n",
dlg_sys_param.total_flip_bytes);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__data_rq_regs_st(struct display_mode_lib *mode_lib, display_data_rq_regs_st rq_regs)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_DATA_RQ_REGS_ST\n");
dml_print("DML_RQ_DLG_CALC: chunk_size = 0x%0x\n", rq_regs.chunk_size);
dml_print("DML_RQ_DLG_CALC: min_chunk_size = 0x%0x\n", rq_regs.min_chunk_size);
dml_print("DML_RQ_DLG_CALC: meta_chunk_size = 0x%0x\n", rq_regs.meta_chunk_size);
dml_print(
"DML_RQ_DLG_CALC: min_meta_chunk_size = 0x%0x\n",
rq_regs.min_meta_chunk_size);
dml_print("DML_RQ_DLG_CALC: dpte_group_size = 0x%0x\n", rq_regs.dpte_group_size);
dml_print("DML_RQ_DLG_CALC: mpte_group_size = 0x%0x\n", rq_regs.mpte_group_size);
dml_print("DML_RQ_DLG_CALC: swath_height = 0x%0x\n", rq_regs.swath_height);
dml_print(
"DML_RQ_DLG_CALC: pte_row_height_linear = 0x%0x\n",
rq_regs.pte_row_height_linear);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__rq_regs_st(struct display_mode_lib *mode_lib, display_rq_regs_st rq_regs)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_RQ_REGS_ST\n");
dml_print("DML_RQ_DLG_CALC: <LUMA>\n");
print__data_rq_regs_st(mode_lib, rq_regs.rq_regs_l);
dml_print("DML_RQ_DLG_CALC: <CHROMA>\n");
print__data_rq_regs_st(mode_lib, rq_regs.rq_regs_c);
dml_print("DML_RQ_DLG_CALC: drq_expansion_mode = 0x%0x\n", rq_regs.drq_expansion_mode);
dml_print("DML_RQ_DLG_CALC: prq_expansion_mode = 0x%0x\n", rq_regs.prq_expansion_mode);
dml_print("DML_RQ_DLG_CALC: mrq_expansion_mode = 0x%0x\n", rq_regs.mrq_expansion_mode);
dml_print("DML_RQ_DLG_CALC: crq_expansion_mode = 0x%0x\n", rq_regs.crq_expansion_mode);
dml_print("DML_RQ_DLG_CALC: plane1_base_address = 0x%0x\n", rq_regs.plane1_base_address);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__dlg_regs_st(struct display_mode_lib *mode_lib, display_dlg_regs_st dlg_regs)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_DLG_REGS_ST\n");
dml_print(
"DML_RQ_DLG_CALC: refcyc_h_blank_end = 0x%0x\n",
dlg_regs.refcyc_h_blank_end);
dml_print(
"DML_RQ_DLG_CALC: dlg_vblank_end = 0x%0x\n",
dlg_regs.dlg_vblank_end);
dml_print(
"DML_RQ_DLG_CALC: min_dst_y_next_start = 0x%0x\n",
dlg_regs.min_dst_y_next_start);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_htotal = 0x%0x\n",
dlg_regs.refcyc_per_htotal);
dml_print(
"DML_RQ_DLG_CALC: refcyc_x_after_scaler = 0x%0x\n",
dlg_regs.refcyc_x_after_scaler);
dml_print(
"DML_RQ_DLG_CALC: dst_y_after_scaler = 0x%0x\n",
dlg_regs.dst_y_after_scaler);
dml_print(
"DML_RQ_DLG_CALC: dst_y_prefetch = 0x%0x\n",
dlg_regs.dst_y_prefetch);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_vm_vblank = 0x%0x\n",
dlg_regs.dst_y_per_vm_vblank);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_row_vblank = 0x%0x\n",
dlg_regs.dst_y_per_row_vblank);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_vm_flip = 0x%0x\n",
dlg_regs.dst_y_per_vm_flip);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_row_flip = 0x%0x\n",
dlg_regs.dst_y_per_row_flip);
dml_print(
"DML_RQ_DLG_CALC: ref_freq_to_pix_freq = 0x%0x\n",
dlg_regs.ref_freq_to_pix_freq);
dml_print(
"DML_RQ_DLG_CALC: vratio_prefetch = 0x%0x\n",
dlg_regs.vratio_prefetch);
dml_print(
"DML_RQ_DLG_CALC: vratio_prefetch_c = 0x%0x\n",
dlg_regs.vratio_prefetch_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_pte_group_vblank_l = 0x%0x\n",
dlg_regs.refcyc_per_pte_group_vblank_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_pte_group_vblank_c = 0x%0x\n",
dlg_regs.refcyc_per_pte_group_vblank_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_meta_chunk_vblank_l = 0x%0x\n",
dlg_regs.refcyc_per_meta_chunk_vblank_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_meta_chunk_vblank_c = 0x%0x\n",
dlg_regs.refcyc_per_meta_chunk_vblank_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_pte_group_flip_l = 0x%0x\n",
dlg_regs.refcyc_per_pte_group_flip_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_pte_group_flip_c = 0x%0x\n",
dlg_regs.refcyc_per_pte_group_flip_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_meta_chunk_flip_l = 0x%0x\n",
dlg_regs.refcyc_per_meta_chunk_flip_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_meta_chunk_flip_c = 0x%0x\n",
dlg_regs.refcyc_per_meta_chunk_flip_c);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_pte_row_nom_l = 0x%0x\n",
dlg_regs.dst_y_per_pte_row_nom_l);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_pte_row_nom_c = 0x%0x\n",
dlg_regs.dst_y_per_pte_row_nom_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_pte_group_nom_l = 0x%0x\n",
dlg_regs.refcyc_per_pte_group_nom_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_pte_group_nom_c = 0x%0x\n",
dlg_regs.refcyc_per_pte_group_nom_c);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_meta_row_nom_l = 0x%0x\n",
dlg_regs.dst_y_per_meta_row_nom_l);
dml_print(
"DML_RQ_DLG_CALC: dst_y_per_meta_row_nom_c = 0x%0x\n",
dlg_regs.dst_y_per_meta_row_nom_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_meta_chunk_nom_l = 0x%0x\n",
dlg_regs.refcyc_per_meta_chunk_nom_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_meta_chunk_nom_c = 0x%0x\n",
dlg_regs.refcyc_per_meta_chunk_nom_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_line_delivery_pre_l = 0x%0x\n",
dlg_regs.refcyc_per_line_delivery_pre_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_line_delivery_pre_c = 0x%0x\n",
dlg_regs.refcyc_per_line_delivery_pre_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_line_delivery_l = 0x%0x\n",
dlg_regs.refcyc_per_line_delivery_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_line_delivery_c = 0x%0x\n",
dlg_regs.refcyc_per_line_delivery_c);
dml_print(
"DML_RQ_DLG_CALC: chunk_hdl_adjust_cur0 = 0x%0x\n",
dlg_regs.chunk_hdl_adjust_cur0);
dml_print(
"DML_RQ_DLG_CALC: dst_y_offset_cur1 = 0x%0x\n",
dlg_regs.dst_y_offset_cur1);
dml_print(
"DML_RQ_DLG_CALC: chunk_hdl_adjust_cur1 = 0x%0x\n",
dlg_regs.chunk_hdl_adjust_cur1);
dml_print(
"DML_RQ_DLG_CALC: vready_after_vcount0 = 0x%0x\n",
dlg_regs.vready_after_vcount0);
dml_print(
"DML_RQ_DLG_CALC: dst_y_delta_drq_limit = 0x%0x\n",
dlg_regs.dst_y_delta_drq_limit);
dml_print(
"DML_RQ_DLG_CALC: xfc_reg_transfer_delay = 0x%0x\n",
dlg_regs.xfc_reg_transfer_delay);
dml_print(
"DML_RQ_DLG_CALC: xfc_reg_precharge_delay = 0x%0x\n",
dlg_regs.xfc_reg_precharge_delay);
dml_print(
"DML_RQ_DLG_CALC: xfc_reg_remote_surface_flip_latency = 0x%0x\n",
dlg_regs.xfc_reg_remote_surface_flip_latency);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
void print__ttu_regs_st(struct display_mode_lib *mode_lib, display_ttu_regs_st ttu_regs)
{
dml_print("DML_RQ_DLG_CALC: =====================================\n");
dml_print("DML_RQ_DLG_CALC: DISPLAY_TTU_REGS_ST\n");
dml_print(
"DML_RQ_DLG_CALC: qos_level_low_wm = 0x%0x\n",
ttu_regs.qos_level_low_wm);
dml_print(
"DML_RQ_DLG_CALC: qos_level_high_wm = 0x%0x\n",
ttu_regs.qos_level_high_wm);
dml_print(
"DML_RQ_DLG_CALC: min_ttu_vblank = 0x%0x\n",
ttu_regs.min_ttu_vblank);
dml_print(
"DML_RQ_DLG_CALC: qos_level_flip = 0x%0x\n",
ttu_regs.qos_level_flip);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_pre_l = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_pre_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_l = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_l);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_pre_c = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_pre_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_c = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_c);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_cur0 = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_cur0);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_pre_cur0 = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_pre_cur0);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_cur1 = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_cur1);
dml_print(
"DML_RQ_DLG_CALC: refcyc_per_req_delivery_pre_cur1 = 0x%0x\n",
ttu_regs.refcyc_per_req_delivery_pre_cur1);
dml_print(
"DML_RQ_DLG_CALC: qos_level_fixed_l = 0x%0x\n",
ttu_regs.qos_level_fixed_l);
dml_print(
"DML_RQ_DLG_CALC: qos_ramp_disable_l = 0x%0x\n",
ttu_regs.qos_ramp_disable_l);
dml_print(
"DML_RQ_DLG_CALC: qos_level_fixed_c = 0x%0x\n",
ttu_regs.qos_level_fixed_c);
dml_print(
"DML_RQ_DLG_CALC: qos_ramp_disable_c = 0x%0x\n",
ttu_regs.qos_ramp_disable_c);
dml_print(
"DML_RQ_DLG_CALC: qos_level_fixed_cur0 = 0x%0x\n",
ttu_regs.qos_level_fixed_cur0);
dml_print(
"DML_RQ_DLG_CALC: qos_ramp_disable_cur0 = 0x%0x\n",
ttu_regs.qos_ramp_disable_cur0);
dml_print(
"DML_RQ_DLG_CALC: qos_level_fixed_cur1 = 0x%0x\n",
ttu_regs.qos_level_fixed_cur1);
dml_print(
"DML_RQ_DLG_CALC: qos_ramp_disable_cur1 = 0x%0x\n",
ttu_regs.qos_ramp_disable_cur1);
dml_print("DML_RQ_DLG_CALC: =====================================\n");
}
@@ -0,0 +1,47 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DISPLAY_RQ_DLG_HELPERS_H__
#define __DISPLAY_RQ_DLG_HELPERS_H__
#include "dml_common_defs.h"
#include "display_mode_lib.h"
/* Function: Printer functions
* Print various struct
*/
void print__rq_params_st(struct display_mode_lib *mode_lib, display_rq_params_st rq_param);
void print__data_rq_sizing_params_st(struct display_mode_lib *mode_lib, display_data_rq_sizing_params_st rq_sizing);
void print__data_rq_dlg_params_st(struct display_mode_lib *mode_lib, display_data_rq_dlg_params_st rq_dlg_param);
void print__data_rq_misc_params_st(struct display_mode_lib *mode_lib, display_data_rq_misc_params_st rq_misc_param);
void print__rq_dlg_params_st(struct display_mode_lib *mode_lib, display_rq_dlg_params_st rq_dlg_param);
void print__dlg_sys_params_st(struct display_mode_lib *mode_lib, display_dlg_sys_params_st dlg_sys_param);
void print__data_rq_regs_st(struct display_mode_lib *mode_lib, display_data_rq_regs_st data_rq_regs);
void print__rq_regs_st(struct display_mode_lib *mode_lib, display_rq_regs_st rq_regs);
void print__dlg_regs_st(struct display_mode_lib *mode_lib, display_dlg_regs_st dlg_regs);
void print__ttu_regs_st(struct display_mode_lib *mode_lib, display_ttu_regs_st ttu_regs);
#endif
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,68 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DISPLAY_RQ_DLG_CALC_H__
#define __DISPLAY_RQ_DLG_CALC_H__
#include "dml_common_defs.h"
struct display_mode_lib;
#include "display_rq_dlg_helpers.h"
void dml1_extract_rq_regs(
struct display_mode_lib *mode_lib,
struct _vcs_dpi_display_rq_regs_st *rq_regs,
const struct _vcs_dpi_display_rq_params_st rq_param);
/* Function: dml_rq_dlg_get_rq_params
* Calculate requestor related parameters that register definition agnostic
* (i.e. this layer does try to separate real values from register definition)
* Input:
* pipe_src_param - pipe source configuration (e.g. vp, pitch, etc.)
* Output:
* rq_param - values that can be used to setup RQ (e.g. swath_height, plane1_addr, etc.)
*/
void dml1_rq_dlg_get_rq_params(
struct display_mode_lib *mode_lib,
struct _vcs_dpi_display_rq_params_st *rq_param,
const struct _vcs_dpi_display_pipe_source_params_st pipe_src_param);
/* Function: dml_rq_dlg_get_dlg_params
* Calculate deadline related parameters
*/
void dml1_rq_dlg_get_dlg_params(
struct display_mode_lib *mode_lib,
struct _vcs_dpi_display_dlg_regs_st *dlg_regs,
struct _vcs_dpi_display_ttu_regs_st *ttu_regs,
const struct _vcs_dpi_display_rq_dlg_params_st rq_dlg_param,
const struct _vcs_dpi_display_dlg_sys_params_st dlg_sys_param,
const struct _vcs_dpi_display_e2e_pipe_params_st e2e_pipe_param,
const bool cstate_en,
const bool pstate_en,
const bool vm_en,
const bool iflip_en);
#endif
@@ -0,0 +1,43 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#include "dml_common_defs.h"
#include "dcn_calc_math.h"
#include "dml_inline_defs.h"
double dml_round(double a)
{
double round_pt = 0.5;
double ceil = dml_ceil(a, 1);
double floor = dml_floor(a, 1);
if (a - floor >= round_pt)
return ceil;
else
return floor;
}
@@ -0,0 +1,37 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DC_COMMON_DEFS_H__
#define __DC_COMMON_DEFS_H__
#include "dm_services.h"
#include "dc_features.h"
#include "display_mode_structs.h"
#include "display_mode_enums.h"
double dml_round(double a);
#endif /* __DC_COMMON_DEFS_H__ */
@@ -0,0 +1,132 @@
/*
* Copyright 2017 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DML_INLINE_DEFS_H__
#define __DML_INLINE_DEFS_H__
#include "dml_common_defs.h"
#include "dcn_calc_math.h"
#include "dml_logger.h"
static inline double dml_min(double a, double b)
{
return (double) dcn_bw_min2(a, b);
}
static inline double dml_min3(double a, double b, double c)
{
return dml_min(dml_min(a, b), c);
}
static inline double dml_min4(double a, double b, double c, double d)
{
return dml_min(dml_min(a, b), dml_min(c, d));
}
static inline double dml_max(double a, double b)
{
return (double) dcn_bw_max2(a, b);
}
static inline double dml_max3(double a, double b, double c)
{
return dml_max(dml_max(a, b), c);
}
static inline double dml_max4(double a, double b, double c, double d)
{
return dml_max(dml_max(a, b), dml_max(c, d));
}
static inline double dml_max5(double a, double b, double c, double d, double e)
{
return dml_max(dml_max4(a, b, c, d), e);
}
static inline double dml_ceil(double a, double granularity)
{
return (double) dcn_bw_ceil2(a, granularity);
}
static inline double dml_floor(double a, double granularity)
{
return (double) dcn_bw_floor2(a, granularity);
}
static inline int dml_log2(double x)
{
return dml_round((double)dcn_bw_log(x, 2));
}
static inline double dml_pow(double a, int exp)
{
return (double) dcn_bw_pow(a, exp);
}
static inline double dml_fmod(double f, int val)
{
return (double) dcn_bw_mod(f, val);
}
static inline double dml_ceil_2(double f)
{
return (double) dcn_bw_ceil2(f, 2);
}
static inline double dml_ceil_ex(double x, double granularity)
{
return (double) dcn_bw_ceil2(x, granularity);
}
static inline double dml_floor_ex(double x, double granularity)
{
return (double) dcn_bw_floor2(x, granularity);
}
static inline double dml_log(double x, double base)
{
return (double) dcn_bw_log(x, base);
}
static inline unsigned int dml_round_to_multiple(unsigned int num,
unsigned int multiple,
bool up)
{
unsigned int remainder;
if (multiple == 0)
return num;
remainder = num % multiple;
if (remainder == 0)
return num;
if (up)
return (num + multiple - remainder);
else
return (num - remainder);
}
#endif
@@ -0,0 +1,38 @@
/*
* Copyright 2018 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Authors: AMD
*
*/
#ifndef __DML_LOGGER_H_
#define __DML_LOGGER_H_
#define DC_LOGGER \
mode_lib->logger
#define dml_print(str, ...) {DC_LOG_DML(str, ##__VA_ARGS__); }
#define DTRACE(str, ...) {DC_LOG_DML(str, ##__VA_ARGS__); }
#endif