Path: blob/master/drivers/gpu/drm/amd/include/dm_pp_interface.h
29285 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 */67uint32_t pixel_clock; /* Pixel clock in KHz (for HDMI only: normalized) */68};6970#define MAX_NUM_DISPLAY 327172struct amd_pp_display_configuration {73bool nb_pstate_switch_disable;/* controls NB PState switch */74bool cpu_cc6_disable; /* controls CPU CState switch ( on or off) */75bool cpu_pstate_disable;76uint32_t cpu_pstate_separation_time;7778uint32_t num_display; /* total number of display*/79uint32_t num_path_including_non_display;80uint32_t crossfire_display_index;81uint32_t min_mem_set_clock;82uint32_t min_core_set_clock;83/* unit 10KHz x bit*/84uint32_t min_bus_bandwidth;85/* minimum required stutter sclk, in 10khz uint32_t ulMinCoreSetClk;*/86uint32_t min_core_set_clock_in_sr;8788struct single_display_configuration displays[MAX_NUM_DISPLAY];8990uint32_t vrefresh; /* for active display*/9192uint32_t min_vblank_time; /* for active display*/93bool multi_monitor_in_sync;94/* Controller Index of primary display - used in MCLK SMC switching hang95* SW Workaround*/96uint32_t crtc_index;97/* htotal*1000/pixelclk - used in MCLK SMC switching hang SW Workaround*/98uint32_t line_time_in_us;99bool invalid_vblank_time;100101uint32_t display_clk;102/*103* for given display configuration if multimonitormnsync == false then104* Memory clock DPMS with this latency or below is allowed, DPMS with105* higher latency not allowed.106*/107uint32_t dce_tolerable_mclk_in_active_latency;108uint32_t min_dcef_set_clk;109uint32_t min_dcef_deep_sleep_set_clk;110};111112struct amd_pp_simple_clock_info {113uint32_t engine_max_clock;114uint32_t memory_max_clock;115uint32_t level;116};117118enum PP_DAL_POWERLEVEL {119PP_DAL_POWERLEVEL_INVALID = 0,120PP_DAL_POWERLEVEL_ULTRALOW,121PP_DAL_POWERLEVEL_LOW,122PP_DAL_POWERLEVEL_NOMINAL,123PP_DAL_POWERLEVEL_PERFORMANCE,124125PP_DAL_POWERLEVEL_0 = PP_DAL_POWERLEVEL_ULTRALOW,126PP_DAL_POWERLEVEL_1 = PP_DAL_POWERLEVEL_LOW,127PP_DAL_POWERLEVEL_2 = PP_DAL_POWERLEVEL_NOMINAL,128PP_DAL_POWERLEVEL_3 = PP_DAL_POWERLEVEL_PERFORMANCE,129PP_DAL_POWERLEVEL_4 = PP_DAL_POWERLEVEL_3+1,130PP_DAL_POWERLEVEL_5 = PP_DAL_POWERLEVEL_4+1,131PP_DAL_POWERLEVEL_6 = PP_DAL_POWERLEVEL_5+1,132PP_DAL_POWERLEVEL_7 = PP_DAL_POWERLEVEL_6+1,133};134135struct amd_pp_clock_info {136uint32_t min_engine_clock;137uint32_t max_engine_clock;138uint32_t min_memory_clock;139uint32_t max_memory_clock;140uint32_t min_bus_bandwidth;141uint32_t max_bus_bandwidth;142uint32_t max_engine_clock_in_sr;143uint32_t min_engine_clock_in_sr;144enum PP_DAL_POWERLEVEL max_clocks_state;145};146147enum amd_pp_clock_type {148amd_pp_disp_clock = 1,149amd_pp_sys_clock,150amd_pp_mem_clock,151amd_pp_dcef_clock,152amd_pp_soc_clock,153amd_pp_pixel_clock,154amd_pp_phy_clock,155amd_pp_dcf_clock,156amd_pp_dpp_clock,157amd_pp_f_clock = amd_pp_dcef_clock,158};159160#define MAX_NUM_CLOCKS 16161162struct amd_pp_clocks {163uint32_t count;164uint32_t clock[MAX_NUM_CLOCKS];165uint32_t latency[MAX_NUM_CLOCKS];166};167168struct pp_clock_with_latency {169uint32_t clocks_in_khz;170uint32_t latency_in_us;171};172173struct pp_clock_levels_with_latency {174uint32_t num_levels;175struct pp_clock_with_latency data[PP_MAX_CLOCK_LEVELS];176};177178struct pp_clock_with_voltage {179uint32_t clocks_in_khz;180uint32_t voltage_in_mv;181};182183struct pp_clock_levels_with_voltage {184uint32_t num_levels;185struct pp_clock_with_voltage data[PP_MAX_CLOCK_LEVELS];186};187188struct pp_display_clock_request {189enum amd_pp_clock_type clock_type;190uint32_t clock_freq_in_khz;191};192193#endif /* _DM_PP_INTERFACE_ */194195196