Path: blob/master/drivers/gpu/drm/amd/include/dm_pp_interface.h
26517 views
/*1* Copyright 2016 Advanced Micro Devices, Inc.2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice shall be included in11* all copies or substantial portions of the Software.12*13* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR14* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,15* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL16* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR17* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,18* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR19* OTHER DEALINGS IN THE SOFTWARE.20*21*/22#ifndef _DM_PP_INTERFACE_23#define _DM_PP_INTERFACE_2425#include "dm_services_types.h"2627#define PP_MAX_CLOCK_LEVELS 162829enum amd_pp_display_config_type {30AMD_PP_DisplayConfigType_None = 0,31AMD_PP_DisplayConfigType_DP54 ,32AMD_PP_DisplayConfigType_DP432 ,33AMD_PP_DisplayConfigType_DP324 ,34AMD_PP_DisplayConfigType_DP27,35AMD_PP_DisplayConfigType_DP243,36AMD_PP_DisplayConfigType_DP216,37AMD_PP_DisplayConfigType_DP162,38AMD_PP_DisplayConfigType_HDMI6G,39AMD_PP_DisplayConfigType_HDMI297,40AMD_PP_DisplayConfigType_HDMI162,41AMD_PP_DisplayConfigType_LVDS,42AMD_PP_DisplayConfigType_DVI,43AMD_PP_DisplayConfigType_WIRELESS,44AMD_PP_DisplayConfigType_VGA45};4647struct single_display_configuration {48uint32_t controller_index;49uint32_t controller_id;50uint32_t signal_type;51uint32_t display_state;52/* phy id for the primary internal transmitter */53uint8_t primary_transmitter_phyi_d;54/* bitmap with the active lanes */55uint8_t primary_transmitter_active_lanemap;56/* phy id for the secondary internal transmitter (for dual-link dvi) */57uint8_t secondary_transmitter_phy_id;58/* bitmap with the active lanes */59uint8_t secondary_transmitter_active_lanemap;60/* misc phy settings for SMU. */61uint32_t config_flags;62uint32_t display_type;63uint32_t view_resolution_cx;64uint32_t view_resolution_cy;65enum amd_pp_display_config_type displayconfigtype;66uint32_t vertical_refresh; /* for active display */67};6869#define MAX_NUM_DISPLAY 327071struct amd_pp_display_configuration {72bool nb_pstate_switch_disable;/* controls NB PState switch */73bool cpu_cc6_disable; /* controls CPU CState switch ( on or off) */74bool cpu_pstate_disable;75uint32_t cpu_pstate_separation_time;7677uint32_t num_display; /* total number of display*/78uint32_t num_path_including_non_display;79uint32_t crossfire_display_index;80uint32_t min_mem_set_clock;81uint32_t min_core_set_clock;82/* unit 10KHz x bit*/83uint32_t min_bus_bandwidth;84/* minimum required stutter sclk, in 10khz uint32_t ulMinCoreSetClk;*/85uint32_t min_core_set_clock_in_sr;8687struct single_display_configuration displays[MAX_NUM_DISPLAY];8889uint32_t vrefresh; /* for active display*/9091uint32_t min_vblank_time; /* for active display*/92bool multi_monitor_in_sync;93/* Controller Index of primary display - used in MCLK SMC switching hang94* SW Workaround*/95uint32_t crtc_index;96/* htotal*1000/pixelclk - used in MCLK SMC switching hang SW Workaround*/97uint32_t line_time_in_us;98bool invalid_vblank_time;99100uint32_t display_clk;101/*102* for given display configuration if multimonitormnsync == false then103* Memory clock DPMS with this latency or below is allowed, DPMS with104* higher latency not allowed.105*/106uint32_t dce_tolerable_mclk_in_active_latency;107uint32_t min_dcef_set_clk;108uint32_t min_dcef_deep_sleep_set_clk;109};110111struct amd_pp_simple_clock_info {112uint32_t engine_max_clock;113uint32_t memory_max_clock;114uint32_t level;115};116117enum PP_DAL_POWERLEVEL {118PP_DAL_POWERLEVEL_INVALID = 0,119PP_DAL_POWERLEVEL_ULTRALOW,120PP_DAL_POWERLEVEL_LOW,121PP_DAL_POWERLEVEL_NOMINAL,122PP_DAL_POWERLEVEL_PERFORMANCE,123124PP_DAL_POWERLEVEL_0 = PP_DAL_POWERLEVEL_ULTRALOW,125PP_DAL_POWERLEVEL_1 = PP_DAL_POWERLEVEL_LOW,126PP_DAL_POWERLEVEL_2 = PP_DAL_POWERLEVEL_NOMINAL,127PP_DAL_POWERLEVEL_3 = PP_DAL_POWERLEVEL_PERFORMANCE,128PP_DAL_POWERLEVEL_4 = PP_DAL_POWERLEVEL_3+1,129PP_DAL_POWERLEVEL_5 = PP_DAL_POWERLEVEL_4+1,130PP_DAL_POWERLEVEL_6 = PP_DAL_POWERLEVEL_5+1,131PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,132};133134struct amd_pp_clock_info {135uint32_t min_engine_clock;136uint32_t max_engine_clock;137uint32_t min_memory_clock;138uint32_t max_memory_clock;139uint32_t min_bus_bandwidth;140uint32_t max_bus_bandwidth;141uint32_t max_engine_clock_in_sr;142uint32_t min_engine_clock_in_sr;143enum PP_DAL_POWERLEVEL max_clocks_state;144};145146enum amd_pp_clock_type {147amd_pp_disp_clock = 1,148amd_pp_sys_clock,149amd_pp_mem_clock,150amd_pp_dcef_clock,151amd_pp_soc_clock,152amd_pp_pixel_clock,153amd_pp_phy_clock,154amd_pp_dcf_clock,155amd_pp_dpp_clock,156amd_pp_f_clock = amd_pp_dcef_clock,157};158159#define MAX_NUM_CLOCKS 16160161struct amd_pp_clocks {162uint32_t count;163uint32_t clock[MAX_NUM_CLOCKS];164uint32_t latency[MAX_NUM_CLOCKS];165};166167struct pp_clock_with_latency {168uint32_t clocks_in_khz;169uint32_t latency_in_us;170};171172struct pp_clock_levels_with_latency {173uint32_t num_levels;174struct pp_clock_with_latency data[PP_MAX_CLOCK_LEVELS];175};176177struct pp_clock_with_voltage {178uint32_t clocks_in_khz;179uint32_t voltage_in_mv;180};181182struct pp_clock_levels_with_voltage {183uint32_t num_levels;184struct pp_clock_with_voltage data[PP_MAX_CLOCK_LEVELS];185};186187struct pp_display_clock_request {188enum amd_pp_clock_type clock_type;189uint32_t clock_freq_in_khz;190};191192#endif /* _DM_PP_INTERFACE_ */193194195