DC Patches Mar 20, 2018
cover DC Patches Mar 20, 2018
* Fix multi-channel audio
* Fix banding on 6 bit eDP panels with Polaris
* Fix Polaris 12 BW calcs
* Drop EDID read during atomic_check (for MST)
Anthony Koo (3):
drm/amd/display: Couple bug fixes in stats module drm/amd/display: Rename encoder_info_packet to dc_info_packet drm/amd/display: Only program MSA_TIMING_PARAM if it changed
Bhawanpreet Lakha (2):
drm/amd/display: Add debug prints for bandwidth calculations drm/amd/display: Correct print types in DC_LOGS
Dmytro Laktyushkin (4):
drm/amd/display: fix lexa bw bounding box drm/amd/display: add mpc to dtn log
drm/amd/display: align dtn logs and add mpc idle bit print drm/amd/display: hide inconsistent mpcc programming from dtn log
Eric Bernstein (2):
drm/amd/display: Change wb_h/vratio to double
drm/amd/display: Add num_active_wb to DML
Eric Yang (1):
drm/amd/display: Only update mpc blend config if not full update
Harry Wentland (4):
drm/amd/display: We shouldn't set format_default on plane as atomic
driver
drm/amd/display: Add one to EDID's audio channel count when passing to
DC
drm/amd/display: Don't read EDID in atomic_check drm/amd/display: Move commit_planes_to_stream to amdgpu_dm
Julian Parkin (1):
drm/amd/display: drop dc_validate_guaranteed
Martin Tsai (1):
drm/amd/display: correct the condition in setting cursor not visible
beyond left edge
Mikita Lipski (6):
drm/amd/display: Allow truncation to 10 bits drm/amd/display: Fix FMT truncation programming drm/amd/display: Don't call amdgpu_dm_display_resume as it doesn't
exist
drm/amd/display: Adding stutter entry wm to dce bw struct drm/amd/display: Implementing new bandwidth registers for DCE120 drm/amd/display: Separate mem input constuctors for dce 112 and 120
Nikola Cornij (2):
drm/amd/display: Update ASIC header files drm/amd/display: Rename feature-specific register address init macro
Roman Li (1):
drm/amd/display: add assert in enable FBC
SivapiriyanKumarasamy (1):
drm/amd/display: Add vline IRQ programming for DCN
Tony Cheng (2):
drm/amd/display: dal 3.1.39
drm/amd/display: dal 3.1.40
Vitaly Prosyak (1):
drm/amd/display: Add dc_lut_mode enum
Xingyue Tao (2):
drm/amd/display: Add double buffer machanism to ICSC drm/amd/display: Add double buffer machanism to OCSC
Yongqiang Sun (1):
drm/amd/display: Retry when read dpcd caps failed.
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 111 +++- .../drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 32 +- .../gpu/drm/amd/display/dc/calcs/calcs_logger.h | 579 +++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 238 ++++++++- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 74 +-- drivers/gpu/drm/amd/display/dc/core/dc.c | 95 +--- drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 14 +- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 23 +- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 16 +- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 131 ++--- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 19 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 9 + drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 103 +++- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h | 17 + drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 9 +- .../drm/amd/display/dc/dce/dce_stream_encoder.c | 4 +- .../drm/amd/display/dc/dce100/dce100_resource.c | 33 -- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 10 +- .../drm/amd/display/dc/dce110/dce110_mem_input_v.c | 1 + .../drm/amd/display/dc/dce110/dce110_resource.c | 33 -- .../drm/amd/display/dc/dce112/dce112_resource.c | 33 -- .../drm/amd/display/dc/dce112/dce112_resource.h | 5 - .../drm/amd/display/dc/dce120/dce120_resource.c | 3 +- .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 49 -- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 9 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 47 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 90 ++-- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 22 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 32 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 58 ++- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 24 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h | 5 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 76 +++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 14 + .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 36 +- .../drm/amd/display/dc/dml/display_mode_structs.h | 5 +- .../dc/i2caux/dce110/i2c_hw_engine_dce110.c | 2 +- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 6 +- drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 5 + drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 17 + .../gpu/drm/amd/display/dc/inc/hw/stream_encoder.h | 21 +- .../drm/amd/display/dc/inc/hw/timing_generator.h | 3 + drivers/gpu/drm/amd/display/dc/inc/resource.h | 4 - drivers/gpu/drm/amd/display/dc/irq_types.h | 7 + drivers/gpu/drm/amd/display/modules/stats/stats.c | 39 +- 49 files changed, 1568 insertions(+), 602 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dc/calcs/calcs_logger.h
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180320191259.14453-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
PATCH 1/34 drm/amd/display: correct the condition in setting cursor not visible beyond left edge
From: Martin Tsai <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 2 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +1 -1
@@ -416,7 +416,7 @@ void dpp1_set_cursor_position(if (src_x_offset >= (int )param->viewport_width) cur_en =0 ;/* not visible beyond right edge*/ -if (src_x_offset + (int )width <0 ) +if (src_x_offset + (int )width <=0 ) cur_en =0 ;/* not visible beyond left edge*/ REG_UPDATE(CURSOR0_CONTROL,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +1 -1
@@ -897,7 +897,7 @@ void hubp1_cursor_set_position(if (src_x_offset >= (int )param->viewport_width) cur_en =0 ;/* not visible beyond right edge*/ -if (src_x_offset + (int )hubp->curs_attr.width <0 ) +if (src_x_offset + (int )hubp->curs_attr.width <=0 ) cur_en =0 ;/* not visible beyond left edge*/ if (cur_en &®_READ (CURSOR_SURFACE_ADDRESS ) ==0 )
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/34 drm/amd/display: dal 3.1.39
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.38" +#define DC_VER "3.1.39"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/34 drm/amd/display: Allow truncation to 10 bits
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
The truncation isn't being programmed if the truncation depth is set to 2, it causes an issue with dce11.2 asic using 6bit eDP panel. It required to truncate 12:10 in order to perform spatial dither 10:6.
This change will allow 12:10 truncation to be enabled.
--- drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c +2 -3
@@ -128,8 +128,7 @@ static void set_truncation(return ; }/* on other format-to do */ -if (params->flags.TRUNCATE_ENABLED ==0 || - params->flags.TRUNCATE_DEPTH ==2 ) +if (params->flags.TRUNCATE_ENABLED ==0 )return ;/*Set truncation depth and Enable truncation*/ REG_UPDATE_3(FMT_BIT_DEPTH_CONTROL,
@@ -144,7 +143,7 @@ static void set_truncation(/** * set_spatial_dither * 1) set spatial dithering mode: pattern of seed -* 2) set spatical dithering depth: 0 for 18bpp or 1 for 24bpp +* 2) set spatial dithering depth: 0 for 18bpp or 1 for 24bpp * 3) set random seed * 4) set random mode * lfsr is reset every frame or not reset
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/34 drm/amd/display: Fix FMT truncation programming
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
Switch the order of parameters being set for depth and mode of truncation, as it previously was not correct
--- drivers/gpu/drm/amd/display/dc/dce/dce_opp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_opp.c +2 -2
@@ -134,9 +134,9 @@ static void set_truncation(REG_UPDATE_3 (FMT_BIT_DEPTH_CONTROL ,FMT_TRUNCATE_EN ,1 ,FMT_TRUNCATE_DEPTH , - params->flags.TRUNCATE_MODE, + params->flags.TRUNCATE_DEPTH,FMT_TRUNCATE_MODE , - params->flags.TRUNCATE_DEPTH); + params->flags.TRUNCATE_MODE); }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/34 drm/amd/display: We shouldn't set format_default on plane as atomic driver
In reply to a message not in the archiveThis is still a leftover from early atomic brinup days.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -2
@@ -3199,8 +3199,6 @@ static int amdgpu_dm_plane_init(struct amdgpu_display_manager *dm,switch (aplane->base.type) {case DRM_PLANE_TYPE_PRIMARY : - aplane->base.format_default = true; - res = drm_universal_plane_init( dm->adev->ddev, &aplane->base,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/34 drm/amd/display: Retry when read dpcd caps failed.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
Some DP panel not detected intermittently due to read dpcd caps failed when doing hot plug.
[root cause] DC_HPD_CONNECT_INT_DELAY is set to 0, not delay after HPD toggle and read dpcd data, while some panel need 4ms defer to read.
[solution] Add a retry when read failed.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +11 -5
@@ -2278,6 +2278,8 @@ static bool retrieve_link_cap(struct dc_link *link)union edp_configuration_cap edp_config_cap;union dp_downstream_port_present ds_port = {0 };enum dc_status status =DC_ERROR_UNEXPECTED ; +uint32_t read_dpcd_retry_cnt =3 ; +int i;memset (dpcd_data,'\0' ,sizeof (dpcd_data)); memset(&down_strm_port_count,
@@ -2285,11 +2287,15 @@ static bool retrieve_link_cap(struct dc_link *link)memset (&edp_config_cap,'\0' ,sizeof (union edp_configuration_cap )); - status =core_link_read_dpcd ( - link, -DP_DPCD_REV , - dpcd_data, -sizeof (dpcd_data)); +for (i =0 ; i < read_dpcd_retry_cnt; i++) { + status =core_link_read_dpcd ( + link, +DP_DPCD_REV , + dpcd_data, +sizeof (dpcd_data)); +if (status ==DC_OK ) +break ; + }if (status !=DC_OK ) {dm_error ("%s: Read dpcd data failed.\n" , __func__);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/34 drm/amd/display: Add one to EDID's audio channel count when passing to DC
In reply to a message not in the archiveDC takes channel count to mean the actual count. cea_sad's channels represent it as number of channels - 1.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +1 -1
@@ -109,7 +109,7 @@ enum dc_edid_status dm_helpers_parse_edid_caps(struct cea_sad *sad = &sads[i]; edid_caps->audio_modes[i].format_code = sad->format; - edid_caps->audio_modes[i].channel_count = sad->channels; + edid_caps->audio_modes[i].channel_count = sad->channels +1 ; edid_caps->audio_modes[i].sample_rate = sad->freq; edid_caps->audio_modes[i].sample_size = sad->byte2; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/34 drm/amd/display: Update ASIC header files
In reply to a message not in the archiveFrom: Nikola Cornij <[email protected]>
Also separate register address initialization between ASICs for the registers that were removed in scaled-down variation of the ASIC.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 20 ++++++++------ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 32 +++++++++++++++-------- 2 files changed, 33 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +12 -8
@@ -535,11 +535,13 @@ void hubp1_program_deadline(REG_SET (VBLANK_PARAMETERS_3 ,0 ,REFCYC_PER_META_CHUNK_VBLANK_L , dlg_attr->refcyc_per_meta_chunk_vblank_l); -REG_SET (NOM_PARAMETERS_0 ,0 , -DST_Y_PER_PTE_ROW_NOM_L , dlg_attr->dst_y_per_pte_row_nom_l); +if (REG (NOM_PARAMETERS_0 )) +REG_SET (NOM_PARAMETERS_0 ,0 , +DST_Y_PER_PTE_ROW_NOM_L , dlg_attr->dst_y_per_pte_row_nom_l); -REG_SET (NOM_PARAMETERS_1 ,0 , -REFCYC_PER_PTE_GROUP_NOM_L , dlg_attr->refcyc_per_pte_group_nom_l); +if (REG (NOM_PARAMETERS_1 )) +REG_SET (NOM_PARAMETERS_1 ,0 , +REFCYC_PER_PTE_GROUP_NOM_L , dlg_attr->refcyc_per_pte_group_nom_l);REG_SET (NOM_PARAMETERS_4 ,0 ,DST_Y_PER_META_ROW_NOM_L , dlg_attr->dst_y_per_meta_row_nom_l);
@@ -568,11 +570,13 @@ void hubp1_program_deadline(REG_SET (VBLANK_PARAMETERS_4 ,0 ,REFCYC_PER_META_CHUNK_VBLANK_C , dlg_attr->refcyc_per_meta_chunk_vblank_c); -REG_SET (NOM_PARAMETERS_2 ,0 , -DST_Y_PER_PTE_ROW_NOM_C , dlg_attr->dst_y_per_pte_row_nom_c); +if (REG (NOM_PARAMETERS_2 )) +REG_SET (NOM_PARAMETERS_2 ,0 , +DST_Y_PER_PTE_ROW_NOM_C , dlg_attr->dst_y_per_pte_row_nom_c); -REG_SET (NOM_PARAMETERS_3 ,0 , -REFCYC_PER_PTE_GROUP_NOM_C , dlg_attr->refcyc_per_pte_group_nom_c); +if (REG (NOM_PARAMETERS_3 )) +REG_SET (NOM_PARAMETERS_3 ,0 , +REFCYC_PER_PTE_GROUP_NOM_C , dlg_attr->refcyc_per_pte_group_nom_c);REG_SET (NOM_PARAMETERS_6 ,0 ,DST_Y_PER_META_ROW_NOM_C , dlg_attr->dst_y_per_meta_row_nom_c);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +21 -11
@@ -30,6 +30,7 @@#define TO_DCN10_HUBP (hubp)\ container_of(hubp, struct dcn10_hubp, base) +/* Register address initialization macro for all ASICs (including those with reduced functionality) */ #define HUBP_REG_LIST_DCN (id)\ SRI(DCHUBP_CNTL, HUBP, id),\ SRI(HUBPREQ_DEBUG_DB, HUBP, id),\
@@ -78,16 +79,12 @@SRI (REF_FREQ_TO_PIX_FREQ ,HUBPREQ , id),\SRI (VBLANK_PARAMETERS_1 ,HUBPREQ , id),\SRI (VBLANK_PARAMETERS_3 ,HUBPREQ , id),\ -SRI (NOM_PARAMETERS_0 ,HUBPREQ , id),\ -SRI (NOM_PARAMETERS_1 ,HUBPREQ , id),\SRI (NOM_PARAMETERS_4 ,HUBPREQ , id),\SRI (NOM_PARAMETERS_5 ,HUBPREQ , id),\SRI (PER_LINE_DELIVERY_PRE ,HUBPREQ , id),\SRI (PER_LINE_DELIVERY ,HUBPREQ , id),\SRI (VBLANK_PARAMETERS_2 ,HUBPREQ , id),\SRI (VBLANK_PARAMETERS_4 ,HUBPREQ , id),\ -SRI (NOM_PARAMETERS_2 ,HUBPREQ , id),\ -SRI (NOM_PARAMETERS_3 ,HUBPREQ , id),\SRI (NOM_PARAMETERS_6 ,HUBPREQ , id),\SRI (NOM_PARAMETERS_7 ,HUBPREQ , id),\ SRI(DCN_TTU_QOS_WM, HUBPREQ, id),\
@@ -96,11 +93,19 @@SRI (DCN_SURF0_TTU_CNTL1 ,HUBPREQ , id),\SRI (DCN_SURF1_TTU_CNTL0 ,HUBPREQ , id),\SRI (DCN_SURF1_TTU_CNTL1 ,HUBPREQ , id),\ -SRI (DCN_VM_MX_L1_TLB_CNTL ,HUBPREQ , id),\SRI (HUBP_CLK_CNTL ,HUBP , id) +/* Register address initialization macro for "generic" ASICs with full functionality */ +#define HUBP_REG_LIST_DCN_GEN (id)\ + SRI(NOM_PARAMETERS_0, HUBPREQ, id),\ + SRI(NOM_PARAMETERS_1, HUBPREQ, id),\ + SRI(NOM_PARAMETERS_2, HUBPREQ, id),\ + SRI(NOM_PARAMETERS_3, HUBPREQ, id),\ + SRI(DCN_VM_MX_L1_TLB_CNTL, HUBPREQ, id) +#define HUBP_REG_LIST_DCN10 (id)\ HUBP_REG_LIST_DCN(id),\ + HUBP_REG_LIST_DCN_GEN(id),\ SRI(PREFETCH_SETTINS, HUBPREQ, id),\ SRI(PREFETCH_SETTINS_C, HUBPREQ, id),\ SRI(DCN_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_MSB, HUBPREQ, id),\
@@ -237,6 +242,7 @@#define HUBP_SF (reg_name, field_name, post_fix)\ .field_name = reg_name ## __ ## field_name ## post_fix +/* Mask/shift struct generation macro for all ASICs (including those with reduced functionality) */ #define HUBP_MASK_SH_LIST_DCN (mask_sh)\ HUBP_SF(HUBP0_DCHUBP_CNTL, HUBP_BLANK_EN, mask_sh),\ HUBP_SF(HUBP0_DCHUBP_CNTL, HUBP_TTU_DISABLE, mask_sh),\
@@ -335,8 +341,6 @@HUBP_SF (HUBPREQ0_REF_FREQ_TO_PIX_FREQ ,REF_FREQ_TO_PIX_FREQ , mask_sh),\HUBP_SF (HUBPREQ0_VBLANK_PARAMETERS_1 ,REFCYC_PER_PTE_GROUP_VBLANK_L , mask_sh),\HUBP_SF (HUBPREQ0_VBLANK_PARAMETERS_3 ,REFCYC_PER_META_CHUNK_VBLANK_L , mask_sh),\ -HUBP_SF (HUBPREQ0_NOM_PARAMETERS_0 ,DST_Y_PER_PTE_ROW_NOM_L , mask_sh),\ -HUBP_SF (HUBPREQ0_NOM_PARAMETERS_1 ,REFCYC_PER_PTE_GROUP_NOM_L , mask_sh),\HUBP_SF (HUBPREQ0_NOM_PARAMETERS_4 ,DST_Y_PER_META_ROW_NOM_L , mask_sh),\HUBP_SF (HUBPREQ0_NOM_PARAMETERS_5 ,REFCYC_PER_META_CHUNK_NOM_L , mask_sh),\ HUBP_SF(HUBPREQ0_PER_LINE_DELIVERY_PRE, REFCYC_PER_LINE_DELIVERY_PRE_L, mask_sh),\
@@ -345,8 +349,6 @@HUBP_SF (HUBPREQ0_PER_LINE_DELIVERY ,REFCYC_PER_LINE_DELIVERY_C , mask_sh),\HUBP_SF (HUBPREQ0_VBLANK_PARAMETERS_2 ,REFCYC_PER_PTE_GROUP_VBLANK_C , mask_sh),\HUBP_SF (HUBPREQ0_VBLANK_PARAMETERS_4 ,REFCYC_PER_META_CHUNK_VBLANK_C , mask_sh),\ -HUBP_SF (HUBPREQ0_NOM_PARAMETERS_2 ,DST_Y_PER_PTE_ROW_NOM_C , mask_sh),\ -HUBP_SF (HUBPREQ0_NOM_PARAMETERS_3 ,REFCYC_PER_PTE_GROUP_NOM_C , mask_sh),\HUBP_SF (HUBPREQ0_NOM_PARAMETERS_6 ,DST_Y_PER_META_ROW_NOM_C , mask_sh),\HUBP_SF (HUBPREQ0_NOM_PARAMETERS_7 ,REFCYC_PER_META_CHUNK_NOM_C , mask_sh),\ HUBP_SF(HUBPREQ0_DCN_TTU_QOS_WM, QoS_LEVEL_LOW_WM, mask_sh),\
@@ -357,12 +359,20 @@HUBP_SF (HUBPREQ0_DCN_SURF0_TTU_CNTL0 , QoS_LEVEL_FIXED, mask_sh),\HUBP_SF (HUBPREQ0_DCN_SURF0_TTU_CNTL0 , QoS_RAMP_DISABLE, mask_sh),\HUBP_SF (HUBPREQ0_DCN_SURF0_TTU_CNTL1 ,REFCYC_PER_REQ_DELIVERY_PRE , mask_sh),\ -HUBP_SF (HUBPREQ0_DCN_VM_MX_L1_TLB_CNTL ,ENABLE_L1_TLB , mask_sh),\ -HUBP_SF (HUBPREQ0_DCN_VM_MX_L1_TLB_CNTL ,SYSTEM_ACCESS_MODE , mask_sh),\HUBP_SF (HUBP0_HUBP_CLK_CNTL ,HUBP_CLOCK_ENABLE , mask_sh) +/* Mask/shift struct generation macro for "generic" ASICs with full functionality */ +#define HUBP_MASK_SH_LIST_DCN_GEN (mask_sh)\ + HUBP_SF(HUBPREQ0_NOM_PARAMETERS_0, DST_Y_PER_PTE_ROW_NOM_L, mask_sh),\ + HUBP_SF(HUBPREQ0_NOM_PARAMETERS_1, REFCYC_PER_PTE_GROUP_NOM_L, mask_sh),\ + HUBP_SF(HUBPREQ0_NOM_PARAMETERS_2, DST_Y_PER_PTE_ROW_NOM_C, mask_sh),\ + HUBP_SF(HUBPREQ0_NOM_PARAMETERS_3, REFCYC_PER_PTE_GROUP_NOM_C, mask_sh),\ + HUBP_SF(HUBPREQ0_DCN_VM_MX_L1_TLB_CNTL, ENABLE_L1_TLB, mask_sh),\ + HUBP_SF(HUBPREQ0_DCN_VM_MX_L1_TLB_CNTL, SYSTEM_ACCESS_MODE, mask_sh) +#define HUBP_MASK_SH_LIST_DCN10 (mask_sh)\ HUBP_MASK_SH_LIST_DCN(mask_sh),\ + HUBP_MASK_SH_LIST_DCN_GEN(mask_sh),\ HUBP_SF(HUBPREQ0_PREFETCH_SETTINS, DST_Y_PREFETCH, mask_sh),\ HUBP_SF(HUBPREQ0_PREFETCH_SETTINS, VRATIO_PREFETCH, mask_sh),\ HUBP_SF(HUBPREQ0_PREFETCH_SETTINS_C, VRATIO_PREFETCH_C, mask_sh),\
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/34 drm/amd/display: fix lexa bw bounding box
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 121 ++++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h | 1 + 2 files changed, 120 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +119 -2
@@ -52,10 +52,11 @@ static enum bw_calcs_version bw_calcs_version_from_asic_id(struct hw_asic_id asireturn BW_CALCS_VERSION_CARRIZO ;case FAMILY_VI : +if (ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +return BW_CALCS_VERSION_LEXA ;if (ASIC_REV_IS_POLARIS10_P (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS10 ; -if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev) || -ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS11 ;return BW_CALCS_VERSION_INVALID ;
@@ -2373,6 +2374,122 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip, dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 );break ; +case BW_CALCS_VERSION_LEXA : + vbios.memory_type = bw_def_gddr5; + vbios.dram_channel_width_in_bits =32 ; + vbios.number_of_dram_channels = asic_id.vram_width / vbios.dram_channel_width_in_bits; + vbios.number_of_dram_banks =8 ; + vbios.high_yclk =bw_int_to_fixed (6000 ); + vbios.mid_yclk =bw_int_to_fixed (3200 ); + vbios.low_yclk =bw_int_to_fixed (1000 ); + vbios.low_sclk =bw_int_to_fixed (678 ); + vbios.mid1_sclk =bw_int_to_fixed (864 ); + vbios.mid2_sclk =bw_int_to_fixed (900 ); + vbios.mid3_sclk =bw_int_to_fixed (920 ); + vbios.mid4_sclk =bw_int_to_fixed (940 ); + vbios.mid5_sclk =bw_int_to_fixed (960 ); + vbios.mid6_sclk =bw_int_to_fixed (980 ); + vbios.high_sclk =bw_int_to_fixed (1049 ); + vbios.low_voltage_max_dispclk =bw_int_to_fixed (459 ); + vbios.mid_voltage_max_dispclk =bw_int_to_fixed (654 ); + vbios.high_voltage_max_dispclk =bw_int_to_fixed (1108 ); + vbios.low_voltage_max_phyclk =bw_int_to_fixed (540 ); + vbios.mid_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.high_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.data_return_bus_width =bw_int_to_fixed (32 ); + vbios.trc =bw_int_to_fixed (48 ); +if (vbios.number_of_dram_channels ==2 )// 64-bit + vbios.dmifmc_urgent_latency =bw_int_to_fixed (4 ); +else + vbios.dmifmc_urgent_latency =bw_int_to_fixed (3 ); + vbios.stutter_self_refresh_exit_latency =bw_int_to_fixed (5 ); + vbios.stutter_self_refresh_entry_latency =bw_int_to_fixed (0 ); + vbios.nbp_state_change_latency =bw_int_to_fixed (250 ); + vbios.mcifwrmc_urgent_latency =bw_int_to_fixed (10 ); + vbios.scatter_gather_enable = false; + vbios.down_spread_percentage =bw_frc_to_fixed (5 ,10 ); + vbios.cursor_width =32 ; + vbios.average_compression_rate =4 ; + vbios.number_of_request_slots_gmc_reserves_for_dmif_per_channel =256 ; + vbios.blackout_duration =bw_int_to_fixed (0 );/* us */ + vbios.maximum_blackout_recovery_time =bw_int_to_fixed (0 ); + + dceip.max_average_percent_of_ideal_port_bw_display_can_use_in_normal_system_operation =100 ; + dceip.max_average_percent_of_ideal_drambw_display_can_use_in_normal_system_operation =100 ; + dceip.percent_of_ideal_port_bw_received_after_urgent_latency =100 ; + dceip.large_cursor = false; + dceip.dmif_request_buffer_size =bw_int_to_fixed (768 ); + dceip.dmif_pipe_en_fbc_chunk_tracker = false; + dceip.cursor_max_outstanding_group_num =1 ; + dceip.lines_interleaved_into_lb =2 ; + dceip.chunk_width =256 ; + dceip.number_of_graphics_pipes =5 ; + dceip.number_of_underlay_pipes =0 ; + dceip.low_power_tiling_mode =0 ; + dceip.display_write_back_supported = true; + dceip.argb_compression_support = true; + dceip.underlay_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35556 ,10000 ); + dceip.underlay_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.underlay_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.underlay_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.graphics_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35 ,10 ); + dceip.graphics_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.graphics_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.graphics_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.alpha_vscaler_efficiency =bw_int_to_fixed (3 ); + dceip.max_dmif_buffer_allocated =4 ; + dceip.graphics_dmif_size =12288 ; + dceip.underlay_luma_dmif_size =19456 ; + dceip.underlay_chroma_dmif_size =23552 ; + dceip.pre_downscaler_enabled = true; + dceip.underlay_downscale_prefetch_enabled = true; + dceip.lb_write_pixels_per_dispclk =bw_int_to_fixed (1 ); + dceip.lb_size_per_component444 =bw_int_to_fixed (245952 ); + dceip.graphics_lb_nodownscaling_multi_line_prefetching = true; + dceip.stutter_and_dram_clock_state_change_gated_before_cursor = +bw_int_to_fixed (1 ); + dceip.underlay420_luma_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.underlay420_chroma_lb_size_per_component = +bw_int_to_fixed (164352 ); + dceip.underlay422_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.cursor_chunk_width =bw_int_to_fixed (64 ); + dceip.cursor_dcp_buffer_lines =bw_int_to_fixed (4 ); + dceip.underlay_maximum_width_efficient_for_tiling = +bw_int_to_fixed (1920 ); + dceip.underlay_maximum_height_efficient_for_tiling = +bw_int_to_fixed (1080 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display = +bw_frc_to_fixed (3 ,10 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation = +bw_int_to_fixed (25 ); + dceip.minimum_outstanding_pte_request_limit =bw_int_to_fixed ( +2 ); + dceip.maximum_total_outstanding_pte_requests_allowed_by_saw = +bw_int_to_fixed (128 ); + dceip.limit_excessive_outstanding_dmif_requests = true; + dceip.linear_mode_line_request_alternation_slice = +bw_int_to_fixed (64 ); + dceip.scatter_gather_lines_of_pte_prefetching_in_linear_mode = +32 ; + dceip.display_write_back420_luma_mcifwr_buffer_size =12288 ; + dceip.display_write_back420_chroma_mcifwr_buffer_size =8192 ; + dceip.request_efficiency =bw_frc_to_fixed (8 ,10 ); + dceip.dispclk_per_request =bw_int_to_fixed (2 ); + dceip.dispclk_ramping_factor =bw_frc_to_fixed (105 ,100 ); + dceip.display_pipe_throughput_factor =bw_frc_to_fixed (105 ,100 ); + dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; + dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 ); +break ;case BW_CALCS_VERSION_STONEY : vbios.memory_type = bw_def_gddr5; vbios.dram_channel_width_in_bits =64 ;
drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h +1 -0
@@ -42,6 +42,7 @@ enum bw_calcs_version {BW_CALCS_VERSION_CARRIZO ,BW_CALCS_VERSION_POLARIS10 ,BW_CALCS_VERSION_POLARIS11 , +BW_CALCS_VERSION_LEXA ,BW_CALCS_VERSION_STONEY , BW_CALCS_VERSION_VEGA10 };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180320191259.14453-10-harry.wentland-5C7GfCeVMHo@public.gmane.org
Re: [PATCH 09/34] drm/amd/display: fix lexa bw bounding box
Please adhere to the naming of Polaris12 in commit log as well. thanks.
Jerry
Quoted 157 lines · Harry Wentland
From: Dmytro Laktyushkin <[email protected]>
Signed-off-by Dmytro Laktyushkin <[email protected]>Reviewed-by Bhawanpreet Lakha <[email protected]>Acked-by Harry Wentland <[email protected]>--- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 121 ++++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h | 1 + 2 files changed, 120 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +119
-2@@ -52,10 +52,11 @@ static enum bw_calcs_version bw_calcs_version_from_asic_id(struct hw_asic_id asireturn BW_CALCS_VERSION_CARRIZO ;case FAMILY_VI : +if (ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +return BW_CALCS_VERSION_LEXA ;if (ASIC_REV_IS_POLARIS10_P (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS10 ; -if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev) || -ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS11 ;return BW_CALCS_VERSION_INVALID ;@@ -2373,6 +2374,122 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip, dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 );break ; +case BW_CALCS_VERSION_LEXA : + vbios.memory_type = bw_def_gddr5; + vbios.dram_channel_width_in_bits =32 ; + vbios.number_of_dram_channels = asic_id.vram_width / vbios.dram_channel_width_in_bits; + vbios.number_of_dram_banks =8 ; + vbios.high_yclk =bw_int_to_fixed (6000 ); + vbios.mid_yclk =bw_int_to_fixed (3200 ); + vbios.low_yclk =bw_int_to_fixed (1000 ); + vbios.low_sclk =bw_int_to_fixed (678 ); + vbios.mid1_sclk =bw_int_to_fixed (864 ); + vbios.mid2_sclk =bw_int_to_fixed (900 ); + vbios.mid3_sclk =bw_int_to_fixed (920 ); + vbios.mid4_sclk =bw_int_to_fixed (940 ); + vbios.mid5_sclk =bw_int_to_fixed (960 ); + vbios.mid6_sclk =bw_int_to_fixed (980 ); + vbios.high_sclk =bw_int_to_fixed (1049 ); + vbios.low_voltage_max_dispclk =bw_int_to_fixed (459 ); + vbios.mid_voltage_max_dispclk =bw_int_to_fixed (654 ); + vbios.high_voltage_max_dispclk =bw_int_to_fixed (1108 ); + vbios.low_voltage_max_phyclk =bw_int_to_fixed (540 ); + vbios.mid_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.high_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.data_return_bus_width =bw_int_to_fixed (32 ); + vbios.trc =bw_int_to_fixed (48 ); +if (vbios.number_of_dram_channels ==2 )// 64-bit + vbios.dmifmc_urgent_latency =bw_int_to_fixed (4 ); +else + vbios.dmifmc_urgent_latency =bw_int_to_fixed (3 ); + vbios.stutter_self_refresh_exit_latency =bw_int_to_fixed (5 ); + vbios.stutter_self_refresh_entry_latency =bw_int_to_fixed (0 ); + vbios.nbp_state_change_latency =bw_int_to_fixed (250 ); + vbios.mcifwrmc_urgent_latency =bw_int_to_fixed (10 ); + vbios.scatter_gather_enable = false; + vbios.down_spread_percentage =bw_frc_to_fixed (5 ,10 ); + vbios.cursor_width =32 ; + vbios.average_compression_rate =4 ; + vbios.number_of_request_slots_gmc_reserves_for_dmif_per_channel =256 ; + vbios.blackout_duration =bw_int_to_fixed (0 );/* us */ + vbios.maximum_blackout_recovery_time =bw_int_to_fixed (0 ); + + dceip.max_average_percent_of_ideal_port_bw_display_can_use_in_normal_system_operation =100 ; + dceip.max_average_percent_of_ideal_drambw_display_can_use_in_normal_system_operation =100 ; + dceip.percent_of_ideal_port_bw_received_after_urgent_latency =100 ; + dceip.large_cursor = false; + dceip.dmif_request_buffer_size =bw_int_to_fixed (768 ); + dceip.dmif_pipe_en_fbc_chunk_tracker = false; + dceip.cursor_max_outstanding_group_num =1 ; + dceip.lines_interleaved_into_lb =2 ; + dceip.chunk_width =256 ; + dceip.number_of_graphics_pipes =5 ; + dceip.number_of_underlay_pipes =0 ; + dceip.low_power_tiling_mode =0 ; + dceip.display_write_back_supported = true; + dceip.argb_compression_support = true; + dceip.underlay_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35556 ,10000 ); + dceip.underlay_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.underlay_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.underlay_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.graphics_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35 ,10 ); + dceip.graphics_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.graphics_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.graphics_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.alpha_vscaler_efficiency =bw_int_to_fixed (3 ); + dceip.max_dmif_buffer_allocated =4 ; + dceip.graphics_dmif_size =12288 ; + dceip.underlay_luma_dmif_size =19456 ; + dceip.underlay_chroma_dmif_size =23552 ; + dceip.pre_downscaler_enabled = true; + dceip.underlay_downscale_prefetch_enabled = true; + dceip.lb_write_pixels_per_dispclk =bw_int_to_fixed (1 ); + dceip.lb_size_per_component444 =bw_int_to_fixed (245952 ); + dceip.graphics_lb_nodownscaling_multi_line_prefetching = true; + dceip.stutter_and_dram_clock_state_change_gated_before_cursor = +bw_int_to_fixed (1 ); + dceip.underlay420_luma_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.underlay420_chroma_lb_size_per_component = +bw_int_to_fixed (164352 ); + dceip.underlay422_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.cursor_chunk_width =bw_int_to_fixed (64 ); + dceip.cursor_dcp_buffer_lines =bw_int_to_fixed (4 ); + dceip.underlay_maximum_width_efficient_for_tiling = +bw_int_to_fixed (1920 ); + dceip.underlay_maximum_height_efficient_for_tiling = +bw_int_to_fixed (1080 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display = +bw_frc_to_fixed (3 ,10 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation = +bw_int_to_fixed (25 ); + dceip.minimum_outstanding_pte_request_limit =bw_int_to_fixed ( +2 ); + dceip.maximum_total_outstanding_pte_requests_allowed_by_saw = +bw_int_to_fixed (128 ); + dceip.limit_excessive_outstanding_dmif_requests = true; + dceip.linear_mode_line_request_alternation_slice = +bw_int_to_fixed (64 ); + dceip.scatter_gather_lines_of_pte_prefetching_in_linear_mode = +32 ; + dceip.display_write_back420_luma_mcifwr_buffer_size =12288 ; + dceip.display_write_back420_chroma_mcifwr_buffer_size =8192 ; + dceip.request_efficiency =bw_frc_to_fixed (8 ,10 ); + dceip.dispclk_per_request =bw_int_to_fixed (2 ); + dceip.dispclk_ramping_factor =bw_frc_to_fixed (105 ,100 ); + dceip.display_pipe_throughput_factor =bw_frc_to_fixed (105 ,100 ); + dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; + dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 ); +break ;case BW_CALCS_VERSION_STONEY : vbios.memory_type = bw_def_gddr5; vbios.dram_channel_width_in_bits =64 ;drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h +0
-0
drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h enum bw_calcs_version { · line 48
Quoted 7 lines
drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h +1
-0@@ -42,6 +42,7 @@ enum bw_calcs_version {BW_CALCS_VERSION_CARRIZO ,BW_CALCS_VERSION_POLARIS10 ,BW_CALCS_VERSION_POLARIS11 , +BW_CALCS_VERSION_LEXA ,BW_CALCS_VERSION_STONEY , BW_CALCS_VERSION_VEGA10 };
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v2 1/1 drm/amd/display: fix Polaris 12 bw bounding box
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 121 ++++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h | 1 + 2 files changed, 120 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +119 -2
@@ -52,10 +52,11 @@ static enum bw_calcs_version bw_calcs_version_from_asic_id(struct hw_asic_id asireturn BW_CALCS_VERSION_CARRIZO ;case FAMILY_VI : +if (ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +return BW_CALCS_VERSION_POLARIS12 ;if (ASIC_REV_IS_POLARIS10_P (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS10 ; -if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev) || -ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS11 ;return BW_CALCS_VERSION_INVALID ;
@@ -2373,6 +2374,122 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip, dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 );break ; +case BW_CALCS_VERSION_POLARIS12 : + vbios.memory_type = bw_def_gddr5; + vbios.dram_channel_width_in_bits =32 ; + vbios.number_of_dram_channels = asic_id.vram_width / vbios.dram_channel_width_in_bits; + vbios.number_of_dram_banks =8 ; + vbios.high_yclk =bw_int_to_fixed (6000 ); + vbios.mid_yclk =bw_int_to_fixed (3200 ); + vbios.low_yclk =bw_int_to_fixed (1000 ); + vbios.low_sclk =bw_int_to_fixed (678 ); + vbios.mid1_sclk =bw_int_to_fixed (864 ); + vbios.mid2_sclk =bw_int_to_fixed (900 ); + vbios.mid3_sclk =bw_int_to_fixed (920 ); + vbios.mid4_sclk =bw_int_to_fixed (940 ); + vbios.mid5_sclk =bw_int_to_fixed (960 ); + vbios.mid6_sclk =bw_int_to_fixed (980 ); + vbios.high_sclk =bw_int_to_fixed (1049 ); + vbios.low_voltage_max_dispclk =bw_int_to_fixed (459 ); + vbios.mid_voltage_max_dispclk =bw_int_to_fixed (654 ); + vbios.high_voltage_max_dispclk =bw_int_to_fixed (1108 ); + vbios.low_voltage_max_phyclk =bw_int_to_fixed (540 ); + vbios.mid_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.high_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.data_return_bus_width =bw_int_to_fixed (32 ); + vbios.trc =bw_int_to_fixed (48 ); +if (vbios.number_of_dram_channels ==2 )// 64-bit + vbios.dmifmc_urgent_latency =bw_int_to_fixed (4 ); +else + vbios.dmifmc_urgent_latency =bw_int_to_fixed (3 ); + vbios.stutter_self_refresh_exit_latency =bw_int_to_fixed (5 ); + vbios.stutter_self_refresh_entry_latency =bw_int_to_fixed (0 ); + vbios.nbp_state_change_latency =bw_int_to_fixed (250 ); + vbios.mcifwrmc_urgent_latency =bw_int_to_fixed (10 ); + vbios.scatter_gather_enable = false; + vbios.down_spread_percentage =bw_frc_to_fixed (5 ,10 ); + vbios.cursor_width =32 ; + vbios.average_compression_rate =4 ; + vbios.number_of_request_slots_gmc_reserves_for_dmif_per_channel =256 ; + vbios.blackout_duration =bw_int_to_fixed (0 );/* us */ + vbios.maximum_blackout_recovery_time =bw_int_to_fixed (0 ); + + dceip.max_average_percent_of_ideal_port_bw_display_can_use_in_normal_system_operation =100 ; + dceip.max_average_percent_of_ideal_drambw_display_can_use_in_normal_system_operation =100 ; + dceip.percent_of_ideal_port_bw_received_after_urgent_latency =100 ; + dceip.large_cursor = false; + dceip.dmif_request_buffer_size =bw_int_to_fixed (768 ); + dceip.dmif_pipe_en_fbc_chunk_tracker = false; + dceip.cursor_max_outstanding_group_num =1 ; + dceip.lines_interleaved_into_lb =2 ; + dceip.chunk_width =256 ; + dceip.number_of_graphics_pipes =5 ; + dceip.number_of_underlay_pipes =0 ; + dceip.low_power_tiling_mode =0 ; + dceip.display_write_back_supported = true; + dceip.argb_compression_support = true; + dceip.underlay_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35556 ,10000 ); + dceip.underlay_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.underlay_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.underlay_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.graphics_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35 ,10 ); + dceip.graphics_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.graphics_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.graphics_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.alpha_vscaler_efficiency =bw_int_to_fixed (3 ); + dceip.max_dmif_buffer_allocated =4 ; + dceip.graphics_dmif_size =12288 ; + dceip.underlay_luma_dmif_size =19456 ; + dceip.underlay_chroma_dmif_size =23552 ; + dceip.pre_downscaler_enabled = true; + dceip.underlay_downscale_prefetch_enabled = true; + dceip.lb_write_pixels_per_dispclk =bw_int_to_fixed (1 ); + dceip.lb_size_per_component444 =bw_int_to_fixed (245952 ); + dceip.graphics_lb_nodownscaling_multi_line_prefetching = true; + dceip.stutter_and_dram_clock_state_change_gated_before_cursor = +bw_int_to_fixed (1 ); + dceip.underlay420_luma_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.underlay420_chroma_lb_size_per_component = +bw_int_to_fixed (164352 ); + dceip.underlay422_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.cursor_chunk_width =bw_int_to_fixed (64 ); + dceip.cursor_dcp_buffer_lines =bw_int_to_fixed (4 ); + dceip.underlay_maximum_width_efficient_for_tiling = +bw_int_to_fixed (1920 ); + dceip.underlay_maximum_height_efficient_for_tiling = +bw_int_to_fixed (1080 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display = +bw_frc_to_fixed (3 ,10 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation = +bw_int_to_fixed (25 ); + dceip.minimum_outstanding_pte_request_limit =bw_int_to_fixed ( +2 ); + dceip.maximum_total_outstanding_pte_requests_allowed_by_saw = +bw_int_to_fixed (128 ); + dceip.limit_excessive_outstanding_dmif_requests = true; + dceip.linear_mode_line_request_alternation_slice = +bw_int_to_fixed (64 ); + dceip.scatter_gather_lines_of_pte_prefetching_in_linear_mode = +32 ; + dceip.display_write_back420_luma_mcifwr_buffer_size =12288 ; + dceip.display_write_back420_chroma_mcifwr_buffer_size =8192 ; + dceip.request_efficiency =bw_frc_to_fixed (8 ,10 ); + dceip.dispclk_per_request =bw_int_to_fixed (2 ); + dceip.dispclk_ramping_factor =bw_frc_to_fixed (105 ,100 ); + dceip.display_pipe_throughput_factor =bw_frc_to_fixed (105 ,100 ); + dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; + dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 ); +break ;case BW_CALCS_VERSION_STONEY : vbios.memory_type = bw_def_gddr5; vbios.dram_channel_width_in_bits =64 ;
drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h +1 -0
@@ -42,6 +42,7 @@ enum bw_calcs_version {BW_CALCS_VERSION_CARRIZO ,BW_CALCS_VERSION_POLARIS10 ,BW_CALCS_VERSION_POLARIS11 , +BW_CALCS_VERSION_POLARIS12 ,BW_CALCS_VERSION_STONEY , BW_CALCS_VERSION_VEGA10 };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20180322183957.11419-1-harry.wentland-5C7GfCeVMHo@public.gmane.org
Re: [PATCH v2] drm/amd/display: fix Polaris 12 bw bounding box
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Harry Wentland <[email protected]>
Sent: Thursday, March 22, 2018 2:39:57 PM
To: [email protected]
Cc: Laktyushkin, Dmytro; Wentland, Harry
Subject: [PATCH v2] drm/amd/display: fix Polaris 12 bw bounding box
From: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 121 ++++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h | 1 + 2 files changed, 120 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +119 -2
@@ -52,10 +52,11 @@ static enum bw_calcs_version bw_calcs_version_from_asic_id(struct hw_asic_id asireturn BW_CALCS_VERSION_CARRIZO ;case FAMILY_VI : +if (ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +return BW_CALCS_VERSION_POLARIS12 ;if (ASIC_REV_IS_POLARIS10_P (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS10 ; -if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev) || -ASIC_REV_IS_POLARIS12_V (asic_id.hw_internal_rev)) +if (ASIC_REV_IS_POLARIS11_M (asic_id.hw_internal_rev))return BW_CALCS_VERSION_POLARIS11 ;return BW_CALCS_VERSION_INVALID ;
@@ -2373,6 +2374,122 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip, dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 );break ; +case BW_CALCS_VERSION_POLARIS12 : + vbios.memory_type = bw_def_gddr5; + vbios.dram_channel_width_in_bits =32 ; + vbios.number_of_dram_channels = asic_id.vram_width / vbios.dram_channel_width_in_bits; + vbios.number_of_dram_banks =8 ; + vbios.high_yclk =bw_int_to_fixed (6000 ); + vbios.mid_yclk =bw_int_to_fixed (3200 ); + vbios.low_yclk =bw_int_to_fixed (1000 ); + vbios.low_sclk =bw_int_to_fixed (678 ); + vbios.mid1_sclk =bw_int_to_fixed (864 ); + vbios.mid2_sclk =bw_int_to_fixed (900 ); + vbios.mid3_sclk =bw_int_to_fixed (920 ); + vbios.mid4_sclk =bw_int_to_fixed (940 ); + vbios.mid5_sclk =bw_int_to_fixed (960 ); + vbios.mid6_sclk =bw_int_to_fixed (980 ); + vbios.high_sclk =bw_int_to_fixed (1049 ); + vbios.low_voltage_max_dispclk =bw_int_to_fixed (459 ); + vbios.mid_voltage_max_dispclk =bw_int_to_fixed (654 ); + vbios.high_voltage_max_dispclk =bw_int_to_fixed (1108 ); + vbios.low_voltage_max_phyclk =bw_int_to_fixed (540 ); + vbios.mid_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.high_voltage_max_phyclk =bw_int_to_fixed (810 ); + vbios.data_return_bus_width =bw_int_to_fixed (32 ); + vbios.trc =bw_int_to_fixed (48 ); +if (vbios.number_of_dram_channels ==2 )// 64-bit + vbios.dmifmc_urgent_latency =bw_int_to_fixed (4 ); +else + vbios.dmifmc_urgent_latency =bw_int_to_fixed (3 ); + vbios.stutter_self_refresh_exit_latency =bw_int_to_fixed (5 ); + vbios.stutter_self_refresh_entry_latency =bw_int_to_fixed (0 ); + vbios.nbp_state_change_latency =bw_int_to_fixed (250 ); + vbios.mcifwrmc_urgent_latency =bw_int_to_fixed (10 ); + vbios.scatter_gather_enable = false; + vbios.down_spread_percentage =bw_frc_to_fixed (5 ,10 ); + vbios.cursor_width =32 ; + vbios.average_compression_rate =4 ; + vbios.number_of_request_slots_gmc_reserves_for_dmif_per_channel =256 ; + vbios.blackout_duration =bw_int_to_fixed (0 );/* us */ + vbios.maximum_blackout_recovery_time =bw_int_to_fixed (0 ); + + dceip.max_average_percent_of_ideal_port_bw_display_can_use_in_normal_system_operation =100 ; + dceip.max_average_percent_of_ideal_drambw_display_can_use_in_normal_system_operation =100 ; + dceip.percent_of_ideal_port_bw_received_after_urgent_latency =100 ; + dceip.large_cursor = false; + dceip.dmif_request_buffer_size =bw_int_to_fixed (768 ); + dceip.dmif_pipe_en_fbc_chunk_tracker = false; + dceip.cursor_max_outstanding_group_num =1 ; + dceip.lines_interleaved_into_lb =2 ; + dceip.chunk_width =256 ; + dceip.number_of_graphics_pipes =5 ; + dceip.number_of_underlay_pipes =0 ; + dceip.low_power_tiling_mode =0 ; + dceip.display_write_back_supported = true; + dceip.argb_compression_support = true; + dceip.underlay_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35556 ,10000 ); + dceip.underlay_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.underlay_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.underlay_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.graphics_vscaler_efficiency6_bit_per_component = +bw_frc_to_fixed (35 ,10 ); + dceip.graphics_vscaler_efficiency8_bit_per_component = +bw_frc_to_fixed (34286 ,10000 ); + dceip.graphics_vscaler_efficiency10_bit_per_component = +bw_frc_to_fixed (32 ,10 ); + dceip.graphics_vscaler_efficiency12_bit_per_component = +bw_int_to_fixed (3 ); + dceip.alpha_vscaler_efficiency =bw_int_to_fixed (3 ); + dceip.max_dmif_buffer_allocated =4 ; + dceip.graphics_dmif_size =12288 ; + dceip.underlay_luma_dmif_size =19456 ; + dceip.underlay_chroma_dmif_size =23552 ; + dceip.pre_downscaler_enabled = true; + dceip.underlay_downscale_prefetch_enabled = true; + dceip.lb_write_pixels_per_dispclk =bw_int_to_fixed (1 ); + dceip.lb_size_per_component444 =bw_int_to_fixed (245952 ); + dceip.graphics_lb_nodownscaling_multi_line_prefetching = true; + dceip.stutter_and_dram_clock_state_change_gated_before_cursor = +bw_int_to_fixed (1 ); + dceip.underlay420_luma_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.underlay420_chroma_lb_size_per_component = +bw_int_to_fixed (164352 ); + dceip.underlay422_lb_size_per_component =bw_int_to_fixed ( +82176 ); + dceip.cursor_chunk_width =bw_int_to_fixed (64 ); + dceip.cursor_dcp_buffer_lines =bw_int_to_fixed (4 ); + dceip.underlay_maximum_width_efficient_for_tiling = +bw_int_to_fixed (1920 ); + dceip.underlay_maximum_height_efficient_for_tiling = +bw_int_to_fixed (1080 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display = +bw_frc_to_fixed (3 ,10 ); + dceip.peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation = +bw_int_to_fixed (25 ); + dceip.minimum_outstanding_pte_request_limit =bw_int_to_fixed ( +2 ); + dceip.maximum_total_outstanding_pte_requests_allowed_by_saw = +bw_int_to_fixed (128 ); + dceip.limit_excessive_outstanding_dmif_requests = true; + dceip.linear_mode_line_request_alternation_slice = +bw_int_to_fixed (64 ); + dceip.scatter_gather_lines_of_pte_prefetching_in_linear_mode = +32 ; + dceip.display_write_back420_luma_mcifwr_buffer_size =12288 ; + dceip.display_write_back420_chroma_mcifwr_buffer_size =8192 ; + dceip.request_efficiency =bw_frc_to_fixed (8 ,10 ); + dceip.dispclk_per_request =bw_int_to_fixed (2 ); + dceip.dispclk_ramping_factor =bw_frc_to_fixed (105 ,100 ); + dceip.display_pipe_throughput_factor =bw_frc_to_fixed (105 ,100 ); + dceip.scatter_gather_pte_request_rows_in_tiling_mode =2 ; + dceip.mcifwr_all_surfaces_burst_time =bw_int_to_fixed (0 ); +break ;case BW_CALCS_VERSION_STONEY : vbios.memory_type = bw_def_gddr5; vbios.dram_channel_width_in_bits =64 ;
drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h +1 -0
@@ -42,6 +42,7 @@ enum bw_calcs_version {BW_CALCS_VERSION_CARRIZO ,BW_CALCS_VERSION_POLARIS10 ,BW_CALCS_VERSION_POLARIS11 , +BW_CALCS_VERSION_POLARIS12 ,BW_CALCS_VERSION_STONEY , BW_CALCS_VERSION_VEGA10 };
--
2.14.1
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/34 drm/amd/display: Rename feature-specific register address init macro
In reply to a message not in the archiveFrom: Nikola Cornij <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +6 -6
@@ -95,8 +95,8 @@SRI (DCN_SURF1_TTU_CNTL1 ,HUBPREQ , id),\SRI (HUBP_CLK_CNTL ,HUBP , id) -/* Register address initialization macro for "generic" ASICs with full functionality */ -#define HUBP_REG_LIST_DCN_GEN (id)\ +/* Register address initialization macro for ASICs with VM */ +#define HUBP_REG_LIST_DCN_VM (id)\ SRI(NOM_PARAMETERS_0, HUBPREQ, id),\ SRI(NOM_PARAMETERS_1, HUBPREQ, id),\ SRI(NOM_PARAMETERS_2, HUBPREQ, id),\
@@ -105,7 +105,7 @@#define HUBP_REG_LIST_DCN10 (id)\ HUBP_REG_LIST_DCN(id),\ - HUBP_REG_LIST_DCN_GEN(id),\ + HUBP_REG_LIST_DCN_VM(id),\ SRI(PREFETCH_SETTINS, HUBPREQ, id),\ SRI(PREFETCH_SETTINS_C, HUBPREQ, id),\ SRI(DCN_VM_CONTEXT0_PAGE_TABLE_BASE_ADDR_MSB, HUBPREQ, id),\
@@ -361,8 +361,8 @@HUBP_SF (HUBPREQ0_DCN_SURF0_TTU_CNTL1 ,REFCYC_PER_REQ_DELIVERY_PRE , mask_sh),\HUBP_SF (HUBP0_HUBP_CLK_CNTL ,HUBP_CLOCK_ENABLE , mask_sh) -/* Mask/shift struct generation macro for "generic" ASICs with full functionality */ -#define HUBP_MASK_SH_LIST_DCN_GEN (mask_sh)\ +/* Mask/shift struct generation macro for ASICs with VM */ +#define HUBP_MASK_SH_LIST_DCN_VM (mask_sh)\ HUBP_SF(HUBPREQ0_NOM_PARAMETERS_0, DST_Y_PER_PTE_ROW_NOM_L, mask_sh),\ HUBP_SF(HUBPREQ0_NOM_PARAMETERS_1, REFCYC_PER_PTE_GROUP_NOM_L, mask_sh),\ HUBP_SF(HUBPREQ0_NOM_PARAMETERS_2, DST_Y_PER_PTE_ROW_NOM_C, mask_sh),\
@@ -372,7 +372,7 @@#define HUBP_MASK_SH_LIST_DCN10 (mask_sh)\ HUBP_MASK_SH_LIST_DCN(mask_sh),\ - HUBP_MASK_SH_LIST_DCN_GEN(mask_sh),\ + HUBP_MASK_SH_LIST_DCN_VM(mask_sh),\ HUBP_SF(HUBPREQ0_PREFETCH_SETTINS, DST_Y_PREFETCH, mask_sh),\ HUBP_SF(HUBPREQ0_PREFETCH_SETTINS, VRATIO_PREFETCH, mask_sh),\ HUBP_SF(HUBPREQ0_PREFETCH_SETTINS_C, VRATIO_PREFETCH_C, mask_sh),\
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/34 drm/amd/display: Don't read EDID in atomic_check
In reply to a message not in the archiveWe shouldn't attempt to read EDID in atomic_check. We really shouldn't even be modifying the connector object, or any other non-state object, but this is a start at least.
Moving EDID cleanup to dm_dp_mst_connector_destroy from dm_dp_destroy_mst_connector to ensure the EDID is still available for headless mode.
--- .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 32 +++++++--------------- 1 file changed, 10 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +10 -22
@@ -161,6 +161,11 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector)struct amdgpu_dm_connector *amdgpu_dm_connector =to_amdgpu_dm_connector (connector);struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder; +if (amdgpu_dm_connector->edid) { +kfree (amdgpu_dm_connector->edid); + amdgpu_dm_connector->edid =NULL ; + } +drm_encoder_cleanup (&amdgpu_encoder->base);kfree (amdgpu_encoder);drm_connector_cleanup (connector);
@@ -181,28 +186,22 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = {void dm_dp_mst_dc_sink_create (struct drm_connector *connector) {struct amdgpu_dm_connector *aconnector =to_amdgpu_dm_connector (connector); -struct edid *edid;struct dc_sink *dc_sink;struct dc_sink_init_data init_params = { .link = aconnector->dc_link, .sink_signal =SIGNAL_TYPE_DISPLAY_PORT_MST }; +/* FIXME none of this is safe. we shouldn't touch aconnector here in +* atomic_check +*/ +/* * TODO: Need to further figure out why ddc.algo is NULL while MST port exists */ if (!aconnector->port || !aconnector->port->aux.ddc.algo)return ; - edid =drm_dp_mst_get_edid (connector, &aconnector->mst_port->mst_mgr, aconnector->port); - -if (!edid) { -drm_mode_connector_update_edid_property ( - &aconnector->base, -NULL ); -return ; - } - - aconnector->edid = edid; +ASSERT (aconnector->edid); dc_sink = dc_link_add_remote_sink( aconnector->dc_link,
@@ -215,9 +214,6 @@ void dm_dp_mst_dc_sink_create(struct drm_connector *connector)amdgpu_dm_add_sink_to_freesync_module ( connector, aconnector->edid); - -drm_mode_connector_update_edid_property ( - &aconnector->base, aconnector->edid); }static int dm_dp_mst_get_modes (struct drm_connector *connector)
@@ -424,14 +420,6 @@ static void dm_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,dc_sink_release (aconnector->dc_sink); aconnector->dc_sink =NULL ; } -if (aconnector->edid) { -kfree (aconnector->edid); - aconnector->edid =NULL ; - } - -drm_mode_connector_update_edid_property ( - &aconnector->base, -NULL ); aconnector->mst_connected = false; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/34 drm/amd/display: add mpc to dtn log
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 31 ++++++++++++++++------ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 17 ++++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h | 5 ++++ drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 15 +++++++++++ 4 files changed, 60 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +23 -8
@@ -121,20 +121,19 @@ void dcn10_log_hw_state(struct dc *dc)dcn10_log_hubbub_state (dc); -DTN_INFO ("HUBP:\t format \t addr_hi \t width \t height \t " -"rotation \t mirror \t sw_mode \t " -"dcc_en \t blank_en \t ttu_dis \t underflow \t " -"min_ttu_vblank \t qos_low_wm \t qos_high_wm \n" ); - +DTN_INFO ("HUBP: format addr_hi width height " +"rotation mirror sw_mode " +"dcc_en blank_en ttu_dis underflow " +"min_ttu_vblank qos_low_wm qos_high_wm\n" );for (i =0 ; i < pool->pipe_count; i++) {struct hubp *hubp = pool->hubps[i];struct dcn_hubp_state s;hubp1_read_state (TO_DCN10_HUBP (hubp), &s); - DTN_INFO("[%d]:\t %xh \t %xh \t %d \t %d \t " - "%xh \t %xh \t %xh \t " - "%d \t %d \t %d \t %xh \t", + DTN_INFO("[%-2d]: %5xh %6xh %5d %6d " + "%7xh %5xh %6xh " + "%6d %8d %7d %8xh \t", hubp->inst, s.pixel_format, s.inuse_addr_hi,
@@ -153,6 +152,22 @@ void dcn10_log_hw_state(struct dc *dc)DTN_INFO ("\n" ); }DTN_INFO ("\n" ); +for (i =0 ; i < pool->pipe_count; i++) { +struct output_pixel_processor *opp = pool->opps[i]; +struct mpcc *mpcc = opp->mpc_tree_params.opp_list; +struct mpcc_state s = {0 }; + +while (mpcc) { +ASSERT (opp->mpc_tree_params.opp_id == opp->inst); + pool->mpc->funcs->read_mpcc_state (pool->mpc, mpcc->mpcc_id, &s); +DTN_INFO ("[OPP%d - MPCC%d]: DPP%d MPCCBOT%x MODE:%d ALPHA_MODE:%d PREMULT:%d OVERLAP_ONLY:%d\n" , + s.opp_id, mpcc->mpcc_id, s.dpp_id, s.bot_mpcc_id, + s.mode, s.alpha_mode, s.pre_multiplied_alpha, s.overlap_only); + mpcc = mpcc->mpcc_bot; +ASSERT (!mpcc || mpcc->mpcc_id == s.bot_mpcc_id); + } + } +DTN_INFO ("\n" );DTN_INFO ("OTG:\t v_bs \t v_be \t v_ss \t v_se \t vpol \t vmax \t vmin \t " "h_bs \t h_be \t h_ss \t h_se \t hpol \t htot \t vtot \t underflow\n" );
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +17 -0
@@ -409,7 +409,24 @@ void mpc1_init_mpcc_list_from_hw( } } +void mpc1_read_mpcc_state ( +struct mpc *mpc, +int mpcc_inst, +struct mpcc_state *s) +{ +struct dcn10_mpc *mpc10 =TO_DCN10_MPC (mpc); + +REG_GET (MPCC_OPP_ID [mpcc_inst],MPCC_OPP_ID , &s->opp_id); +REG_GET (MPCC_TOP_SEL [mpcc_inst],MPCC_TOP_SEL , &s->dpp_id); +REG_GET (MPCC_BOT_SEL [mpcc_inst],MPCC_BOT_SEL , &s->bot_mpcc_id); +REG_GET_4 (MPCC_CONTROL [mpcc_inst],MPCC_MODE , &s->mode, +MPCC_ALPHA_BLND_MODE , &s->alpha_mode, +MPCC_ALPHA_MULTIPLIED_MODE , &s->pre_multiplied_alpha, +MPCC_BLND_ACTIVE_OVERLAP_ONLY , &s->pre_multiplied_alpha); +} +const struct mpc_funcs dcn10_mpc_funcs = { + .read_mpcc_state = mpc1_read_mpcc_state, .insert_plane = mpc1_insert_plane, .remove_mpcc = mpc1_remove_mpcc, .mpc_init = mpc1_mpc_init,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.h +5 -0
@@ -183,4 +183,9 @@ struct mpcc *mpc1_get_mpcc_for_dpp(struct mpc_tree *tree, int dpp_id); +void mpc1_read_mpcc_state ( +struct mpc *mpc, +int mpcc_inst, +struct mpcc_state *s); +#endif
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +15 -0
@@ -105,7 +105,22 @@ struct mpc {struct mpcc mpcc_array[MAX_MPCC ]; }; +struct mpcc_state { +uint32_t opp_id; +uint32_t dpp_id; +uint32_t bot_mpcc_id; +uint32_t mode; +uint32_t alpha_mode; +uint32_t pre_multiplied_alpha; +uint32_t overlap_only; +}; +struct mpc_funcs { +void (*read_mpcc_state)( +struct mpc *mpc, +int mpcc_inst, +struct mpcc_state *s); +/* * Insert DPP into MPC tree based on specified blending position. * Only used for planes that are part of blending chain for OPP output
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/34 drm/amd/display: Add debug prints for bandwidth calculations
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
Using the three functions we can print the dceip, vbios and data struct for bandwidth calculations. This is useful for debugging bandwidth calculation issues without a debugger
--- .../gpu/drm/amd/display/dc/calcs/calcs_logger.h | 579 +++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 6 + drivers/gpu/drm/amd/display/dc/dc.h | 1 + 3 files changed, 586 insertions(+) create mode 100644 drivers/gpu/drm/amd/display/dc/calcs/calcs_logger.h
drivers/gpu/drm/amd/display/dc/calcs/calcs_logger.h new file +579 -0
@@ -0,0 +1,579 @@ +/* +* 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 _CALCS_CALCS_LOGGER_H_ +#define _CALCS_CALCS_LOGGER_H_ +#define DC_LOGGER \ + logger + +static void print_bw_calcs_dceip (struct dal_logger *logger,const struct bw_calcs_dceip *dceip) +{ + +DC_LOG_BANDWIDTH_CALCS ("#####################################################################" ); +DC_LOG_BANDWIDTH_CALCS ("struct bw_calcs_dceip" ); +DC_LOG_BANDWIDTH_CALCS ("#####################################################################" ); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_calcs_version version %d" , dceip->version); +DC_LOG_BANDWIDTH_CALCS (" [bool] large_cursor: %d" , dceip->large_cursor); +DC_LOG_BANDWIDTH_CALCS (" [bool] dmif_pipe_en_fbc_chunk_tracker: %d" , dceip->dmif_pipe_en_fbc_chunk_tracker); +DC_LOG_BANDWIDTH_CALCS (" [bool] display_write_back_supported: %d" , dceip->display_write_back_supported); +DC_LOG_BANDWIDTH_CALCS (" [bool] argb_compression_support: %d" , dceip->argb_compression_support); +DC_LOG_BANDWIDTH_CALCS (" [bool] pre_downscaler_enabled: %d" , dceip->pre_downscaler_enabled); +DC_LOG_BANDWIDTH_CALCS (" [bool] underlay_downscale_prefetch_enabled: %d" , + dceip->underlay_downscale_prefetch_enabled); +DC_LOG_BANDWIDTH_CALCS (" [bool] graphics_lb_nodownscaling_multi_line_prefetching: %d" , + dceip->graphics_lb_nodownscaling_multi_line_prefetching); +DC_LOG_BANDWIDTH_CALCS (" [bool] limit_excessive_outstanding_dmif_requests: %d" , + dceip->limit_excessive_outstanding_dmif_requests); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] cursor_max_outstanding_group_num: %d" , + dceip->cursor_max_outstanding_group_num); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] lines_interleaved_into_lb: %d" , dceip->lines_interleaved_into_lb); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] low_power_tiling_mode: %d" , dceip->low_power_tiling_mode); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] chunk_width: %d" , dceip->chunk_width); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_graphics_pipes: %d" , dceip->number_of_graphics_pipes); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_underlay_pipes: %d" , dceip->number_of_underlay_pipes); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] max_dmif_buffer_allocated: %d" , dceip->max_dmif_buffer_allocated); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] graphics_dmif_size: %d" , dceip->graphics_dmif_size); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] underlay_luma_dmif_size: %d" , dceip->underlay_luma_dmif_size); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] underlay_chroma_dmif_size: %d" , dceip->underlay_chroma_dmif_size); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] scatter_gather_lines_of_pte_prefetching_in_linear_mode: %d" , + dceip->scatter_gather_lines_of_pte_prefetching_in_linear_mode); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] display_write_back420_luma_mcifwr_buffer_size: %d" , + dceip->display_write_back420_luma_mcifwr_buffer_size); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] display_write_back420_chroma_mcifwr_buffer_size: %d" , + dceip->display_write_back420_chroma_mcifwr_buffer_size); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] scatter_gather_pte_request_rows_in_tiling_mode: %d" , + dceip->scatter_gather_pte_request_rows_in_tiling_mode); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay_vscaler_efficiency10_bit_per_component: %d" , +bw_fixed_to_int (dceip->underlay_vscaler_efficiency10_bit_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay_vscaler_efficiency12_bit_per_component: %d" , +bw_fixed_to_int (dceip->underlay_vscaler_efficiency12_bit_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] graphics_vscaler_efficiency6_bit_per_component: %d" , +bw_fixed_to_int (dceip->graphics_vscaler_efficiency6_bit_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] graphics_vscaler_efficiency8_bit_per_component: %d" , +bw_fixed_to_int (dceip->graphics_vscaler_efficiency8_bit_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] graphics_vscaler_efficiency10_bit_per_component: %d" , +bw_fixed_to_int (dceip->graphics_vscaler_efficiency10_bit_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] graphics_vscaler_efficiency12_bit_per_component: %d" , +bw_fixed_to_int (dceip->graphics_vscaler_efficiency12_bit_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] alpha_vscaler_efficiency: %d" , +bw_fixed_to_int (dceip->alpha_vscaler_efficiency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_write_pixels_per_dispclk: %d" , +bw_fixed_to_int (dceip->lb_write_pixels_per_dispclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_size_per_component444: %d" , +bw_fixed_to_int (dceip->lb_size_per_component444)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_and_dram_clock_state_change_gated_before_cursor: %d" , +bw_fixed_to_int (dceip->stutter_and_dram_clock_state_change_gated_before_cursor)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay420_luma_lb_size_per_component: %d" , +bw_fixed_to_int (dceip->underlay420_luma_lb_size_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay420_chroma_lb_size_per_component: %d" , +bw_fixed_to_int (dceip->underlay420_chroma_lb_size_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay422_lb_size_per_component: %d" , +bw_fixed_to_int (dceip->underlay422_lb_size_per_component)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] cursor_chunk_width: %d" ,bw_fixed_to_int (dceip->cursor_chunk_width)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] cursor_dcp_buffer_lines: %d" , +bw_fixed_to_int (dceip->cursor_dcp_buffer_lines)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay_maximum_width_efficient_for_tiling: %d" , +bw_fixed_to_int (dceip->underlay_maximum_width_efficient_for_tiling)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay_maximum_height_efficient_for_tiling: %d" , +bw_fixed_to_int (dceip->underlay_maximum_height_efficient_for_tiling)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display: %d" , +bw_fixed_to_int (dceip->peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation: %d" , +bw_fixed_to_int (dceip->peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] minimum_outstanding_pte_request_limit: %d" , +bw_fixed_to_int (dceip->minimum_outstanding_pte_request_limit)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] maximum_total_outstanding_pte_requests_allowed_by_saw: %d" , +bw_fixed_to_int (dceip->maximum_total_outstanding_pte_requests_allowed_by_saw)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] linear_mode_line_request_alternation_slice: %d" , +bw_fixed_to_int (dceip->linear_mode_line_request_alternation_slice)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] request_efficiency: %d" ,bw_fixed_to_int (dceip->request_efficiency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_per_request: %d" ,bw_fixed_to_int (dceip->dispclk_per_request)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_ramping_factor: %d" , +bw_fixed_to_int (dceip->dispclk_ramping_factor)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_pipe_throughput_factor: %d" , +bw_fixed_to_int (dceip->display_pipe_throughput_factor)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwr_all_surfaces_burst_time: %d" , +bw_fixed_to_int (dceip->mcifwr_all_surfaces_burst_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_request_buffer_size: %d" , +bw_fixed_to_int (dceip->dmif_request_buffer_size)); + + +} + +static void print_bw_calcs_vbios (struct dal_logger *logger,const struct bw_calcs_vbios *vbios) +{ + +DC_LOG_BANDWIDTH_CALCS ("#####################################################################" ); +DC_LOG_BANDWIDTH_CALCS ("struct bw_calcs_vbios vbios" ); +DC_LOG_BANDWIDTH_CALCS ("#####################################################################" ); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines memory_type: %d" , vbios->memory_type); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines memory_type: %d" , vbios->memory_type); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] dram_channel_width_in_bits: %d" , vbios->dram_channel_width_in_bits); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_dram_channels: %d" , vbios->number_of_dram_channels); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_dram_banks: %d" , vbios->number_of_dram_banks); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] low_yclk: %d" ,bw_fixed_to_int (vbios->low_yclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid_yclk: %d" ,bw_fixed_to_int (vbios->mid_yclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] high_yclk: %d" ,bw_fixed_to_int (vbios->high_yclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] low_sclk: %d" ,bw_fixed_to_int (vbios->low_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid1_sclk: %d" ,bw_fixed_to_int (vbios->mid1_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid2_sclk: %d" ,bw_fixed_to_int (vbios->mid2_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid3_sclk: %d" ,bw_fixed_to_int (vbios->mid3_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid4_sclk: %d" ,bw_fixed_to_int (vbios->mid4_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid5_sclk: %d" ,bw_fixed_to_int (vbios->mid5_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid6_sclk: %d" ,bw_fixed_to_int (vbios->mid6_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] high_sclk: %d" ,bw_fixed_to_int (vbios->high_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] low_voltage_max_dispclk: %d" , +bw_fixed_to_int (vbios->low_voltage_max_dispclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid_voltage_max_dispclk;: %d" , +bw_fixed_to_int (vbios->mid_voltage_max_dispclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] high_voltage_max_dispclk;: %d" , +bw_fixed_to_int (vbios->high_voltage_max_dispclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] low_voltage_max_phyclk: %d" , +bw_fixed_to_int (vbios->low_voltage_max_phyclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mid_voltage_max_phyclk: %d" , +bw_fixed_to_int (vbios->mid_voltage_max_phyclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] high_voltage_max_phyclk: %d" , +bw_fixed_to_int (vbios->high_voltage_max_phyclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] data_return_bus_width: %d" ,bw_fixed_to_int (vbios->data_return_bus_width)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] trc: %d" ,bw_fixed_to_int (vbios->trc)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmifmc_urgent_latency: %d" ,bw_fixed_to_int (vbios->dmifmc_urgent_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_self_refresh_exit_latency: %d" , +bw_fixed_to_int (vbios->stutter_self_refresh_exit_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_self_refresh_entry_latency: %d" , +bw_fixed_to_int (vbios->stutter_self_refresh_entry_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] nbp_state_change_latency: %d" , +bw_fixed_to_int (vbios->nbp_state_change_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwrmc_urgent_latency: %d" , +bw_fixed_to_int (vbios->mcifwrmc_urgent_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bool] scatter_gather_enable: %d" , vbios->scatter_gather_enable); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] down_spread_percentage: %d" , +bw_fixed_to_int (vbios->down_spread_percentage)); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] cursor_width: %d" , vbios->cursor_width); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] average_compression_rate: %d" , vbios->average_compression_rate); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_request_slots_gmc_reserves_for_dmif_per_channel: %d" , + vbios->number_of_request_slots_gmc_reserves_for_dmif_per_channel); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] blackout_duration: %d" ,bw_fixed_to_int (vbios->blackout_duration)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] maximum_blackout_recovery_time: %d" , +bw_fixed_to_int (vbios->maximum_blackout_recovery_time)); + + +} + +static void print_bw_calcs_data (struct dal_logger *logger,struct bw_calcs_data *data) +{ + +int i, j, k; + +DC_LOG_BANDWIDTH_CALCS ("#####################################################################" ); +DC_LOG_BANDWIDTH_CALCS ("struct bw_calcs_data data" ); +DC_LOG_BANDWIDTH_CALCS ("#####################################################################" ); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_displays: %d" , data->number_of_displays); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines underlay_surface_type: %d" , data->underlay_surface_type); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines panning_and_bezel_adjustment: %d" , + data->panning_and_bezel_adjustment); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines graphics_tiling_mode: %d" , data->graphics_tiling_mode); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] graphics_lb_bpc: %d" , data->graphics_lb_bpc); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] underlay_lb_bpc: %d" , data->underlay_lb_bpc); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines underlay_tiling_mode: %d" , data->underlay_tiling_mode); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines d0_underlay_mode: %d" , data->d0_underlay_mode); +DC_LOG_BANDWIDTH_CALCS (" [bool] d1_display_write_back_dwb_enable: %d" , data->d1_display_write_back_dwb_enable); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines d1_underlay_mode: %d" , data->d1_underlay_mode); +DC_LOG_BANDWIDTH_CALCS (" [bool] cpup_state_change_enable: %d" , data->cpup_state_change_enable); +DC_LOG_BANDWIDTH_CALCS (" [bool] cpuc_state_change_enable: %d" , data->cpuc_state_change_enable); +DC_LOG_BANDWIDTH_CALCS (" [bool] nbp_state_change_enable: %d" , data->nbp_state_change_enable); +DC_LOG_BANDWIDTH_CALCS (" [bool] stutter_mode_enable: %d" , data->stutter_mode_enable); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] y_clk_level: %d" , data->y_clk_level); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] sclk_level: %d" , data->sclk_level); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_underlay_surfaces: %d" , data->number_of_underlay_surfaces); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_dram_wrchannels: %d" , data->number_of_dram_wrchannels); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] chunk_request_delay: %d" , data->chunk_request_delay); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] number_of_dram_channels: %d" , data->number_of_dram_channels); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines underlay_micro_tile_mode: %d" , data->underlay_micro_tile_mode); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines graphics_micro_tile_mode: %d" , data->graphics_micro_tile_mode); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] max_phyclk: %d" ,bw_fixed_to_int (data->max_phyclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dram_efficiency: %d" ,bw_fixed_to_int (data->dram_efficiency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_width_after_surface_type: %d" , +bw_fixed_to_int (data->src_width_after_surface_type)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_height_after_surface_type: %d" , +bw_fixed_to_int (data->src_height_after_surface_type)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] hsr_after_surface_type: %d" , +bw_fixed_to_int (data->hsr_after_surface_type)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] vsr_after_surface_type: %d" ,bw_fixed_to_int (data->vsr_after_surface_type)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_width_after_rotation: %d" , +bw_fixed_to_int (data->src_width_after_rotation)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_height_after_rotation: %d" , +bw_fixed_to_int (data->src_height_after_rotation)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] hsr_after_rotation: %d" ,bw_fixed_to_int (data->hsr_after_rotation)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] vsr_after_rotation: %d" ,bw_fixed_to_int (data->vsr_after_rotation)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] source_height_pixels: %d" ,bw_fixed_to_int (data->source_height_pixels)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] hsr_after_stereo: %d" ,bw_fixed_to_int (data->hsr_after_stereo)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] vsr_after_stereo: %d" ,bw_fixed_to_int (data->vsr_after_stereo)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] source_width_in_lb: %d" ,bw_fixed_to_int (data->source_width_in_lb)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_line_pitch: %d" ,bw_fixed_to_int (data->lb_line_pitch)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] underlay_maximum_source_efficient_for_tiling: %d" , +bw_fixed_to_int (data->underlay_maximum_source_efficient_for_tiling)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] num_lines_at_frame_start: %d" , +bw_fixed_to_int (data->num_lines_at_frame_start)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_dmif_size_in_time: %d" ,bw_fixed_to_int (data->min_dmif_size_in_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_mcifwr_size_in_time: %d" , +bw_fixed_to_int (data->min_mcifwr_size_in_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_requests_for_dmif_size: %d" , +bw_fixed_to_int (data->total_requests_for_dmif_size)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] peak_pte_request_to_eviction_ratio_limiting: %d" , +bw_fixed_to_int (data->peak_pte_request_to_eviction_ratio_limiting)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] useful_pte_per_pte_request: %d" , +bw_fixed_to_int (data->useful_pte_per_pte_request)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_pte_request_rows: %d" , +bw_fixed_to_int (data->scatter_gather_pte_request_rows)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_row_height: %d" , +bw_fixed_to_int (data->scatter_gather_row_height)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_pte_requests_in_vblank: %d" , +bw_fixed_to_int (data->scatter_gather_pte_requests_in_vblank)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] inefficient_linear_pitch_in_bytes: %d" , +bw_fixed_to_int (data->inefficient_linear_pitch_in_bytes)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] cursor_total_data: %d" ,bw_fixed_to_int (data->cursor_total_data)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] cursor_total_request_groups: %d" , +bw_fixed_to_int (data->cursor_total_request_groups)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_total_pte_requests: %d" , +bw_fixed_to_int (data->scatter_gather_total_pte_requests)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_total_pte_request_groups: %d" , +bw_fixed_to_int (data->scatter_gather_total_pte_request_groups)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] tile_width_in_pixels: %d" ,bw_fixed_to_int (data->tile_width_in_pixels)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_total_number_of_data_request_page_close_open: %d" , +bw_fixed_to_int (data->dmif_total_number_of_data_request_page_close_open)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwr_total_number_of_data_request_page_close_open: %d" , +bw_fixed_to_int (data->mcifwr_total_number_of_data_request_page_close_open)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] bytes_per_page_close_open: %d" , +bw_fixed_to_int (data->bytes_per_page_close_open)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwr_total_page_close_open_time: %d" , +bw_fixed_to_int (data->mcifwr_total_page_close_open_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_requests_for_adjusted_dmif_size: %d" , +bw_fixed_to_int (data->total_requests_for_adjusted_dmif_size)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_dmifmc_urgent_trips: %d" , +bw_fixed_to_int (data->total_dmifmc_urgent_trips)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_dmifmc_urgent_latency: %d" , +bw_fixed_to_int (data->total_dmifmc_urgent_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_display_reads_required_data: %d" , +bw_fixed_to_int (data->total_display_reads_required_data)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_display_reads_required_dram_access_data: %d" , +bw_fixed_to_int (data->total_display_reads_required_dram_access_data)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_display_writes_required_data: %d" , +bw_fixed_to_int (data->total_display_writes_required_data)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_display_writes_required_dram_access_data: %d" , +bw_fixed_to_int (data->total_display_writes_required_dram_access_data)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_reads_required_data: %d" , +bw_fixed_to_int (data->display_reads_required_data)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_reads_required_dram_access_data: %d" , +bw_fixed_to_int (data->display_reads_required_dram_access_data)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_total_page_close_open_time: %d" , +bw_fixed_to_int (data->dmif_total_page_close_open_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_cursor_memory_interface_buffer_size_in_time: %d" , +bw_fixed_to_int (data->min_cursor_memory_interface_buffer_size_in_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_read_buffer_size_in_time: %d" , +bw_fixed_to_int (data->min_read_buffer_size_in_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_reads_time_for_data_transfer: %d" , +bw_fixed_to_int (data->display_reads_time_for_data_transfer)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_writes_time_for_data_transfer: %d" , +bw_fixed_to_int (data->display_writes_time_for_data_transfer)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_required_dram_bandwidth: %d" , +bw_fixed_to_int (data->dmif_required_dram_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwr_required_dram_bandwidth: %d" , +bw_fixed_to_int (data->mcifwr_required_dram_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] required_dmifmc_urgent_latency_for_page_close_open: %d" , +bw_fixed_to_int (data->required_dmifmc_urgent_latency_for_page_close_open)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] required_mcifmcwr_urgent_latency: %d" , +bw_fixed_to_int (data->required_mcifmcwr_urgent_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] required_dram_bandwidth_gbyte_per_second: %d" , +bw_fixed_to_int (data->required_dram_bandwidth_gbyte_per_second)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dram_bandwidth: %d" ,bw_fixed_to_int (data->dram_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_required_sclk: %d" ,bw_fixed_to_int (data->dmif_required_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwr_required_sclk: %d" ,bw_fixed_to_int (data->mcifwr_required_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] required_sclk: %d" ,bw_fixed_to_int (data->required_sclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] downspread_factor: %d" ,bw_fixed_to_int (data->downspread_factor)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] v_scaler_efficiency: %d" ,bw_fixed_to_int (data->v_scaler_efficiency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scaler_limits_factor: %d" ,bw_fixed_to_int (data->scaler_limits_factor)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_pipe_pixel_throughput: %d" , +bw_fixed_to_int (data->display_pipe_pixel_throughput)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_dispclk_required_with_ramping: %d" , +bw_fixed_to_int (data->total_dispclk_required_with_ramping)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_dispclk_required_without_ramping: %d" , +bw_fixed_to_int (data->total_dispclk_required_without_ramping)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_read_request_bandwidth: %d" , +bw_fixed_to_int (data->total_read_request_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_write_request_bandwidth: %d" , +bw_fixed_to_int (data->total_write_request_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_required_for_total_read_request_bandwidth: %d" , +bw_fixed_to_int (data->dispclk_required_for_total_read_request_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_dispclk_required_with_ramping_with_request_bandwidth: %d" , +bw_fixed_to_int (data->total_dispclk_required_with_ramping_with_request_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_dispclk_required_without_ramping_with_request_bandwidth: %d" , +bw_fixed_to_int (data->total_dispclk_required_without_ramping_with_request_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk: %d" ,bw_fixed_to_int (data->dispclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] blackout_recovery_time: %d" ,bw_fixed_to_int (data->blackout_recovery_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_pixels_per_data_fifo_entry: %d" , +bw_fixed_to_int (data->min_pixels_per_data_fifo_entry)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] sclk_deep_sleep: %d" ,bw_fixed_to_int (data->sclk_deep_sleep)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] chunk_request_time: %d" ,bw_fixed_to_int (data->chunk_request_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] cursor_request_time: %d" ,bw_fixed_to_int (data->cursor_request_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] line_source_pixels_transfer_time: %d" , +bw_fixed_to_int (data->line_source_pixels_transfer_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmifdram_access_efficiency: %d" , +bw_fixed_to_int (data->dmifdram_access_efficiency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwrdram_access_efficiency: %d" , +bw_fixed_to_int (data->mcifwrdram_access_efficiency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_average_bandwidth_no_compression: %d" , +bw_fixed_to_int (data->total_average_bandwidth_no_compression)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_average_bandwidth: %d" , +bw_fixed_to_int (data->total_average_bandwidth)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] total_stutter_cycle_duration: %d" , +bw_fixed_to_int (data->total_stutter_cycle_duration)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_burst_time: %d" ,bw_fixed_to_int (data->stutter_burst_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] time_in_self_refresh: %d" ,bw_fixed_to_int (data->time_in_self_refresh)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_efficiency: %d" ,bw_fixed_to_int (data->stutter_efficiency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] worst_number_of_trips_to_memory: %d" , +bw_fixed_to_int (data->worst_number_of_trips_to_memory)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] immediate_flip_time: %d" ,bw_fixed_to_int (data->immediate_flip_time)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] latency_for_non_dmif_clients: %d" , +bw_fixed_to_int (data->latency_for_non_dmif_clients)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] latency_for_non_mcifwr_clients: %d" , +bw_fixed_to_int (data->latency_for_non_mcifwr_clients)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmifmc_urgent_latency_supported_in_high_sclk_and_yclk: %d" , +bw_fixed_to_int (data->dmifmc_urgent_latency_supported_in_high_sclk_and_yclk)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] nbp_state_dram_speed_change_margin: %d" , +bw_fixed_to_int (data->nbp_state_dram_speed_change_margin)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_reads_time_for_data_transfer_and_urgent_latency: %d" , +bw_fixed_to_int (data->display_reads_time_for_data_transfer_and_urgent_latency)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dram_speed_change_margin: %d" , +bw_fixed_to_int (data->dram_speed_change_margin)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_vblank_dram_speed_change_margin: %d" , +bw_fixed_to_int (data->min_vblank_dram_speed_change_margin)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_stutter_refresh_duration: %d" , +bw_fixed_to_int (data->min_stutter_refresh_duration)); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] total_stutter_dmif_buffer_size: %d" , data->total_stutter_dmif_buffer_size); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] total_bytes_requested: %d" , data->total_bytes_requested); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] min_stutter_dmif_buffer_size: %d" , data->min_stutter_dmif_buffer_size); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] num_stutter_bursts: %d" , data->num_stutter_bursts); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] v_blank_nbp_state_dram_speed_change_latency_supported: %d" , +bw_fixed_to_int (data->v_blank_nbp_state_dram_speed_change_latency_supported)); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] nbp_state_dram_speed_change_latency_supported: %d" , +bw_fixed_to_int (data->nbp_state_dram_speed_change_latency_supported)); + +for (i =0 ; i < maximum_number_of_surfaces; i++) { +DC_LOG_BANDWIDTH_CALCS (" [bool] fbc_en[%d]:%d\n" , i, data->fbc_en[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] lpt_en[%d]:%d" , i, data->lpt_en[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] displays_match_flag[%d]:%d" , i, data->displays_match_flag[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] use_alpha[%d]:%d" , i, data->use_alpha[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] orthogonal_rotation[%d]:%d" , i, data->orthogonal_rotation[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] enable[%d]:%d" , i, data->enable[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] access_one_channel_only[%d]:%d" , i, data->access_one_channel_only[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] scatter_gather_enable_for_pipe[%d]:%d" , + i, data->scatter_gather_enable_for_pipe[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] interlace_mode[%d]:%d" , + i, data->interlace_mode[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] display_pstate_change_enable[%d]:%d" , + i, data->display_pstate_change_enable[i]); +DC_LOG_BANDWIDTH_CALCS (" [bool] line_buffer_prefetch[%d]:%d" , i, data->line_buffer_prefetch[i]); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] bytes_per_pixel[%d]:%d" , i, data->bytes_per_pixel[i]); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] max_chunks_non_fbc_mode[%d]:%d" , + i, data->max_chunks_non_fbc_mode[i]); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] lb_bpc[%d]:%d" , i, data->lb_bpc[i]); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] output_bpphdmi[%d]:%d" , i, data->output_bpphdmi[i]); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] output_bppdp4_lane_hbr[%d]:%d" , i, data->output_bppdp4_lane_hbr[i]); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] output_bppdp4_lane_hbr2[%d]:%d" , + i, data->output_bppdp4_lane_hbr2[i]); +DC_LOG_BANDWIDTH_CALCS (" [uint32_t] output_bppdp4_lane_hbr3[%d]:%d" , + i, data->output_bppdp4_lane_hbr3[i]); +DC_LOG_BANDWIDTH_CALCS (" [enum] bw_defines stereo_mode[%d]:%d" , i, data->stereo_mode[i]); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_buffer_transfer_time[%d]:%d" , + i,bw_fixed_to_int (data->dmif_buffer_transfer_time[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] displays_with_same_mode[%d]:%d" , + i,bw_fixed_to_int (data->displays_with_same_mode[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_dmif_buffer_size[%d]:%d" , + i,bw_fixed_to_int (data->stutter_dmif_buffer_size[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_refresh_duration[%d]:%d" , + i,bw_fixed_to_int (data->stutter_refresh_duration[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_exit_watermark[%d]:%d" , + i,bw_fixed_to_int (data->stutter_exit_watermark[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_entry_watermark[%d]:%d" , + i,bw_fixed_to_int (data->stutter_entry_watermark[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] h_total[%d]:%d" , i,bw_fixed_to_int (data->h_total[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] v_total[%d]:%d" , i,bw_fixed_to_int (data->v_total[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] pixel_rate[%d]:%d" , i,bw_fixed_to_int (data->pixel_rate[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_width[%d]:%d" , i,bw_fixed_to_int (data->src_width[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] pitch_in_pixels[%d]:%d" , + i,bw_fixed_to_int (data->pitch_in_pixels[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] pitch_in_pixels_after_surface_type[%d]:%d" , + i,bw_fixed_to_int (data->pitch_in_pixels_after_surface_type[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_height[%d]:%d" , i,bw_fixed_to_int (data->src_height[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scale_ratio[%d]:%d" , i,bw_fixed_to_int (data->scale_ratio[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] h_taps[%d]:%d" , i,bw_fixed_to_int (data->h_taps[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] v_taps[%d]:%d" , i,bw_fixed_to_int (data->v_taps[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] h_scale_ratio[%d]:%d" , i,bw_fixed_to_int (data->h_scale_ratio[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] v_scale_ratio[%d]:%d" , i,bw_fixed_to_int (data->v_scale_ratio[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] rotation_angle[%d]:%d" , + i,bw_fixed_to_int (data->rotation_angle[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] compression_rate[%d]:%d" , + i,bw_fixed_to_int (data->compression_rate[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] hsr[%d]:%d" , i,bw_fixed_to_int (data->hsr[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] vsr[%d]:%d" , i,bw_fixed_to_int (data->vsr[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] source_width_rounded_up_to_chunks[%d]:%d" , + i,bw_fixed_to_int (data->source_width_rounded_up_to_chunks[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] source_width_pixels[%d]:%d" , + i,bw_fixed_to_int (data->source_width_pixels[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] source_height_rounded_up_to_chunks[%d]:%d" , + i,bw_fixed_to_int (data->source_height_rounded_up_to_chunks[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] display_bandwidth[%d]:%d" , + i,bw_fixed_to_int (data->display_bandwidth[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] request_bandwidth[%d]:%d" , + i,bw_fixed_to_int (data->request_bandwidth[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] bytes_per_request[%d]:%d" , + i,bw_fixed_to_int (data->bytes_per_request[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] useful_bytes_per_request[%d]:%d" , + i,bw_fixed_to_int (data->useful_bytes_per_request[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lines_interleaved_in_mem_access[%d]:%d" , + i,bw_fixed_to_int (data->lines_interleaved_in_mem_access[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] latency_hiding_lines[%d]:%d" , + i,bw_fixed_to_int (data->latency_hiding_lines[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_partitions[%d]:%d" , + i,bw_fixed_to_int (data->lb_partitions[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_partitions_max[%d]:%d" , + i,bw_fixed_to_int (data->lb_partitions_max[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_required_with_ramping[%d]:%d" , + i,bw_fixed_to_int (data->dispclk_required_with_ramping[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_required_without_ramping[%d]:%d" , + i,bw_fixed_to_int (data->dispclk_required_without_ramping[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] data_buffer_size[%d]:%d" , + i,bw_fixed_to_int (data->data_buffer_size[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] outstanding_chunk_request_limit[%d]:%d" , + i,bw_fixed_to_int (data->outstanding_chunk_request_limit[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] urgent_watermark[%d]:%d" , + i,bw_fixed_to_int (data->urgent_watermark[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] nbp_state_change_watermark[%d]:%d" , + i,bw_fixed_to_int (data->nbp_state_change_watermark[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] v_filter_init[%d]:%d" , i,bw_fixed_to_int (data->v_filter_init[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] stutter_cycle_duration[%d]:%d" , + i,bw_fixed_to_int (data->stutter_cycle_duration[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] average_bandwidth[%d]:%d" , + i,bw_fixed_to_int (data->average_bandwidth[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] average_bandwidth_no_compression[%d]:%d" , + i,bw_fixed_to_int (data->average_bandwidth_no_compression[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_pte_request_limit[%d]:%d" , + i,bw_fixed_to_int (data->scatter_gather_pte_request_limit[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_size_per_component[%d]:%d" , + i,bw_fixed_to_int (data->lb_size_per_component[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] memory_chunk_size_in_bytes[%d]:%d" , + i,bw_fixed_to_int (data->memory_chunk_size_in_bytes[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] pipe_chunk_size_in_bytes[%d]:%d" , + i,bw_fixed_to_int (data->pipe_chunk_size_in_bytes[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] number_of_trips_to_memory_for_getting_apte_row[%d]:%d" , + i,bw_fixed_to_int (data->number_of_trips_to_memory_for_getting_apte_row[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] adjusted_data_buffer_size[%d]:%d" , + i,bw_fixed_to_int (data->adjusted_data_buffer_size[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] adjusted_data_buffer_size_in_memory[%d]:%d" , + i,bw_fixed_to_int (data->adjusted_data_buffer_size_in_memory[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] pixels_per_data_fifo_entry[%d]:%d" , + i,bw_fixed_to_int (data->pixels_per_data_fifo_entry[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_pte_requests_in_row[%d]:%d" , + i,bw_fixed_to_int (data->scatter_gather_pte_requests_in_row[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] pte_request_per_chunk[%d]:%d" , + i,bw_fixed_to_int (data->pte_request_per_chunk[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_page_width[%d]:%d" , + i,bw_fixed_to_int (data->scatter_gather_page_width[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] scatter_gather_page_height[%d]:%d" , + i,bw_fixed_to_int (data->scatter_gather_page_height[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_lines_in_per_line_out_in_beginning_of_frame[%d]:%d" , + i,bw_fixed_to_int (data->lb_lines_in_per_line_out_in_beginning_of_frame[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] lb_lines_in_per_line_out_in_middle_of_frame[%d]:%d" , + i,bw_fixed_to_int (data->lb_lines_in_per_line_out_in_middle_of_frame[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] cursor_width_pixels[%d]:%d" , + i,bw_fixed_to_int (data->cursor_width_pixels[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] minimum_latency_hiding[%d]:%d" , + i,bw_fixed_to_int (data->minimum_latency_hiding[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] maximum_latency_hiding[%d]:%d" , + i,bw_fixed_to_int (data->maximum_latency_hiding[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] minimum_latency_hiding_with_cursor[%d]:%d" , + i,bw_fixed_to_int (data->minimum_latency_hiding_with_cursor[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] maximum_latency_hiding_with_cursor[%d]:%d" , + i,bw_fixed_to_int (data->maximum_latency_hiding_with_cursor[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_pixels_for_first_output_pixel[%d]:%d" , + i,bw_fixed_to_int (data->src_pixels_for_first_output_pixel[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_pixels_for_last_output_pixel[%d]:%d" , + i,bw_fixed_to_int (data->src_pixels_for_last_output_pixel[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_data_for_first_output_pixel[%d]:%d" , + i,bw_fixed_to_int (data->src_data_for_first_output_pixel[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] src_data_for_last_output_pixel[%d]:%d" , + i,bw_fixed_to_int (data->src_data_for_last_output_pixel[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] active_time[%d]:%d" , i,bw_fixed_to_int (data->active_time[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] horizontal_blank_and_chunk_granularity_factor[%d]:%d" , + i,bw_fixed_to_int (data->horizontal_blank_and_chunk_granularity_factor[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] cursor_latency_hiding[%d]:%d" , + i,bw_fixed_to_int (data->cursor_latency_hiding[i])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] v_blank_dram_speed_change_margin[%d]:%d" , + i,bw_fixed_to_int (data->v_blank_dram_speed_change_margin[i])); + } + +for (i =0 ; i < maximum_number_of_surfaces; i++) { +for (j =0 ; j <3 ; j++) { +for (k =0 ; k <8 ; k++) { + +DC_LOG_BANDWIDTH_CALCS ("\n [bw_fixed] line_source_transfer_time[%d][%d][%d]:%d" , + i, j, k,bw_fixed_to_int (data->line_source_transfer_time[i][j][k])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dram_speed_change_line_source_transfer_time[%d][%d][%d]:%d" , + i, j, k, +bw_fixed_to_int (data->dram_speed_change_line_source_transfer_time[i][j][k])); + } + } + } + +for (i =0 ; i <3 ; i++) { +for (j =0 ; j <8 ; j++) { + +DC_LOG_BANDWIDTH_CALCS ("\n [uint32_t] num_displays_with_margin[%d][%d]:%d" , + i, j, data->num_displays_with_margin[i][j]); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_burst_time[%d][%d]:%d" , + i, j,bw_fixed_to_int (data->dmif_burst_time[i][j])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] mcifwr_burst_time[%d][%d]:%d" , + i, j,bw_fixed_to_int (data->mcifwr_burst_time[i][j])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] min_dram_speed_change_margin[%d][%d]:%d" , + i, j,bw_fixed_to_int (data->min_dram_speed_change_margin[i][j])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_required_for_dram_speed_change[%d][%d]:%d" , + i, j,bw_fixed_to_int (data->dispclk_required_for_dram_speed_change[i][j])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] blackout_duration_margin[%d][%d]:%d" , + i, j,bw_fixed_to_int (data->blackout_duration_margin[i][j])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_required_for_blackout_duration[%d][%d]:%d" , + i, j,bw_fixed_to_int (data->dispclk_required_for_blackout_duration[i][j])); +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dispclk_required_for_blackout_recovery[%d][%d]:%d" , + i, j,bw_fixed_to_int (data->dispclk_required_for_blackout_recovery[i][j])); + } + } + +for (i =0 ; i <6 ; i++) { +DC_LOG_BANDWIDTH_CALCS (" [bw_fixed] dmif_required_sclk_for_urgent_latency[%d]:%d" , + i,bw_fixed_to_int (data->dmif_required_sclk_for_urgent_latency[i])); + } +} +; + +#endif /* _CALCS_CALCS_LOGGER_H_ */
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +6 -0
@@ -28,6 +28,7 @@#include "dc.h" #include "core_types.h" #include "dal_asic_id.h" +#include "calcs_logger.h" /* * NOTE:
@@ -2990,6 +2991,11 @@ bool bw_calcs(struct dc_context *ctx,struct bw_fixed mid_yclk = vbios->mid_yclk;struct bw_fixed low_yclk = vbios->low_yclk; +if (ctx->dc->debug.bandwidth_calcs_trace) { +print_bw_calcs_dceip (ctx->logger, dceip); +print_bw_calcs_vbios (ctx->logger, vbios); +print_bw_calcs_data (ctx->logger, data); + }calculate_bandwidth (dceip, vbios, data); yclk_lvl = data->y_clk_level;
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -202,6 +202,7 @@ struct dc_debug {bool timing_trace;bool clock_trace;bool validation_trace; +bool bandwidth_calcs_trace;/* stutter efficiency related */ bool disable_stutter;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/34 drm/amd/display: Don't call amdgpu_dm_display_resume as it doesn't exist
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
amdgpu_dm_display_resume was merged into dm_resume. No need to call these functions separately.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -1
@@ -1632,7 +1632,6 @@ static ssize_t s3_debug_store(struct device *device,if (ret ==0 ) {if (s3_state) {dm_resume (adev); -amdgpu_dm_display_resume (adev);drm_kms_helper_hotplug_event (adev->ddev); }else dm_suspend (adev);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/34 drm/amd/display: Adding stutter entry wm to dce bw struct
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
Adding the stutter_entry_wm object to dce_bw_output struct and populating it with bw calculations data
--- drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 111 ++++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 + 2 files changed, 110 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c +109 -2
@@ -3091,7 +3091,33 @@ bool bw_calcs(struct dc_context *ctx,bw_fixed_to_int (bw_mul (data-> stutter_exit_watermark[9 ],bw_int_to_fixed (1000 ))); - + calcs_output->stutter_entry_wm_ns[0 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[4 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[1 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[5 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[2 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[6 ],bw_int_to_fixed (1000 ))); +if (ctx->dc->caps.max_slave_planes) { + calcs_output->stutter_entry_wm_ns[3 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[0 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[1 ],bw_int_to_fixed (1000 ))); + }else { + calcs_output->stutter_entry_wm_ns[3 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[7 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[8 ],bw_int_to_fixed (1000 ))); + } + calcs_output->stutter_entry_wm_ns[5 ].a_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[9 ],bw_int_to_fixed (1000 ))); calcs_output->urgent_wm_ns[0 ].a_mark = bw_fixed_to_int(bw_mul(data->
@@ -3186,7 +3212,33 @@ bool bw_calcs(struct dc_context *ctx,bw_fixed_to_int (bw_mul (data-> stutter_exit_watermark[9 ],bw_int_to_fixed (1000 ))); - + calcs_output->stutter_entry_wm_ns[0 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[4 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[1 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[5 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[2 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[6 ],bw_int_to_fixed (1000 ))); +if (ctx->dc->caps.max_slave_planes) { + calcs_output->stutter_entry_wm_ns[3 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[0 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[1 ],bw_int_to_fixed (1000 ))); + }else { + calcs_output->stutter_entry_wm_ns[3 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[7 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[8 ],bw_int_to_fixed (1000 ))); + } + calcs_output->stutter_entry_wm_ns[5 ].b_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[9 ],bw_int_to_fixed (1000 ))); calcs_output->urgent_wm_ns[0 ].b_mark = bw_fixed_to_int(bw_mul(data->
@@ -3279,6 +3331,34 @@ bool bw_calcs(struct dc_context *ctx,bw_fixed_to_int (bw_mul (data-> stutter_exit_watermark[9 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[0 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[4 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[1 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[5 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[2 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[6 ],bw_int_to_fixed (1000 ))); +if (ctx->dc->caps.max_slave_planes) { + calcs_output->stutter_entry_wm_ns[3 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[0 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[1 ],bw_int_to_fixed (1000 ))); + }else { + calcs_output->stutter_entry_wm_ns[3 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[7 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[8 ],bw_int_to_fixed (1000 ))); + } + calcs_output->stutter_entry_wm_ns[5 ].c_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[9 ],bw_int_to_fixed (1000 ))); + calcs_output->urgent_wm_ns[0 ].c_mark =bw_fixed_to_int (bw_mul (data-> urgent_watermark[4 ],bw_int_to_fixed (1000 )));
@@ -3383,6 +3463,33 @@ bool bw_calcs(struct dc_context *ctx,bw_fixed_to_int (bw_mul (data-> stutter_exit_watermark[9 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[0 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[4 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[1 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[5 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[2 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[6 ],bw_int_to_fixed (1000 ))); +if (ctx->dc->caps.max_slave_planes) { + calcs_output->stutter_entry_wm_ns[3 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[0 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[1 ],bw_int_to_fixed (1000 ))); + }else { + calcs_output->stutter_entry_wm_ns[3 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[7 ],bw_int_to_fixed (1000 ))); + calcs_output->stutter_entry_wm_ns[4 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[8 ],bw_int_to_fixed (1000 ))); + } + calcs_output->stutter_entry_wm_ns[5 ].d_mark = +bw_fixed_to_int (bw_mul (data-> + stutter_entry_watermark[9 ],bw_int_to_fixed (1000 ))); calcs_output->urgent_wm_ns[0 ].d_mark = bw_fixed_to_int(bw_mul(data->
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -0
@@ -250,6 +250,7 @@ struct dce_bw_output {bool all_displays_in_sync;struct dce_watermarks urgent_wm_ns[MAX_PIPES ];struct dce_watermarks stutter_exit_wm_ns[MAX_PIPES ]; +struct dce_watermarks stutter_entry_wm_ns[MAX_PIPES ];struct dce_watermarks nbp_state_change_wm_ns[MAX_PIPES ];int sclk_khz;int sclk_deep_sleep_khz;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/34 drm/amd/display: Change wb_h/vratio to double
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +2 -2
@@ -215,8 +215,8 @@ struct writeback_st {int wb_vtaps_luma;int wb_htaps_chroma;int wb_vtaps_chroma; -int wb_hratio; -int wb_vratio; +double wb_hratio; +double wb_vratio; };struct _vcs_dpi_display_output_params_st {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/34 drm/amd/display: drop dc_validate_guaranteed
In reply to a message not in the archiveFrom: Julian Parkin <[email protected]>
Block FP16 scaling in validate_resources codepath.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 32 -------------- drivers/gpu/drm/amd/display/dc/dc_stream.h | 8 ---- .../drm/amd/display/dc/dce100/dce100_resource.c | 33 --------------- .../drm/amd/display/dc/dce110/dce110_resource.c | 33 --------------- .../drm/amd/display/dc/dce112/dce112_resource.c | 33 --------------- .../drm/amd/display/dc/dce112/dce112_resource.h | 5 --- .../drm/amd/display/dc/dce120/dce120_resource.c | 1 - .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 49 ---------------------- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 7 ++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 31 -------------- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 5 --- drivers/gpu/drm/amd/display/dc/inc/resource.h | 4 -- 12 files changed, 7 insertions(+), 234 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -32
@@ -1599,18 +1599,6 @@ enum dc_status dc_remove_stream_from_ctx(return DC_OK ; } -static void copy_pipe_ctx ( -const struct pipe_ctx *from_pipe_ctx,struct pipe_ctx *to_pipe_ctx) -{ -struct dc_plane_state *plane_state = to_pipe_ctx->plane_state; -struct dc_stream_state *stream = to_pipe_ctx->stream; - - *to_pipe_ctx = *from_pipe_ctx; - to_pipe_ctx->stream = stream; -if (plane_state !=NULL ) - to_pipe_ctx->plane_state = plane_state; -} -static struct dc_stream_state *find_pll_sharable_stream (struct dc_stream_state *stream_needs_pll,struct dc_state *context)
@@ -1752,26 +1740,6 @@ enum dc_status resource_map_pool_resources(return DC_ERROR_UNEXPECTED ; } -/* first stream in the context is used to populate the rest */ -void validate_guaranteed_copy_streams ( -struct dc_state *context, -int max_streams) -{ -int i; - -for (i =1 ; i < max_streams; i++) { - context->streams[i] = context->streams[0 ]; - -copy_pipe_ctx (&context->res_ctx.pipe_ctx[0 ], - &context->res_ctx.pipe_ctx[i]); - context->res_ctx.pipe_ctx[i].stream = - context->res_ctx.pipe_ctx[0 ].stream; - -dc_stream_retain (context->streams[i]); - context->stream_count++; - } -} -void dc_resource_state_copy_construct_current (const struct dc *dc,struct dc_state *dst_ctx)
drivers/gpu/drm/amd/display/dc/dc_stream.h +0 -8
@@ -208,14 +208,6 @@ bool dc_add_all_planes_for_stream(enum dc_status dc_validate_stream (struct dc *dc,struct dc_stream_state *stream); -/* -* This function takes a stream and checks if it is guaranteed to be supported. -* Guaranteed means that MAX_COFUNC similar streams are supported. -* -* After this call: -* No hardware is programmed for call. Only validation is done. -*/ -/* * Set up streams and links associated to drive sinks * The streams parameter is an absolute set of all active streams.
drivers/gpu/drm/amd/display/dc/dce100/dce100_resource.c +0 -33
@@ -733,38 +733,6 @@ enum dc_status dce100_add_stream_to_ctx(return result; } -enum dc_status dce100_validate_guaranteed ( -struct dc *dc, -struct dc_stream_state *dc_stream, -struct dc_state *context) -{ -enum dc_status result =DC_ERROR_UNEXPECTED ; - - context->streams[0 ] = dc_stream; -dc_stream_retain (context->streams[0 ]); - context->stream_count++; - - result =resource_map_pool_resources (dc, context, dc_stream); - -if (result ==DC_OK ) - result =resource_map_clock_resources (dc, context, dc_stream); - -if (result ==DC_OK ) - result =build_mapped_resource (dc, context, dc_stream); - -if (result ==DC_OK ) { -validate_guaranteed_copy_streams ( - context, dc->caps.max_streams); - result =resource_build_scaling_params_for_context (dc, context); - } - -if (result ==DC_OK ) -if (!dce100_validate_bandwidth (dc, context)) - result =DC_FAIL_BANDWIDTH_VALIDATE ; - -return result; -} -static void dce100_destroy_resource_pool (struct resource_pool **pool) {struct dce110_resource_pool *dce110_pool =TO_DCE110_RES_POOL (*pool);
@@ -786,7 +754,6 @@ enum dc_status dce100_validate_plane(const struct dc_plane_state *plane_state, sstatic const struct resource_funcs dce100_res_pool_funcs = { .destroy = dce100_destroy_resource_pool, .link_enc_create = dce100_link_encoder_create, - .validate_guaranteed = dce100_validate_guaranteed, .validate_bandwidth = dce100_validate_bandwidth, .validate_plane = dce100_validate_plane, .add_stream_to_ctx = dce100_add_stream_to_ctx,
drivers/gpu/drm/amd/display/dc/dce110/dce110_resource.c +0 -33
@@ -930,38 +930,6 @@ static enum dc_status dce110_add_stream_to_ctx(return result; } -static enum dc_status dce110_validate_guaranteed ( -struct dc *dc, -struct dc_stream_state *dc_stream, -struct dc_state *context) -{ -enum dc_status result =DC_ERROR_UNEXPECTED ; - - context->streams[0 ] = dc_stream; -dc_stream_retain (context->streams[0 ]); - context->stream_count++; - - result =resource_map_pool_resources (dc, context, dc_stream); - -if (result ==DC_OK ) - result =resource_map_clock_resources (dc, context, dc_stream); - -if (result ==DC_OK ) - result =build_mapped_resource (dc, context, dc_stream); - -if (result ==DC_OK ) { -validate_guaranteed_copy_streams ( - context, dc->caps.max_streams); - result =resource_build_scaling_params_for_context (dc, context); - } - -if (result ==DC_OK ) -if (!dce110_validate_bandwidth (dc, context)) - result =DC_FAIL_BANDWIDTH_VALIDATE ; - -return result; -} - static struct pipe_ctx *dce110_acquire_underlay( struct dc_state *context, const struct resource_pool *pool,
@@ -1036,7 +1004,6 @@ static void dce110_destroy_resource_pool(struct resource_pool **pool)static const struct resource_funcs dce110_res_pool_funcs = { .destroy = dce110_destroy_resource_pool, .link_enc_create = dce110_link_encoder_create, - .validate_guaranteed = dce110_validate_guaranteed, .validate_bandwidth = dce110_validate_bandwidth, .validate_plane = dce110_validate_plane, .acquire_idle_pipe_for_layer = dce110_acquire_underlay,
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.c +0 -33
@@ -867,38 +867,6 @@ enum dc_status dce112_add_stream_to_ctx(return result; } -enum dc_status dce112_validate_guaranteed ( -struct dc *dc, -struct dc_stream_state *stream, -struct dc_state *context) -{ -enum dc_status result =DC_ERROR_UNEXPECTED ; - - context->streams[0 ] = stream; -dc_stream_retain (context->streams[0 ]); - context->stream_count++; - - result =resource_map_pool_resources (dc, context, stream); - -if (result ==DC_OK ) - result =resource_map_phy_clock_resources (dc, context, stream); - -if (result ==DC_OK ) - result =build_mapped_resource (dc, context, stream); - -if (result ==DC_OK ) { -validate_guaranteed_copy_streams ( - context, dc->caps.max_streams); - result =resource_build_scaling_params_for_context (dc, context); - } - -if (result ==DC_OK ) -if (!dce112_validate_bandwidth (dc, context)) - result =DC_FAIL_BANDWIDTH_VALIDATE ; - -return result; -} -enum dc_status dce112_validate_global (struct dc *dc,struct dc_state *context)
@@ -921,7 +889,6 @@ static void dce112_destroy_resource_pool(struct resource_pool **pool)static const struct resource_funcs dce112_res_pool_funcs = { .destroy = dce112_destroy_resource_pool, .link_enc_create = dce112_link_encoder_create, - .validate_guaranteed = dce112_validate_guaranteed, .validate_bandwidth = dce112_validate_bandwidth, .validate_plane = dce100_validate_plane, .add_stream_to_ctx = dce112_add_stream_to_ctx,
drivers/gpu/drm/amd/display/dc/dce112/dce112_resource.h +0 -5
@@ -42,11 +42,6 @@ enum dc_status dce112_validate_with_context(struct dc_state *context, struct dc_state *old_context); -enum dc_status dce112_validate_guaranteed ( -struct dc *dc, -struct dc_stream_state *dc_stream, -struct dc_state *context); -bool dce112_validate_bandwidth (struct dc *dc,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +0 -1
@@ -684,7 +684,6 @@ static void dce120_destroy_resource_pool(struct resource_pool **pool)static const struct resource_funcs dce120_res_pool_funcs = { .destroy = dce120_destroy_resource_pool, .link_enc_create = dce120_link_encoder_create, - .validate_guaranteed = dce112_validate_guaranteed, .validate_bandwidth = dce112_validate_bandwidth, .validate_plane = dce100_validate_plane, .add_stream_to_ctx = dce112_add_stream_to_ctx
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +0 -49
67 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +7 -0
@@ -121,6 +121,13 @@ bool dpp_get_optimal_number_of_taps(else pixel_width = scl_data->viewport.width; +/* Some ASICs does not support FP16 scaling, so we reject modes require this*/ +if (scl_data->viewport.width != scl_data->h_active && + scl_data->viewport.height != scl_data->v_active && + dpp->caps->dscl_data_proc_format ==DSCL_DATA_PRCESSING_FIXED_FORMAT && + scl_data->format ==PIXEL_FORMAT_FP16 ) +return false; +/* TODO: add lb check */ /* No support for programming ratio of 4, drop to 3.99999.. */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +0 -31
@@ -918,36 +918,6 @@ enum dc_status dcn10_add_stream_to_ctx(return result; } -enum dc_status dcn10_validate_guaranteed ( -struct dc *dc, -struct dc_stream_state *dc_stream, -struct dc_state *context) -{ -enum dc_status result =DC_ERROR_UNEXPECTED ; - - context->streams[0 ] = dc_stream; -dc_stream_retain (context->streams[0 ]); - context->stream_count++; - - result =resource_map_pool_resources (dc, context, dc_stream); - -if (result ==DC_OK ) - result =resource_map_phy_clock_resources (dc, context, dc_stream); - -if (result ==DC_OK ) - result =build_mapped_resource (dc, context, dc_stream); - -if (result ==DC_OK ) { -validate_guaranteed_copy_streams ( - context, dc->caps.max_streams); - result =resource_build_scaling_params_for_context (dc, context); - } -if (result ==DC_OK && !dcn_validate_bandwidth (dc, context)) -return DC_FAIL_BANDWIDTH_VALIDATE ; - -return result; -} - static struct pipe_ctx *dcn10_acquire_idle_pipe_for_layer( struct dc_state *context, const struct resource_pool *pool,
@@ -1233,7 +1203,6 @@ static struct dc_cap_funcs cap_funcs = {static struct resource_funcs dcn10_res_pool_funcs = { .destroy = dcn10_destroy_resource_pool, .link_enc_create = dcn10_link_encoder_create, - .validate_guaranteed = dcn10_validate_guaranteed, .validate_bandwidth = dcn_validate_bandwidth, .acquire_idle_pipe_for_layer = dcn10_acquire_idle_pipe_for_layer, .validate_plane = dcn10_validate_plane,
drivers/gpu/drm/amd/display/dc/inc/core_types.h +0 -5
@@ -95,11 +95,6 @@ struct resource_funcs {struct link_encoder *(*link_enc_create)(const struct encoder_init_data *init); -enum dc_status (*validate_guaranteed)( -struct dc *dc, -struct dc_stream_state *stream, -struct dc_state *context); -bool (*validate_bandwidth)(struct dc *dc,struct dc_state *context);
drivers/gpu/drm/amd/display/dc/inc/resource.h +0 -4
@@ -139,10 +139,6 @@ bool resource_validate_attach_surfaces(struct dc_state *context, const struct resource_pool *pool); -void validate_guaranteed_copy_streams ( -struct dc_state *context, -int max_streams); -void resource_validate_ctx_update_pointer_after_copy (const struct dc_state *src_ctx,struct dc_state *dst_ctx);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/34 drm/amd/display: Implementing new bandwidth registers for DCE120
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
Registers are added and defined.
Programmed to default values.
Stutter level watermark register is being set to calculated value. Urgent level registers are programmed to the same as urgency. The programming of the registers is not expected to have any functional difference in performance.
--- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 58 +++++++++++++++------- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h | 9 ++++ .../amd/display/dc/dce110/dce110_hw_sequencer.c | 3 ++ .../drm/amd/display/dc/dce110/dce110_mem_input_v.c | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h | 1 + 5 files changed, 55 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +41 -17
@@ -174,6 +174,25 @@ static void program_urgency_watermark( URGENCY_HIGH_WATERMARK, urgency_high_wm); } +static void dce120_program_urgency_watermark ( +struct dce_mem_input *dce_mi, +uint32_t wm_select, +uint32_t urgency_low_wm, +uint32_t urgency_high_wm) +{ +REG_UPDATE (DPG_WATERMARK_MASK_CONTROL , +URGENCY_WATERMARK_MASK , wm_select); + +REG_SET_2 (DPG_PIPE_URGENCY_CONTROL ,0 , +URGENCY_LOW_WATERMARK , urgency_low_wm, +URGENCY_HIGH_WATERMARK , urgency_high_wm); + +REG_SET_2 (DPG_PIPE_URGENT_LEVEL_CONTROL ,0 , +URGENT_LEVEL_LOW_WATERMARK , urgency_low_wm, +URGENT_LEVEL_HIGH_WATERMARK , urgency_high_wm); + +} + static void program_nbp_watermark( struct dce_mem_input *dce_mi, uint32_t wm_select,
@@ -209,23 +228,27 @@ static void program_nbp_watermark(static void program_stutter_watermark (struct dce_mem_input *dce_mi,uint32_t wm_select, -uint32_t stutter_mark) +uint32_t stutter_mark, +uint32_t stutter_entry) {REG_UPDATE (DPG_WATERMARK_MASK_CONTROL ,STUTTER_EXIT_SELF_REFRESH_WATERMARK_MASK , wm_select);if (REG (DPG_PIPE_STUTTER_CONTROL2 )) -REG_UPDATE (DPG_PIPE_STUTTER_CONTROL2 , -STUTTER_EXIT_SELF_REFRESH_WATERMARK , stutter_mark); +REG_UPDATE_2 (DPG_PIPE_STUTTER_CONTROL2 , +STUTTER_EXIT_SELF_REFRESH_WATERMARK , stutter_mark, +STUTTER_ENTER_SELF_REFRESH_WATERMARK , stutter_entry);else -REG_UPDATE (DPG_PIPE_STUTTER_CONTROL , -STUTTER_EXIT_SELF_REFRESH_WATERMARK , stutter_mark); +REG_UPDATE_2 (DPG_PIPE_STUTTER_CONTROL , +STUTTER_EXIT_SELF_REFRESH_WATERMARK , stutter_mark, +STUTTER_ENTER_SELF_REFRESH_WATERMARK , stutter_entry); }static void dce_mi_program_display_marks (struct mem_input *mi,struct dce_watermarks nbp, -struct dce_watermarks stutter, +struct dce_watermarks stutter_exit, +struct dce_watermarks stutter_enter,struct dce_watermarks urgent,uint32_t total_dest_line_time_ns) {
@@ -243,26 +266,27 @@ static void dce_mi_program_display_marks(program_nbp_watermark (dce_mi,2 , nbp.a_mark);/* set a */ program_nbp_watermark (dce_mi,1 , nbp.d_mark);/* set d */ -program_stutter_watermark (dce_mi,2 , stutter.a_mark);/* set a */ -program_stutter_watermark (dce_mi,1 , stutter.d_mark);/* set d */ +program_stutter_watermark (dce_mi,2 , stutter_exit.a_mark, stutter_enter.a_mark);/* set a */ +program_stutter_watermark (dce_mi,1 , stutter_exit.d_mark, stutter_enter.d_mark);/* set d */ }static void dce120_mi_program_display_marks (struct mem_input *mi,struct dce_watermarks nbp, -struct dce_watermarks stutter, +struct dce_watermarks stutter_exit, +struct dce_watermarks stutter_entry,struct dce_watermarks urgent,uint32_t total_dest_line_time_ns) {struct dce_mem_input *dce_mi =TO_DCE_MEM_INPUT (mi);uint32_t stutter_en = mi->ctx->dc->debug.disable_stutter ?0 :1 ; -program_urgency_watermark (dce_mi,0 ,/* set a */ +dce120_program_urgency_watermark (dce_mi,0 ,/* set a */ urgent.a_mark, total_dest_line_time_ns); -program_urgency_watermark (dce_mi,1 ,/* set b */ +dce120_program_urgency_watermark (dce_mi,1 ,/* set b */ urgent.b_mark, total_dest_line_time_ns); -program_urgency_watermark (dce_mi,2 ,/* set c */ +dce120_program_urgency_watermark (dce_mi,2 ,/* set c */ urgent.c_mark, total_dest_line_time_ns); -program_urgency_watermark (dce_mi,3 ,/* set d */ +dce120_program_urgency_watermark (dce_mi,3 ,/* set d */ urgent.d_mark, total_dest_line_time_ns); REG_UPDATE_2(DPG_PIPE_STUTTER_CONTROL,
@@ -273,10 +297,10 @@ static void dce120_mi_program_display_marks(struct mem_input *mi,program_nbp_watermark (dce_mi,2 , nbp.c_mark);/* set c */ program_nbp_watermark (dce_mi,3 , nbp.d_mark);/* set d */ -program_stutter_watermark (dce_mi,0 , stutter.a_mark);/* set a */ -program_stutter_watermark (dce_mi,1 , stutter.b_mark);/* set b */ -program_stutter_watermark (dce_mi,2 , stutter.c_mark);/* set c */ -program_stutter_watermark (dce_mi,3 , stutter.d_mark);/* set d */ +program_stutter_watermark (dce_mi,0 , stutter_exit.a_mark, stutter_entry.a_mark);/* set a */ +program_stutter_watermark (dce_mi,1 , stutter_exit.b_mark, stutter_entry.b_mark);/* set b */ +program_stutter_watermark (dce_mi,2 , stutter_exit.c_mark, stutter_entry.c_mark);/* set c */ +program_stutter_watermark (dce_mi,3 , stutter_exit.d_mark, stutter_entry.d_mark);/* set d */ } static void program_tiling(
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h +9 -0
@@ -106,6 +106,7 @@ struct dce_mem_input_registers {uint32_t DPG_PIPE_ARBITRATION_CONTROL1 ;uint32_t DPG_WATERMARK_MASK_CONTROL ;uint32_t DPG_PIPE_URGENCY_CONTROL ; +uint32_t DPG_PIPE_URGENT_LEVEL_CONTROL ;uint32_t DPG_PIPE_NB_PSTATE_CHANGE_CONTROL ;uint32_t DPG_PIPE_LOW_POWER_CONTROL ;uint32_t DPG_PIPE_STUTTER_CONTROL ;
@@ -213,6 +214,11 @@ struct dce_mem_input_registers {#define MI_DCE12_DMIF_PG_MASK_SH_LIST (mask_sh, blk)\ SFB(blk, DPG_PIPE_STUTTER_CONTROL2, STUTTER_EXIT_SELF_REFRESH_WATERMARK, mask_sh),\ + SFB(blk, DPG_PIPE_STUTTER_CONTROL2, STUTTER_ENTER_SELF_REFRESH_WATERMARK, mask_sh),\ + SFB(blk, DPG_PIPE_URGENT_LEVEL_CONTROL, URGENT_LEVEL_LOW_WATERMARK, mask_sh),\ + SFB(blk, DPG_PIPE_URGENT_LEVEL_CONTROL, URGENT_LEVEL_HIGH_WATERMARK, mask_sh),\ + SFB(blk, DPG_PIPE_URGENCY_CONTROL, URGENCY_LOW_WATERMARK, mask_sh),\ + SFB(blk, DPG_PIPE_URGENCY_CONTROL, URGENCY_HIGH_WATERMARK, mask_sh),\ SFB(blk, DPG_WATERMARK_MASK_CONTROL, PSTATE_CHANGE_WATERMARK_MASK, mask_sh),\ SFB(blk, DPG_PIPE_LOW_POWER_CONTROL, PSTATE_CHANGE_ENABLE, mask_sh),\ SFB(blk, DPG_PIPE_LOW_POWER_CONTROL, PSTATE_CHANGE_URGENT_DURING_REQUEST, mask_sh),\
@@ -286,6 +292,8 @@ struct dce_mem_input_registers {type STUTTER_EXIT_SELF_REFRESH_WATERMARK_MASK ; \type URGENCY_LOW_WATERMARK ; \type URGENCY_HIGH_WATERMARK ; \ +type URGENT_LEVEL_LOW_WATERMARK ;\ +type URGENT_LEVEL_HIGH_WATERMARK ;\type NB_PSTATE_CHANGE_ENABLE ; \type NB_PSTATE_CHANGE_URGENT_DURING_REQUEST ; \type NB_PSTATE_CHANGE_NOT_SELF_REFRESH_DURING_REQUEST ; \
@@ -297,6 +305,7 @@ struct dce_mem_input_registers {type STUTTER_ENABLE ; \type STUTTER_IGNORE_FBC ; \type STUTTER_EXIT_SELF_REFRESH_WATERMARK ; \ +type STUTTER_ENTER_SELF_REFRESH_WATERMARK ; \type DMIF_BUFFERS_ALLOCATED ; \type DMIF_BUFFERS_ALLOCATION_COMPLETED ; \type ENABLE ;/* MC_HUB_RDREQ_DMIF_LIMIT */ \
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -0
@@ -1539,6 +1539,7 @@ static void dce110_set_displaymarks( pipe_ctx->plane_res.mi, context->bw.dce.nbp_state_change_wm_ns[num_pipes], context->bw.dce.stutter_exit_wm_ns[num_pipes], + context->bw.dce.stutter_entry_wm_ns[num_pipes], context->bw.dce.urgent_wm_ns[num_pipes], total_dest_line_time_ns);if (i == underlay_idx) {
@@ -1564,6 +1565,7 @@ static void set_safe_displaymarks( MAX_WATERMARK, MAX_WATERMARK, MAX_WATERMARK, MAX_WATERMARK };struct dce_watermarks nbp_marks = {SAFE_NBP_MARK ,SAFE_NBP_MARK ,SAFE_NBP_MARK ,SAFE_NBP_MARK }; +struct dce_watermarks min_marks = {0 ,0 ,0 ,0 };for (i =0 ; i <MAX_PIPES ; i++) {if (res_ctx->pipe_ctx[i].stream ==NULL || res_ctx->pipe_ctx[i].plane_res.mi ==NULL )
@@ -1573,6 +1575,7 @@ static void set_safe_displaymarks( res_ctx->pipe_ctx[i].plane_res.mi, nbp_marks, max_marks, + min_marks, max_marks, MAX_WATERMARK);
drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c +1 -0
@@ -923,6 +923,7 @@ void dce_mem_input_v_program_display_marks(struct mem_input *mem_input, struct dce_watermarks nbp, struct dce_watermarks stutter, + struct dce_watermarks stutter_enter, struct dce_watermarks urgent, uint32_t total_dest_line_time_ns) {
drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h +1 -0
@@ -104,6 +104,7 @@ struct mem_input_funcs {struct mem_input *mem_input, struct dce_watermarks nbp, struct dce_watermarks stutter, + struct dce_watermarks stutter_enter, struct dce_watermarks urgent, uint32_t total_dest_line_time_ns);
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/34 drm/amd/display: dal 3.1.40
In reply to a message not in the archiveFrom: Tony Cheng <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -38,7 +38,7 @@#include "inc/compressor.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.1.39" +#define DC_VER "3.1.40"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/34 drm/amd/display: align dtn logs and add mpc idle bit print
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 53 ++++++++++------------ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 4 +- drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h | 2 + 3 files changed, 28 insertions(+), 31 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +23 -30
@@ -56,16 +56,17 @@#define FN (reg_name, field_name) \ hws->shifts->field_name, hws->masks->field_name +/*print is 17 wide, first two characters are spaces*/ #define DTN_INFO_MICRO_SEC (ref_cycle) \ print_microsec(dc_ctx, ref_cycle)void print_microsec (struct dc_context *dc_ctx,uint32_t ref_cycle) { -static const uint32_t ref_clk_mhz =48 ; -static const unsigned int frac =10 ; +const uint32_t ref_clk_mhz = dc_ctx->dc->res_pool->ref_clock_inKhz /1000 ; +static const unsigned int frac =1000 ;uint32_t us_x10 = (ref_cycle * frac) / ref_clk_mhz; -DTN_INFO ("%d.%d \t " , +DTN_INFO (" %11d.%03d" , us_x10 / frac, us_x10 % frac); }
@@ -92,14 +93,14 @@ void dcn10_log_hubbub_state(struct dc *dc)hubbub1_wm_read_state (dc->res_pool->hubbub, &wm); -DTN_INFO ("HUBBUB WM: \t data_urgent \t pte_meta_urgent \t " -"sr_enter \t sr_exit \t dram_clk_change \n" ); +DTN_INFO ("HUBBUB WM: data_urgent pte_meta_urgent" +" sr_enter sr_exit dram_clk_change\n" );for (i =0 ; i <4 ; i++) {struct dcn_hubbub_wm_set *s; s = &wm.sets[i]; -DTN_INFO ("WM_Set[%d]:\t " , s->wm_set); +DTN_INFO ("WM_Set[%d]:" , s->wm_set);DTN_INFO_MICRO_SEC (s->data_urgent);DTN_INFO_MICRO_SEC (s->pte_meta_urgent);DTN_INFO_MICRO_SEC (s->sr_enter);
@@ -121,19 +122,17 @@ void dcn10_log_hw_state(struct dc *dc)dcn10_log_hubbub_state (dc); -DTN_INFO ("HUBP: format addr_hi width height " -"rotation mirror sw_mode " -"dcc_en blank_en ttu_dis underflow " -"min_ttu_vblank qos_low_wm qos_high_wm\n" ); +DTN_INFO ("HUBP: format addr_hi width height" +" rot mir sw_mode dcc_en blank_en ttu_dis underflow" +" min_ttu_vblank qos_low_wm qos_high_wm\n" );for (i =0 ; i < pool->pipe_count; i++) {struct hubp *hubp = pool->hubps[i];struct dcn_hubp_state s;hubp1_read_state (TO_DCN10_HUBP (hubp), &s); - DTN_INFO("[%-2d]: %5xh %6xh %5d %6d " - "%7xh %5xh %6xh " - "%6d %8d %7d %8xh \t", + DTN_INFO("[%2d]: %5xh %6xh %5d %6d %2xh %2xh %6xh" + " %6d %8d %7d %8xh", hubp->inst, s.pixel_format, s.inuse_addr_hi,
@@ -152,25 +151,21 @@ void dcn10_log_hw_state(struct dc *dc)DTN_INFO ("\n" ); }DTN_INFO ("\n" ); + +DTN_INFO ("MPCC: OPP DPP MPCCBOT MODE ALPHA_MODE PREMULT OVERLAP_ONLY IDLE\n" );for (i =0 ; i < pool->pipe_count; i++) { -struct output_pixel_processor *opp = pool->opps[i]; -struct mpcc *mpcc = opp->mpc_tree_params.opp_list;struct mpcc_state s = {0 }; -while (mpcc) { -ASSERT (opp->mpc_tree_params.opp_id == opp->inst); - pool->mpc->funcs->read_mpcc_state (pool->mpc, mpcc->mpcc_id, &s); -DTN_INFO ("[OPP%d - MPCC%d]: DPP%d MPCCBOT%x MODE:%d ALPHA_MODE:%d PREMULT:%d OVERLAP_ONLY:%d\n" , - s.opp_id, mpcc->mpcc_id, s.dpp_id, s.bot_mpcc_id, - s.mode, s.alpha_mode, s.pre_multiplied_alpha, s.overlap_only); - mpcc = mpcc->mpcc_bot; -ASSERT (!mpcc || mpcc->mpcc_id == s.bot_mpcc_id); - } + pool->mpc->funcs->read_mpcc_state (pool->mpc, i, &s); +DTN_INFO ("[%2d]: %2xh %2xh %6xh %4d %10d %7d %12d %4d\n" , + i, s.opp_id, s.dpp_id, s.bot_mpcc_id, + s.mode, s.alpha_mode, s.pre_multiplied_alpha, s.overlap_only, + s.idle); }DTN_INFO ("\n" ); -DTN_INFO ("OTG:\t v_bs \t v_be \t v_ss \t v_se \t vpol \t vmax \t vmin \t " -"h_bs \t h_be \t h_ss \t h_se \t hpol \t htot \t vtot \t underflow\n" ); +DTN_INFO ("OTG: v_bs v_be v_ss v_se vpol vmax vmin" +" h_bs h_be h_ss h_se hpol htot vtot underflow\n" );for (i =0 ; i < pool->timing_generator_count; i++) {struct timing_generator *tg = pool->timing_generators[i];
@@ -182,9 +177,8 @@ void dcn10_log_hw_state(struct dc *dc)if ((s.otg_enabled &1 ) ==0 )continue ; - DTN_INFO("[%d]:\t %d \t %d \t %d \t %d \t " - "%d \t %d \t %d \t %d \t %d \t %d \t " - "%d \t %d \t %d \t %d \t %d \t ", + DTN_INFO("[%d]: %5d %5d %5d %5d %5d %5d %5d %5d %5d %5d" + " %5d %5d %5d %5d %9d\n", tg->inst, s.v_blank_start, s.v_blank_end,
@@ -201,7 +195,6 @@ void dcn10_log_hw_state(struct dc *dc) s.h_total, s.v_total, s.underflow_occurred_status); -DTN_INFO ("\n" ); }DTN_INFO ("\n" );
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +3 -1
@@ -422,7 +422,9 @@ void mpc1_read_mpcc_state(REG_GET_4 (MPCC_CONTROL [mpcc_inst],MPCC_MODE , &s->mode,MPCC_ALPHA_BLND_MODE , &s->alpha_mode,MPCC_ALPHA_MULTIPLIED_MODE , &s->pre_multiplied_alpha, -MPCC_BLND_ACTIVE_OVERLAP_ONLY , &s->pre_multiplied_alpha); +MPCC_BLND_ACTIVE_OVERLAP_ONLY , &s->overlap_only); +REG_GET_2 (MPCC_STATUS [mpcc_inst],MPCC_IDLE , &s->idle, +MPCC_BUSY , &s->busy); }const struct mpc_funcs dcn10_mpc_funcs = {
drivers/gpu/drm/amd/display/dc/inc/hw/mpc.h +2 -0
@@ -113,6 +113,8 @@ struct mpcc_state {uint32_t alpha_mode;uint32_t pre_multiplied_alpha;uint32_t overlap_only; +uint32_t idle; +uint32_t busy; };struct mpc_funcs {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/34 drm/amd/display: add assert in enable FBC
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
Adding assert to prevent possible null deref warning. Only can happen under abnormal circumstances.
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -0
@@ -1801,6 +1801,9 @@ static bool should_enable_fbc(struct dc *dc, } } +/* Pipe context should be found */ +ASSERT (pipe_ctx); +/* Only supports eDP */ if (pipe_ctx->stream->sink->link->connector_signal !=SIGNAL_TYPE_EDP )return false;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 22/34 drm/amd/display: Separate mem input constuctors for dce 112 and 120
In reply to a message not in the archiveFrom: Mikita Lipski <[email protected]>
Override the memory input functions for dce120 not to program new registers on dce112.
This will fix warnings thrown on Polaris asics.
--- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c | 75 ++++++++++++++++++++-- drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h | 8 +++ .../drm/amd/display/dc/dce120/dce120_resource.c | 2 +- 3 files changed, 77 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.c +68 -7
@@ -225,7 +225,7 @@ static void program_nbp_watermark( } } -static void program_stutter_watermark( +static void dce120_program_stutter_watermark( struct dce_mem_input *dce_mi, uint32_t wm_select, uint32_t stutter_mark,
@@ -244,6 +244,22 @@ static void program_stutter_watermark( STUTTER_ENTER_SELF_REFRESH_WATERMARK, stutter_entry); } +static void program_stutter_watermark ( +struct dce_mem_input *dce_mi, +uint32_t wm_select, +uint32_t stutter_mark) +{ +REG_UPDATE (DPG_WATERMARK_MASK_CONTROL , +STUTTER_EXIT_SELF_REFRESH_WATERMARK_MASK , wm_select); + +if (REG (DPG_PIPE_STUTTER_CONTROL2 )) +REG_UPDATE (DPG_PIPE_STUTTER_CONTROL2 , +STUTTER_EXIT_SELF_REFRESH_WATERMARK , stutter_mark); +else +REG_UPDATE (DPG_PIPE_STUTTER_CONTROL , +STUTTER_EXIT_SELF_REFRESH_WATERMARK , stutter_mark); +} + static void dce_mi_program_display_marks( struct mem_input *mi, struct dce_watermarks nbp,
@@ -266,8 +282,41 @@ static void dce_mi_program_display_marks(program_nbp_watermark (dce_mi,2 , nbp.a_mark);/* set a */ program_nbp_watermark (dce_mi,1 , nbp.d_mark);/* set d */ -program_stutter_watermark (dce_mi,2 , stutter_exit.a_mark, stutter_enter.a_mark);/* set a */ -program_stutter_watermark (dce_mi,1 , stutter_exit.d_mark, stutter_enter.d_mark);/* set d */ +program_stutter_watermark (dce_mi,2 , stutter_exit.a_mark);/* set a */ +program_stutter_watermark (dce_mi,1 , stutter_exit.d_mark);/* set d */ +} + +static void dce112_mi_program_display_marks (struct mem_input *mi, +struct dce_watermarks nbp, +struct dce_watermarks stutter_exit, +struct dce_watermarks stutter_entry, +struct dce_watermarks urgent, +uint32_t total_dest_line_time_ns) +{ +struct dce_mem_input *dce_mi =TO_DCE_MEM_INPUT (mi); +uint32_t stutter_en = mi->ctx->dc->debug.disable_stutter ?0 :1 ; + +program_urgency_watermark (dce_mi,0 ,/* set a */ + urgent.a_mark, total_dest_line_time_ns); +program_urgency_watermark (dce_mi,1 ,/* set b */ + urgent.b_mark, total_dest_line_time_ns); +program_urgency_watermark (dce_mi,2 ,/* set c */ + urgent.c_mark, total_dest_line_time_ns); +program_urgency_watermark (dce_mi,3 ,/* set d */ + urgent.d_mark, total_dest_line_time_ns); + +REG_UPDATE_2 (DPG_PIPE_STUTTER_CONTROL , +STUTTER_ENABLE , stutter_en, +STUTTER_IGNORE_FBC ,1 ); +program_nbp_watermark (dce_mi,0 , nbp.a_mark);/* set a */ +program_nbp_watermark (dce_mi,1 , nbp.b_mark);/* set b */ +program_nbp_watermark (dce_mi,2 , nbp.c_mark);/* set c */ +program_nbp_watermark (dce_mi,3 , nbp.d_mark);/* set d */ + +program_stutter_watermark (dce_mi,0 , stutter_exit.a_mark);/* set a */ +program_stutter_watermark (dce_mi,1 , stutter_exit.b_mark);/* set b */ +program_stutter_watermark (dce_mi,2 , stutter_exit.c_mark);/* set c */ +program_stutter_watermark (dce_mi,3 , stutter_exit.d_mark);/* set d */ } static void dce120_mi_program_display_marks(struct mem_input *mi,
@@ -297,10 +346,10 @@ static void dce120_mi_program_display_marks(struct mem_input *mi,program_nbp_watermark (dce_mi,2 , nbp.c_mark);/* set c */ program_nbp_watermark (dce_mi,3 , nbp.d_mark);/* set d */ -program_stutter_watermark (dce_mi,0 , stutter_exit.a_mark, stutter_entry.a_mark);/* set a */ -program_stutter_watermark (dce_mi,1 , stutter_exit.b_mark, stutter_entry.b_mark);/* set b */ -program_stutter_watermark (dce_mi,2 , stutter_exit.c_mark, stutter_entry.c_mark);/* set c */ -program_stutter_watermark (dce_mi,3 , stutter_exit.d_mark, stutter_entry.d_mark);/* set d */ +dce120_program_stutter_watermark (dce_mi,0 , stutter_exit.a_mark, stutter_entry.a_mark);/* set a */ +dce120_program_stutter_watermark (dce_mi,1 , stutter_exit.b_mark, stutter_entry.b_mark);/* set b */ +dce120_program_stutter_watermark (dce_mi,2 , stutter_exit.c_mark, stutter_entry.c_mark);/* set c */ +dce120_program_stutter_watermark (dce_mi,3 , stutter_exit.d_mark, stutter_entry.d_mark);/* set d */ } static void program_tiling(
@@ -718,6 +767,18 @@ void dce112_mem_input_construct(const struct dce_mem_input_registers *regs, const struct dce_mem_input_shift *mi_shift, const struct dce_mem_input_mask *mi_mask) +{ +dce_mem_input_construct (dce_mi ,ctx ,inst ,regs ,mi_shift ,mi_mask ); + dce_mi->base.funcs->mem_input_program_display_marks = dce112_mi_program_display_marks; +} + +void dce120_mem_input_construct ( +struct dce_mem_input *dce_mi, +struct dc_context *ctx, +int inst, +const struct dce_mem_input_registers *regs, +const struct dce_mem_input_shift *mi_shift, +const struct dce_mem_input_mask *mi_mask) {dce_mem_input_construct (dce_mi, ctx, inst, regs, mi_shift, mi_mask); dce_mi->base.funcs->mem_input_program_display_marks = dce120_mi_program_display_marks;
drivers/gpu/drm/amd/display/dc/dce/dce_mem_input.h +8 -0
@@ -353,4 +353,12 @@ void dce112_mem_input_construct(const struct dce_mem_input_shift *mi_shift, const struct dce_mem_input_mask *mi_mask); +void dce120_mem_input_construct ( +struct dce_mem_input *dce_mi, +struct dc_context *ctx, +int inst, +const struct dce_mem_input_registers *regs, +const struct dce_mem_input_shift *mi_shift, +const struct dce_mem_input_mask *mi_mask); +#endif /*__DCE_MEM_INPUT_H__*/
drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c +1 -1
@@ -652,7 +652,7 @@ static struct mem_input *dce120_mem_input_create(return NULL ; } -dce112_mem_input_construct (dce_mi, ctx, inst, &mi_regs[inst], &mi_shifts, &mi_masks); +dce120_mem_input_construct (dce_mi, ctx, inst, &mi_regs[inst], &mi_shifts, &mi_masks);return &dce_mi->base; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 23/34 drm/amd/display: Only update mpc blend config if not full update
In reply to a message not in the archiveFrom: Eric Yang <[email protected]>
The current mpcc insert/remove logic does not support updating only a single mpcc. So when pixel alpha changed but no full update we can mistakenly shuffle the mpcc layering order. With this change we will only insert/remove mpcc if there is full update.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 9 +++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c | 5 +++-- 2 files changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +9 -0
@@ -1631,6 +1631,8 @@ static void update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)struct mpc *mpc = dc->res_pool->mpc;struct mpc_tree *mpc_tree_params = &(pipe_ctx->stream_res.opp->mpc_tree_params); + +/* TODO: proper fix once fpga works */ if (dc->debug.surface_visual_confirm)
@@ -1657,6 +1659,7 @@ static void update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx) pipe_ctx->stream->output_color_space) && per_pixel_alpha; +/* * TODO: remove hack * Note: currently there is a bug in init_hw such that
@@ -1667,6 +1670,12 @@ static void update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx)*/ mpcc_id = hubp->inst; +/* If there is no full update, don't need to touch MPC tree*/ +if (!pipe_ctx->plane_state->update_flags.bits.full_update) { + mpc->funcs->update_blending (mpc, &blnd_cfg, mpcc_id); +return ; + } +/* check if this MPCC is already being used */ new_mpcc = mpc->funcs->get_mpcc_for_dpp (mpc_tree_params, mpcc_id);/* remove MPCC if being used */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_mpc.c +3 -2
@@ -65,6 +65,7 @@ static void mpc1_update_blending( int mpcc_id) {struct dcn10_mpc *mpc10 =TO_DCN10_MPC (mpc); +struct mpcc *mpcc =mpc1_get_mpcc (mpc, mpcc_id); REG_UPDATE_5(MPCC_CONTROL[mpcc_id], MPCC_ALPHA_BLND_MODE, blnd_cfg->alpha_mode,
@@ -74,6 +75,7 @@ static void mpc1_update_blending( MPCC_GLOBAL_GAIN, blnd_cfg->global_gain);mpc1_set_bg_color (mpc, &blnd_cfg->black_color, mpcc_id); + mpcc->blnd_cfg = *blnd_cfg; } void mpc1_update_stereo_mix(
@@ -235,8 +237,7 @@ struct mpcc *mpc1_insert_plane( }/* update the blending configuration */ - new_mpcc->blnd_cfg = *blnd_cfg; - mpc->funcs->update_blending (mpc, &new_mpcc->blnd_cfg, mpcc_id); + mpc->funcs->update_blending (mpc, blnd_cfg, mpcc_id);/* update the stereo mix settings, if provided */ if (sm_cfg !=NULL ) {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 24/34 drm/amd/display: hide inconsistent mpcc programming from dtn log
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -4
@@ -157,10 +157,11 @@ void dcn10_log_hw_state(struct dc *dc)struct mpcc_state s = {0 }; pool->mpc->funcs->read_mpcc_state (pool->mpc, i, &s); -DTN_INFO ("[%2d]: %2xh %2xh %6xh %4d %10d %7d %12d %4d\n" , - i, s.opp_id, s.dpp_id, s.bot_mpcc_id, - s.mode, s.alpha_mode, s.pre_multiplied_alpha, s.overlap_only, - s.idle); +if (s.opp_id !=0xf ) +DTN_INFO ("[%2d]: %2xh %2xh %6xh %4d %10d %7d %12d %4d\n" , + i, s.opp_id, s.dpp_id, s.bot_mpcc_id, + s.mode, s.alpha_mode, s.pre_multiplied_alpha, s.overlap_only, + s.idle); }DTN_INFO ("\n" );
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 25/34 drm/amd/display: Add dc_lut_mode enum
In reply to a message not in the archiveFrom: Vitaly Prosyak <[email protected]>
--- drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +5 -0
@@ -191,4 +191,9 @@ enum controller_dp_test_pattern {CONTROLLER_DP_TEST_PATTERN_COLORSQUARES_CEA }; +enum dc_lut_mode { +LUT_BYPASS , +LUT_RAM_A , +LUT_RAM_B +};#endif /* __DAL_HW_SHARED_H__ */
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 26/34 drm/amd/display: Correct print types in DC_LOGS
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
Correct the types used for printing in logs. This is needed for adding dynamic printing (LINUX), otherwise we get warnings.
--- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 74 +++++++++++----------- drivers/gpu/drm/amd/display/dc/core/dc_debug.c | 14 ++-- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 8 +-- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 4 +- .../dc/i2caux/dce110/i2c_hw_engine_dce110.c | 2 +- 5 files changed, 52 insertions(+), 50 deletions(-)
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +37 -37
@@ -1459,39 +1459,39 @@ void dcn_bw_notify_pplib_of_wm_ranges(struct dc *dc)void dcn_bw_sync_calcs_and_dml (struct dc *dc) {kernel_fpu_begin (); - DC_LOG_BANDWIDTH_CALCS("sr_exit_time: %d ns\n" - "sr_enter_plus_exit_time: %d ns\n" - "urgent_latency: %d ns\n" - "write_back_latency: %d ns\n" - "percent_of_ideal_drambw_received_after_urg_latency: %d %\n" + DC_LOG_BANDWIDTH_CALCS("sr_exit_time: %f ns\n" + "sr_enter_plus_exit_time: %f ns\n" + "urgent_latency: %f ns\n" + "write_back_latency: %f ns\n" + "percent_of_ideal_drambw_received_after_urg_latency: %f %%\n" "max_request_size: %d bytes\n" - "dcfclkv_max0p9: %d kHz\n" - "dcfclkv_nom0p8: %d kHz\n" - "dcfclkv_mid0p72: %d kHz\n" - "dcfclkv_min0p65: %d kHz\n" - "max_dispclk_vmax0p9: %d kHz\n" - "max_dispclk_vnom0p8: %d kHz\n" - "max_dispclk_vmid0p72: %d kHz\n" - "max_dispclk_vmin0p65: %d kHz\n" - "max_dppclk_vmax0p9: %d kHz\n" - "max_dppclk_vnom0p8: %d kHz\n" - "max_dppclk_vmid0p72: %d kHz\n" - "max_dppclk_vmin0p65: %d kHz\n" - "socclk: %d kHz\n" - "fabric_and_dram_bandwidth_vmax0p9: %d MB/s\n" - "fabric_and_dram_bandwidth_vnom0p8: %d MB/s\n" - "fabric_and_dram_bandwidth_vmid0p72: %d MB/s\n" - "fabric_and_dram_bandwidth_vmin0p65: %d MB/s\n" - "phyclkv_max0p9: %d kHz\n" - "phyclkv_nom0p8: %d kHz\n" - "phyclkv_mid0p72: %d kHz\n" - "phyclkv_min0p65: %d kHz\n" - "downspreading: %d %\n" + "dcfclkv_max0p9: %f kHz\n" + "dcfclkv_nom0p8: %f kHz\n" + "dcfclkv_mid0p72: %f kHz\n" + "dcfclkv_min0p65: %f kHz\n" + "max_dispclk_vmax0p9: %f kHz\n" + "max_dispclk_vnom0p8: %f kHz\n" + "max_dispclk_vmid0p72: %f kHz\n" + "max_dispclk_vmin0p65: %f kHz\n" + "max_dppclk_vmax0p9: %f kHz\n" + "max_dppclk_vnom0p8: %f kHz\n" + "max_dppclk_vmid0p72: %f kHz\n" + "max_dppclk_vmin0p65: %f kHz\n" + "socclk: %f kHz\n" + "fabric_and_dram_bandwidth_vmax0p9: %f MB/s\n" + "fabric_and_dram_bandwidth_vnom0p8: %f MB/s\n" + "fabric_and_dram_bandwidth_vmid0p72: %f MB/s\n" + "fabric_and_dram_bandwidth_vmin0p65: %f MB/s\n" + "phyclkv_max0p9: %f kHz\n" + "phyclkv_nom0p8: %f kHz\n" + "phyclkv_mid0p72: %f kHz\n" + "phyclkv_min0p65: %f kHz\n" + "downspreading: %f %%\n" "round_trip_ping_latency_cycles: %d DCFCLK Cycles\n" "urgent_out_of_order_return_per_channel: %d Bytes\n" "number_of_channels: %d\n" "vmm_page_size: %d Bytes\n" - "dram_clock_change_latency: %d ns\n" + "dram_clock_change_latency: %f ns\n" "return_bus_width: %d Bytes\n", dc->dcn_soc->sr_exit_time * 1000, dc->dcn_soc->sr_enter_plus_exit_time * 1000,
@@ -1527,11 +1527,11 @@ void dcn_bw_sync_calcs_and_dml(struct dc *dc) dc->dcn_soc->vmm_page_size, dc->dcn_soc->dram_clock_change_latency *1000 , dc->dcn_soc->return_bus_width); -DC_LOG_BANDWIDTH_CALCS ("rob_buffer_size_in_kbyte: %d\n" -"det_buffer_size_in_kbyte: %d\n" -"dpp_output_buffer_pixels: %d\n" -"opp_output_buffer_lines: %d\n" -"pixel_chunk_size_in_kbyte: %d\n" +DC_LOG_BANDWIDTH_CALCS ("rob_buffer_size_in_kbyte: %f\n" +"det_buffer_size_in_kbyte: %f\n" +"dpp_output_buffer_pixels: %f\n" +"opp_output_buffer_lines: %f\n" +"pixel_chunk_size_in_kbyte: %f\n" "pte_enable: %d\n" "pte_chunk_size: %d kbytes\n" "meta_chunk_size: %d kbytes\n"
@@ -1550,13 +1550,13 @@ void dcn_bw_sync_calcs_and_dml(struct dc *dc)"max_pscl_tolb_throughput: %d pixels/dppclk\n" "max_lb_tovscl_throughput: %d pixels/dppclk\n" "max_vscl_tohscl_throughput: %d pixels/dppclk\n" -"max_hscl_ratio: %d\n" -"max_vscl_ratio: %d\n" +"max_hscl_ratio: %f\n" +"max_vscl_ratio: %f\n" "max_hscl_taps: %d\n" "max_vscl_taps: %d\n" "pte_buffer_size_in_requests: %d\n" -"dispclk_ramping_margin: %d %\n" -"under_scan_factor: %d %\n" +"dispclk_ramping_margin: %f %%\n" +"under_scan_factor: %f %%\n" "max_inter_dcn_tile_repeaters: %d\n" "can_vstartup_lines_exceed_vsync_plus_back_porch_lines_minus_one: %d\n" "bug_forcing_luma_and_chroma_request_to_same_size_fixed: %d\n"
drivers/gpu/drm/amd/display/dc/core/dc_debug.c +8 -6
@@ -72,8 +72,8 @@ void pre_surface_trace("plane_state->visible = %d;\n" "plane_state->flip_immediate = %d;\n" "plane_state->address.type = %d;\n" -"plane_state->address.grph.addr.quad_part = 0x%X;\n" -"plane_state->address.grph.meta_addr.quad_part = 0x%X;\n" +"plane_state->address.grph.addr.quad_part = 0x%llX;\n" +"plane_state->address.grph.meta_addr.quad_part = 0x%llX;\n" "plane_state->scaling_quality.h_taps = %d;\n" "plane_state->scaling_quality.v_taps = %d;\n" "plane_state->scaling_quality.h_taps_c = %d;\n"
@@ -192,8 +192,8 @@ void update_surface_trace(SURFACE_TRACE ("Update %d\n" , i);if (update->flip_addr) { SURFACE_TRACE("flip_addr->address.type = %d;\n" - "flip_addr->address.grph.addr.quad_part = 0x%X;\n" - "flip_addr->address.grph.meta_addr.quad_part = 0x%X;\n" + "flip_addr->address.grph.addr.quad_part = 0x%llX;\n" + "flip_addr->address.grph.meta_addr.quad_part = 0x%llX;\n" "flip_addr->flip_immediate = %d;\n", update->flip_addr->address.type, update->flip_addr->address.grph.addr.quad_part,
@@ -211,7 +211,8 @@ void update_surface_trace("plane_info->plane_size.grph.surface_size.width = %d;\n" "plane_info->plane_size.grph.surface_size.x = %d;\n" "plane_info->plane_size.grph.surface_size.y = %d;\n" -"plane_info->rotation = %d;\n" , +"plane_info->rotation = %d;\n" +"plane_info->stereo_format = %d;\n" , update->plane_info->color_space, update->plane_info->input_tf, update->plane_info->format,
@@ -371,6 +372,7 @@ void context_clock_trace( context->bw.dcn.calc_clk.dppclk_khz, context->bw.dcn.calc_clk.dcfclk_khz, context->bw.dcn.calc_clk.dcfclk_deep_sleep_khz, - context->bw.dcn.calc_clk.fclk_khz); + context->bw.dcn.calc_clk.fclk_khz, + context->bw.dcn.calc_clk.socclk_khz);#endif }
drivers/gpu/drm/amd/display/dc/core/dc_link.c +4 -4
@@ -2165,11 +2165,11 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx) link->mst_stream_alloc_table.stream_count);for (i =0 ; i <MAX_CONTROLLER_NUM ; i++) { - DC_LOG_MST("stream_enc[%d]: 0x%x " + DC_LOG_MST("stream_enc[%d]: %p " "stream[%d].vcp_id: %d " "stream[%d].slot_count: %d\n", i, - link->mst_stream_alloc_table.stream_allocations[i].stream_enc, + (void *) link->mst_stream_alloc_table.stream_allocations[i].stream_enc, i, link->mst_stream_alloc_table.stream_allocations[i].vcp_id, i,
@@ -2255,11 +2255,11 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx) link->mst_stream_alloc_table.stream_count);for (i =0 ; i <MAX_CONTROLLER_NUM ; i++) { - DC_LOG_MST("stream_enc[%d]: 0x%x " + DC_LOG_MST("stream_enc[%d]: %p " "stream[%d].vcp_id: %d " "stream[%d].slot_count: %d\n", i, - link->mst_stream_alloc_table.stream_allocations[i].stream_enc, + (void *) link->mst_stream_alloc_table.stream_allocations[i].stream_enc, i, link->mst_stream_alloc_table.stream_allocations[i].vcp_id, i,
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -2
@@ -2777,13 +2777,13 @@ static void dce110_program_front_end_for_pipe( dc->hwss.set_output_transfer_func (pipe_ctx, pipe_ctx->stream); DC_LOG_SURFACE( - "Pipe:%d 0x%x: addr hi:0x%x, " + "Pipe:%d %p: addr hi:0x%x, " "addr low:0x%x, " "src: %d, %d, %d," " %d; dst: %d, %d, %d, %d;" "clip: %d, %d, %d, %d\n", pipe_ctx->pipe_idx, - pipe_ctx->plane_state, + (void *) pipe_ctx->plane_state, pipe_ctx->plane_state->address.grph.addr.high_part, pipe_ctx->plane_state->address.grph.addr.low_part, pipe_ctx->plane_state->src_rect.x,
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.c +1 -1
@@ -527,7 +527,7 @@ static void construct(REG_GET (MICROSECOND_TIME_BASE_DIV ,XTAL_REF_DIV , &xtal_ref_div);if (xtal_ref_div ==0 ) { -DC_LOG_WARNING ("Invalid base timer divider\n" , +DC_LOG_WARNING ("Invalid base timer divider [%s]\n" , __func__); xtal_ref_div =2 ; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 27/34 drm/amd/display: Add num_active_wb to DML
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dml/display_mode_structs.h +1 -0
@@ -224,6 +224,7 @@ struct _vcs_dpi_display_output_params_st {int output_bpp;int dsc_enable;int wb_enable; +int num_active_wb;int opp_input_bpc;int output_type;int output_format;
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 28/34 drm/amd/display: Add double buffer machanism to ICSC
In reply to a message not in the archiveFrom: Xingyue Tao <[email protected]>
- Video playback shows tearing when adjusting
brightness through radeon custom settings.
- Now added double buffer mechanism to switch
input CSC from register buffer ICSC and COMA
- Improved tab alignment
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 11 +++++- .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 44 ++++++++++++++-------- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 31 ++++++++++++++- 3 files changed, 67 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +9 -2
@@ -108,6 +108,8 @@SRI (CM_DGAM_LUT_DATA ,CM , id), \SRI (CM_CONTROL ,CM , id), \SRI (CM_DGAM_CONTROL ,CM , id), \ +SRI (CM_TEST_DEBUG_INDEX ,CM , id), \ +SRI (CM_TEST_DEBUG_DATA ,CM , id), \SRI (FORMAT_CONTROL ,CNVC_CFG , id), \SRI (CNVC_SURFACE_PIXEL_FORMAT ,CNVC_CFG , id), \ SRI(CURSOR0_CONTROL, CNVC_CUR, id), \
@@ -300,6 +302,7 @@TF_SF (CM0_CM_DGAM_LUT_INDEX ,CM_DGAM_LUT_INDEX , mask_sh), \TF_SF (CM0_CM_DGAM_LUT_DATA ,CM_DGAM_LUT_DATA , mask_sh), \TF_SF (CM0_CM_DGAM_CONTROL ,CM_DGAM_LUT_MODE , mask_sh), \ +TF_SF (CM0_CM_TEST_DEBUG_INDEX ,CM_TEST_DEBUG_INDEX , mask_sh), \TF_SF (CNVC_CFG0_FORMAT_CONTROL ,CNVC_BYPASS , mask_sh), \TF2_SF (CNVC_CFG0 ,FORMAT_CONTROL__ALPHA_EN , mask_sh), \ TF_SF(CNVC_CFG0_FORMAT_CONTROL, FORMAT_EXPANSION_MODE, mask_sh), \
@@ -1010,6 +1013,8 @@type CUR0_EXPANSION_MODE ; \type CUR0_ENABLE ; \type CM_BYPASS ; \ +type CM_TEST_DEBUG_INDEX ; \ +type CM_TEST_DEBUG_DATA_ID9_ICSC_MODE ; \type FORMAT_CONTROL__ALPHA_EN ; \type CUR0_COLOR0 ; \type CUR0_COLOR1 ; \
@@ -1255,6 +1260,8 @@ struct dcn_dpp_mask {uint32_t CM_IGAM_LUT_RW_CONTROL ; \uint32_t CM_IGAM_LUT_RW_INDEX ; \uint32_t CM_IGAM_LUT_SEQ_COLOR ; \ +uint32_t CM_TEST_DEBUG_INDEX ; \ +uint32_t CM_TEST_DEBUG_DATA ; \uint32_t FORMAT_CONTROL ; \uint32_t CNVC_SURFACE_PIXEL_FORMAT ; \uint32_t CURSOR_CONTROL ; \
@@ -1289,8 +1296,8 @@ struct dcn10_dpp {enum dcn10_input_csc_select {INPUT_CSC_SELECT_BYPASS =0 , -INPUT_CSC_SELECT_ICSC , -INPUT_CSC_SELECT_COMA +INPUT_CSC_SELECT_ICSC =1 , +INPUT_CSC_SELECT_COMA =2 }; void dpp1_set_cursor_attributes(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +28 -16
93 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +30 -1
@@ -319,12 +319,41 @@ static const struct dcn_dpp_registers tf_regs[] = { tf_regs(3), }; +/* +* +DCN1 CM debug status register definition + +register :ID9_CM_STATUS do +implement_ref :cm +map to: :cmdebugind, at: j +width 32 +disclosure NEVER + +field :ID9_VUPDATE_CFG, [0], R +field :ID9_IGAM_LUT_MODE, [2..1], R +field :ID9_BNS_BYPASS, [3], R +field :ID9_ICSC_MODE, [5..4], R +field :ID9_DGAM_LUT_MODE, [8..6], R +field :ID9_HDR_BYPASS, [9], R +field :ID9_GAMUT_REMAP_MODE, [11..10], R +field :ID9_RGAM_LUT_MODE, [14..12], R +#1 free bit +field :ID9_OCSC_MODE, [18..16], R +field :ID9_DENORM_MODE, [21..19], R +field :ID9_ROUND_TRUNC_MODE, [25..22], R +field :ID9_DITHER_EN, [26], R +field :ID9_DITHER_MODE, [28..27], R +end +*/ +static const struct dcn_dpp_shift tf_shift = { -TF_REG_LIST_SH_MASK_DCN10 (__SHIFT) +TF_REG_LIST_SH_MASK_DCN10 (__SHIFT), + .CM_TEST_DEBUG_DATA_ID9_ICSC_MODE =0x4 };static const struct dcn_dpp_mask tf_mask = {TF_REG_LIST_SH_MASK_DCN10 (_MASK), + .CM_TEST_DEBUG_DATA_ID9_ICSC_MODE =0x30 };static const struct dcn_mpc_registers mpc_regs = {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 29/34 drm/amd/display: Couple bug fixes in stats module
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/modules/stats/stats.c | 39 ++++++++++++++++------- 1 file changed, 28 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/modules/stats/stats.c +28 -11
@@ -187,7 +187,7 @@ void mod_stats_dump(struct mod_stats *mod_stats)for (int i =0 ; i < core_stats->index && i < core_stats->entries; i++) { dm_logger_write(logger, LOG_PROFILING, - "%u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u\n", + "%u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u", time[i].render_time_in_us, time[i].avg_render_time_in_us_last_ten, time[i].min_window,
@@ -227,7 +227,7 @@ void mod_stats_reset_data(struct mod_stats *mod_stats)memset (core_stats->time,0 ,sizeof (struct stats_time_cache ) * core_stats->entries); - core_stats->index =0 ; + core_stats->index =1 ; } void mod_stats_update_flip(struct mod_stats *mod_stats,
@@ -250,7 +250,7 @@ void mod_stats_update_flip(struct mod_stats *mod_stats, time[index].flip_timestamp_in_ns = timestamp_in_ns; time[index].render_time_in_us = - timestamp_in_ns - time[index -1 ].flip_timestamp_in_ns; + (timestamp_in_ns - time[index -1 ].flip_timestamp_in_ns) /1000 ;if (index >=10 ) {for (unsigned int i =0 ; i <10 ; i++)
@@ -261,10 +261,12 @@ void mod_stats_update_flip(struct mod_stats *mod_stats,if (time[index].num_vsync_between_flips >0 ) time[index].vsync_to_flip_time_in_us = - timestamp_in_ns - time[index].vupdate_timestamp_in_ns; + (timestamp_in_ns - + time[index].vupdate_timestamp_in_ns) /1000 ;else time[index].vsync_to_flip_time_in_us = - timestamp_in_ns - time[index -1 ].vupdate_timestamp_in_ns; + (timestamp_in_ns - + time[index -1 ].vupdate_timestamp_in_ns) /1000 ; core_stats->index++; }
@@ -275,6 +277,8 @@ void mod_stats_update_vupdate(struct mod_stats *mod_stats,struct core_stats *core_stats =NULL ;struct stats_time_cache *time =NULL ;unsigned int index =0 ; +unsigned int num_vsyncs =0 ; +unsigned int prev_vsync_in_ns =0 ;if (mod_stats ==NULL )return ;
@@ -286,14 +290,27 @@ void mod_stats_update_vupdate(struct mod_stats *mod_stats, time = core_stats->time; index = core_stats->index; + num_vsyncs = time[index].num_vsync_between_flips; + +if (num_vsyncs <MOD_STATS_NUM_VSYNCS ) { +if (num_vsyncs ==0 ) { + prev_vsync_in_ns = + time[index -1 ].vupdate_timestamp_in_ns; + + time[index].flip_to_vsync_time_in_us = + (timestamp_in_ns - + time[index -1 ].flip_timestamp_in_ns) / +1000 ; + }else { + prev_vsync_in_ns = + time[index].vupdate_timestamp_in_ns; + } - time[index].vupdate_timestamp_in_ns = timestamp_in_ns; -if (time[index].num_vsync_between_flips <MOD_STATS_NUM_VSYNCS ) - time[index].v_sync_time_in_us[time[index].num_vsync_between_flips] = - timestamp_in_ns - time[index -1 ].vupdate_timestamp_in_ns; - time[index].flip_to_vsync_time_in_us = - timestamp_in_ns - time[index -1 ].flip_timestamp_in_ns; + time[index].v_sync_time_in_us[num_vsyncs] = + (timestamp_in_ns - prev_vsync_in_ns) /1000 ; + } + time[index].vupdate_timestamp_in_ns = timestamp_in_ns; time[index].num_vsync_between_flips++; }
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 30/34 drm/amd/display: Rename encoder_info_packet to dc_info_packet
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
Move this out of the HW includes to dc_types.h
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 99 +++++++++++----------- drivers/gpu/drm/amd/display/dc/dc_types.h | 9 ++ .../drm/amd/display/dc/dce/dce_stream_encoder.c | 4 +- .../gpu/drm/amd/display/dc/inc/hw/stream_encoder.h | 21 ++--- 4 files changed, 65 insertions(+), 68 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +48 -51
@@ -1811,7 +1811,7 @@ enum dc_status dc_validate_global_state( }static void patch_gamut_packet_checksum ( -struct encoder_info_packet *gamut_packet) +struct dc_info_packet *gamut_packet) {/* For gamut we recalc checksum */ if (gamut_packet->valid) {
@@ -1830,12 +1830,11 @@ static void patch_gamut_packet_checksum( }static void set_avi_info_frame ( -struct encoder_info_packet *info_packet, +struct dc_info_packet *info_packet,struct pipe_ctx *pipe_ctx) {struct dc_stream_state *stream = pipe_ctx->stream;enum dc_color_space color_space =COLOR_SPACE_UNKNOWN ; -struct info_frame info_frame = { {0 } };uint32_t pixel_encoding =0 ;enum scanning_type scan_type =SCANNING_TYPE_NODATA ;enum dc_aspect_ratio aspect =ASPECT_RATIO_NO_DATA ;
@@ -1845,7 +1844,7 @@ static void set_avi_info_frame(unsigned int cn0_cn1_value =0 ;uint8_t *check_sum =NULL ;uint8_t byte_index =0 ; -union hdmi_info_packet *hdmi_info = &info_frame.avi_info_packet.info_packet_hdmi; +union hdmi_info_packet hdmi_info = {0 };union display_content_support support = {0 };unsigned int vic = pipe_ctx->stream->timing.vic;enum dc_timing_3d_format format;
@@ -1856,11 +1855,11 @@ static void set_avi_info_frame( COLOR_SPACE_SRGB:COLOR_SPACE_YCBCR709 ;/* Initialize header */ - hdmi_info->bits.header.info_frame_type =HDMI_INFOFRAME_TYPE_AVI ; + hdmi_info.bits.header.info_frame_type =HDMI_INFOFRAME_TYPE_AVI ;/* InfoFrameVersion_3 is defined by CEA861F (Section 6.4), but shall * not be used in HDMI 2.0 (Section 10.1) */ - hdmi_info->bits.header.version =2 ; - hdmi_info->bits.header.length =HDMI_AVI_INFOFRAME_SIZE ; + hdmi_info.bits.header.version =2 ; + hdmi_info.bits.header.length =HDMI_AVI_INFOFRAME_SIZE ;/* * IDO-defined (Y2,Y1,Y0 = 1,1,1) shall not be used by devices built
@@ -1886,39 +1885,39 @@ static void set_avi_info_frame(/* Y0_Y1_Y2 : The pixel encoding */ /* H14b AVI InfoFrame has extension on Y-field from 2 bits to 3 bits */ - hdmi_info->bits.Y0_Y1_Y2 = pixel_encoding; + hdmi_info.bits.Y0_Y1_Y2 = pixel_encoding;/* A0 = 1 Active Format Information valid */ - hdmi_info->bits.A0 =ACTIVE_FORMAT_VALID ; + hdmi_info.bits.A0 =ACTIVE_FORMAT_VALID ;/* B0, B1 = 3; Bar info data is valid */ - hdmi_info->bits.B0_B1 =BAR_INFO_BOTH_VALID ; + hdmi_info.bits.B0_B1 =BAR_INFO_BOTH_VALID ; - hdmi_info->bits.SC0_SC1 =PICTURE_SCALING_UNIFORM ; + hdmi_info.bits.SC0_SC1 =PICTURE_SCALING_UNIFORM ;/* S0, S1 : Underscan / Overscan */ /* TODO: un-hardcode scan type */ scan_type =SCANNING_TYPE_UNDERSCAN ; - hdmi_info->bits.S0_S1 = scan_type; + hdmi_info.bits.S0_S1 = scan_type;/* C0, C1 : Colorimetry */ if (color_space ==COLOR_SPACE_YCBCR709 || color_space ==COLOR_SPACE_YCBCR709_LIMITED ) - hdmi_info->bits.C0_C1 =COLORIMETRY_ITU709 ; + hdmi_info.bits.C0_C1 =COLORIMETRY_ITU709 ;else if (color_space ==COLOR_SPACE_YCBCR601 || color_space ==COLOR_SPACE_YCBCR601_LIMITED ) - hdmi_info->bits.C0_C1 =COLORIMETRY_ITU601 ; + hdmi_info.bits.C0_C1 =COLORIMETRY_ITU601 ;else { - hdmi_info->bits.C0_C1 =COLORIMETRY_NO_DATA ; + hdmi_info.bits.C0_C1 =COLORIMETRY_NO_DATA ; }if (color_space ==COLOR_SPACE_2020_RGB_FULLRANGE || color_space ==COLOR_SPACE_2020_RGB_LIMITEDRANGE || color_space ==COLOR_SPACE_2020_YCBCR ) { - hdmi_info->bits.EC0_EC2 =COLORIMETRYEX_BT2020RGBYCBCR ; - hdmi_info->bits.C0_C1 =COLORIMETRY_EXTENDED ; + hdmi_info.bits.EC0_EC2 =COLORIMETRYEX_BT2020RGBYCBCR ; + hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ; }else if (color_space ==COLOR_SPACE_ADOBERGB ) { - hdmi_info->bits.EC0_EC2 =COLORIMETRYEX_ADOBERGB ; - hdmi_info->bits.C0_C1 =COLORIMETRY_EXTENDED ; + hdmi_info.bits.EC0_EC2 =COLORIMETRYEX_ADOBERGB ; + hdmi_info.bits.C0_C1 =COLORIMETRY_EXTENDED ; }/* TODO: un-hardcode aspect ratio */
@@ -1927,18 +1926,18 @@ static void set_avi_info_frame(switch (aspect) {case ASPECT_RATIO_4_3 :case ASPECT_RATIO_16_9 : - hdmi_info->bits.M0_M1 = aspect; + hdmi_info.bits.M0_M1 = aspect;break ;case ASPECT_RATIO_NO_DATA :case ASPECT_RATIO_64_27 :case ASPECT_RATIO_256_135 :default : - hdmi_info->bits.M0_M1 =0 ; + hdmi_info.bits.M0_M1 =0 ; }/* Active Format Aspect ratio - same as Picture Aspect Ratio. */ - hdmi_info->bits.R0_R3 =ACTIVE_FORMAT_ASPECT_RATIO_SAME_AS_PICTURE ; + hdmi_info.bits.R0_R3 =ACTIVE_FORMAT_ASPECT_RATIO_SAME_AS_PICTURE ;/* TODO: un-hardcode cn0_cn1 and itc */
@@ -1981,8 +1980,8 @@ static void set_avi_info_frame( } } } - hdmi_info->bits.CN0_CN1 = cn0_cn1_value; - hdmi_info->bits.ITC = itc_value; + hdmi_info.bits.CN0_CN1 = cn0_cn1_value; + hdmi_info.bits.ITC = itc_value; }/* TODO : We should handle YCC quantization */
@@ -1991,19 +1990,19 @@ static void set_avi_info_frame( stream->sink->edid_caps.qy_bit == 1) {if (color_space ==COLOR_SPACE_SRGB || color_space ==COLOR_SPACE_2020_RGB_FULLRANGE ) { - hdmi_info->bits.Q0_Q1 =RGB_QUANTIZATION_FULL_RANGE ; - hdmi_info->bits.YQ0_YQ1 =YYC_QUANTIZATION_FULL_RANGE ; + hdmi_info.bits.Q0_Q1 =RGB_QUANTIZATION_FULL_RANGE ; + hdmi_info.bits.YQ0_YQ1 =YYC_QUANTIZATION_FULL_RANGE ; }else if (color_space ==COLOR_SPACE_SRGB_LIMITED || color_space ==COLOR_SPACE_2020_RGB_LIMITEDRANGE ) { - hdmi_info->bits.Q0_Q1 =RGB_QUANTIZATION_LIMITED_RANGE ; - hdmi_info->bits.YQ0_YQ1 =YYC_QUANTIZATION_LIMITED_RANGE ; + hdmi_info.bits.Q0_Q1 =RGB_QUANTIZATION_LIMITED_RANGE ; + hdmi_info.bits.YQ0_YQ1 =YYC_QUANTIZATION_LIMITED_RANGE ; }else { - hdmi_info->bits.Q0_Q1 =RGB_QUANTIZATION_DEFAULT_RANGE ; - hdmi_info->bits.YQ0_YQ1 =YYC_QUANTIZATION_LIMITED_RANGE ; + hdmi_info.bits.Q0_Q1 =RGB_QUANTIZATION_DEFAULT_RANGE ; + hdmi_info.bits.YQ0_YQ1 =YYC_QUANTIZATION_LIMITED_RANGE ; } } else { - hdmi_info->bits.Q0_Q1 =RGB_QUANTIZATION_DEFAULT_RANGE ; - hdmi_info->bits.YQ0_YQ1 =YYC_QUANTIZATION_LIMITED_RANGE ; + hdmi_info.bits.Q0_Q1 =RGB_QUANTIZATION_DEFAULT_RANGE ; + hdmi_info.bits.YQ0_YQ1 =YYC_QUANTIZATION_LIMITED_RANGE ; }///VIC
@@ -2028,51 +2027,49 @@ static void set_avi_info_frame(break ; } } - hdmi_info->bits.VIC0_VIC7 = vic; + hdmi_info.bits.VIC0_VIC7 = vic;/* pixel repetition * PR0 - PR3 start from 0 whereas pHwPathMode->mode.timing.flags.pixel * repetition start from 1 */ - hdmi_info->bits.PR0_PR3 =0 ; + hdmi_info.bits.PR0_PR3 =0 ;/* Bar Info * barTop: Line Number of End of Top Bar. * barBottom: Line Number of Start of Bottom Bar. * barLeft: Pixel Number of End of Left Bar. * barRight: Pixel Number of Start of Right Bar. */ - hdmi_info->bits.bar_top = stream->timing.v_border_top; - hdmi_info->bits.bar_bottom = (stream->timing.v_total + hdmi_info.bits.bar_top = stream->timing.v_border_top; + hdmi_info.bits.bar_bottom = (stream->timing.v_total - stream->timing.v_border_bottom +1 ); - hdmi_info->bits.bar_left = stream->timing.h_border_left; - hdmi_info->bits.bar_right = (stream->timing.h_total + hdmi_info.bits.bar_left = stream->timing.h_border_left; + hdmi_info.bits.bar_right = (stream->timing.h_total - stream->timing.h_border_right +1 );/* check_sum - Calculate AFMT_AVI_INFO0 ~ AFMT_AVI_INFO3 */ - check_sum = &info_frame.avi_info_packet.info_packet_hdmi.packet_raw_data.sb[0 ]; + check_sum = &hdmi_info.packet_raw_data.sb[0 ]; *check_sum =HDMI_INFOFRAME_TYPE_AVI +HDMI_AVI_INFOFRAME_SIZE +2 ;for (byte_index =1 ; byte_index <=HDMI_AVI_INFOFRAME_SIZE ; byte_index++) - *check_sum += hdmi_info->packet_raw_data.sb[byte_index]; + *check_sum += hdmi_info.packet_raw_data.sb[byte_index];/* one byte complement */ *check_sum = (uint8_t ) (0x100 - *check_sum);/* Store in hw_path_mode */ - info_packet->hb0 = hdmi_info->packet_raw_data.hb0; - info_packet->hb1 = hdmi_info->packet_raw_data.hb1; - info_packet->hb2 = hdmi_info->packet_raw_data.hb2; + info_packet->hb0 = hdmi_info.packet_raw_data.hb0; + info_packet->hb1 = hdmi_info.packet_raw_data.hb1; + info_packet->hb2 = hdmi_info.packet_raw_data.hb2; -for (byte_index =0 ; byte_index <sizeof (info_frame.avi_info_packet. - info_packet_hdmi.packet_raw_data.sb); byte_index++) - info_packet->sb[byte_index] = info_frame.avi_info_packet. - info_packet_hdmi.packet_raw_data.sb[byte_index]; +for (byte_index =0 ; byte_index <sizeof (hdmi_info.packet_raw_data.sb); byte_index++) + info_packet->sb[byte_index] = hdmi_info.packet_raw_data.sb[byte_index]; info_packet->valid = true; }static void set_vendor_info_packet ( -struct encoder_info_packet *info_packet, +struct dc_info_packet *info_packet,struct dc_stream_state *stream) {uint32_t length =0 ;
@@ -2185,7 +2182,7 @@ static void set_vendor_info_packet( }static void set_spd_info_packet ( -struct encoder_info_packet *info_packet, +struct dc_info_packet *info_packet,struct dc_stream_state *stream) {/* SPD info packet for FreeSync */
@@ -2306,7 +2303,7 @@ static void set_spd_info_packet( }static void set_hdr_static_info_packet ( -struct encoder_info_packet *info_packet, +struct dc_info_packet *info_packet,struct dc_stream_state *stream) {uint16_t i =0 ;
@@ -2403,7 +2400,7 @@ static void set_hdr_static_info_packet( }static void set_vsc_info_packet ( -struct encoder_info_packet *info_packet, +struct dc_info_packet *info_packet,struct dc_stream_state *stream) {unsigned int vscPacketRevision =0 ;
drivers/gpu/drm/amd/display/dc/dc_types.h +9 -0
@@ -530,6 +530,15 @@ struct vrr_params {uint32_t frame_counter; }; +struct dc_info_packet { +bool valid; +uint8_t hb0; +uint8_t hb1; +uint8_t hb2; +uint8_t hb3; +uint8_t sb[32 ]; +}; +#define DC_PLANE_UPDATE_TIMES_MAX 10struct dc_plane_flip_time {
drivers/gpu/drm/amd/display/dc/dce/dce_stream_encoder.c +2 -2
@@ -80,7 +80,7 @@ enum {static void dce110_update_generic_info_packet (struct dce110_stream_encoder *enc110,uint32_t packet_index, -const struct encoder_info_packet *info_packet) +const struct dc_info_packet *info_packet) {uint32_t regval;/* TODOFPGA Figure out a proper number for max_retries polling for lock
@@ -196,7 +196,7 @@ static void dce110_update_generic_info_packet(static void dce110_update_hdmi_info_packet (struct dce110_stream_encoder *enc110,uint32_t packet_index, -const struct encoder_info_packet *info_packet) +const struct dc_info_packet *info_packet) {uint32_t cont, send, line;
drivers/gpu/drm/amd/display/dc/inc/hw/stream_encoder.h +6 -15
@@ -34,26 +34,17 @@ struct dc_bios;struct dc_context ;struct dc_crtc_timing ; -struct encoder_info_packet { -bool valid; -uint8_t hb0; -uint8_t hb1; -uint8_t hb2; -uint8_t hb3; -uint8_t sb[32 ]; -}; -struct encoder_info_frame {/* auxiliary video information */ -struct encoder_info_packet avi; -struct encoder_info_packet gamut; -struct encoder_info_packet vendor; +struct dc_info_packet avi; +struct dc_info_packet gamut; +struct dc_info_packet vendor;/* source product description */ -struct encoder_info_packet spd; +struct dc_info_packet spd;/* video stream configuration */ -struct encoder_info_packet vsc; +struct dc_info_packet vsc;/* HDR Static MetaData */ -struct encoder_info_packet hdrsmd; +struct dc_info_packet hdrsmd; };struct encoder_unblank_param {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 31/34 drm/amd/display: Add vline IRQ programming for DCN
In reply to a message not in the archiveFrom: SivapiriyanKumarasamy <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 6 ++ drivers/gpu/drm/amd/display/dc/dc_stream.h | 4 ++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 76 ++++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 14 ++++ .../drm/amd/display/dc/inc/hw/timing_generator.h | 3 + drivers/gpu/drm/amd/display/dc/irq_types.h | 7 ++ 6 files changed, 110 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -0
@@ -1375,6 +1375,12 @@ static void commit_planes_for_stream(struct dc *dc, pipe_ctx->stream_res.abm->funcs->set_abm_level ( pipe_ctx->stream_res.abm, stream->abm_level); } + +if (stream_update && stream_update->periodic_fn_vsync_delta && + pipe_ctx->stream_res.tg->funcs->program_vline_interrupt) + pipe_ctx->stream_res.tg->funcs->program_vline_interrupt ( + pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing, + pipe_ctx->stream->periodic_fn_vsync_delta); } }
drivers/gpu/drm/amd/display/dc/dc_stream.h +4 -0
@@ -70,6 +70,9 @@ struct dc_stream_state {enum color_transfer_func output_tf;bool ignore_msa_timing_param; + +unsigned long long periodic_fn_vsync_delta; +/* TODO: custom INFO packets */ /* TODO: ABM info (DMCU) */ /* PSR info */
@@ -113,6 +116,7 @@ struct dc_stream_update {struct dc_hdr_static_metadata *hdr_static_metadata;enum color_transfer_func color_output_tf;unsigned int *abm_level; +unsigned long long *periodic_fn_vsync_delta; }; bool dc_is_stream_unchanged(
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +76 -0
88 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +14 -0
@@ -65,6 +65,8 @@SRI (OTG_NOM_VERT_POSITION ,OTG , inst),\SRI (OTG_BLACK_COLOR ,OTG , inst),\SRI (OTG_CLOCK_CONTROL ,OTG , inst),\ +SRI (OTG_VERTICAL_INTERRUPT0_CONTROL ,OTG , inst),\ +SRI (OTG_VERTICAL_INTERRUPT0_POSITION ,OTG , inst),\SRI (OTG_VERTICAL_INTERRUPT2_CONTROL ,OTG , inst),\SRI (OTG_VERTICAL_INTERRUPT2_POSITION ,OTG , inst),\ SRI(OPTC_INPUT_CLOCK_CONTROL, ODM, inst),\
@@ -124,6 +126,8 @@ struct dcn_optc_registers {uint32_t OTG_TEST_PATTERN_CONTROL ;uint32_t OTG_TEST_PATTERN_COLOR ;uint32_t OTG_CLOCK_CONTROL ; +uint32_t OTG_VERTICAL_INTERRUPT0_CONTROL ; +uint32_t OTG_VERTICAL_INTERRUPT0_POSITION ;uint32_t OTG_VERTICAL_INTERRUPT2_CONTROL ;uint32_t OTG_VERTICAL_INTERRUPT2_POSITION ;uint32_t OPTC_INPUT_CLOCK_CONTROL ;
@@ -206,6 +210,9 @@ struct dcn_optc_registers {SF (OTG0_OTG_CLOCK_CONTROL ,OTG_CLOCK_EN , mask_sh),\SF (OTG0_OTG_CLOCK_CONTROL ,OTG_CLOCK_ON , mask_sh),\SF (OTG0_OTG_CLOCK_CONTROL ,OTG_CLOCK_GATE_DIS , mask_sh),\ +SF (OTG0_OTG_VERTICAL_INTERRUPT0_CONTROL ,OTG_VERTICAL_INTERRUPT0_INT_ENABLE , mask_sh),\ +SF (OTG0_OTG_VERTICAL_INTERRUPT0_POSITION ,OTG_VERTICAL_INTERRUPT0_LINE_START , mask_sh),\ +SF (OTG0_OTG_VERTICAL_INTERRUPT0_POSITION ,OTG_VERTICAL_INTERRUPT0_LINE_END , mask_sh),\SF (OTG0_OTG_VERTICAL_INTERRUPT2_CONTROL ,OTG_VERTICAL_INTERRUPT2_INT_ENABLE , mask_sh),\SF (OTG0_OTG_VERTICAL_INTERRUPT2_POSITION ,OTG_VERTICAL_INTERRUPT2_LINE_START , mask_sh),\ SF(ODM0_OPTC_INPUT_CLOCK_CONTROL, OPTC_INPUT_CLK_EN, mask_sh),\
@@ -323,6 +330,9 @@ struct dcn_optc_registers {type OTG_CLOCK_EN ;\type OTG_CLOCK_ON ;\type OTG_CLOCK_GATE_DIS ;\ +type OTG_VERTICAL_INTERRUPT0_INT_ENABLE ;\ +type OTG_VERTICAL_INTERRUPT0_LINE_START ;\ +type OTG_VERTICAL_INTERRUPT0_LINE_END ;\type OTG_VERTICAL_INTERRUPT2_INT_ENABLE ;\type OTG_VERTICAL_INTERRUPT2_LINE_START ;\type OPTC_INPUT_CLK_EN ;\
@@ -420,6 +430,10 @@ void optc1_program_timing(const struct dc_crtc_timing *dc_crtc_timing, bool use_vbios); +void optc1_program_vline_interrupt (struct timing_generator *optc, +const struct dc_crtc_timing *dc_crtc_timing, +unsigned long long vsync_delta); +void optc1_program_global_sync (struct timing_generator *optc);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +3 -0
@@ -140,6 +140,9 @@ struct timing_generator_funcs {void (*program_timing)(struct timing_generator *tg,const struct dc_crtc_timing *timing,bool use_vbios); +void (*program_vline_interrupt)(struct timing_generator *optc, +const struct dc_crtc_timing *dc_crtc_timing, +unsigned long long vsync_delta);bool (*enable_crtc)(struct timing_generator *tg);bool (*disable_crtc)(struct timing_generator *tg);bool (*is_counter_moving)(struct timing_generator *tg);
drivers/gpu/drm/amd/display/dc/irq_types.h +7 -0
@@ -135,6 +135,13 @@ enum dc_irq_source {DC_IRQ_SOURCE_VBLANK5 ,DC_IRQ_SOURCE_VBLANK6 , +DC_IRQ_SOURCE_DC1_VLINE0 , +DC_IRQ_SOURCE_DC2_VLINE0 , +DC_IRQ_SOURCE_DC3_VLINE0 , +DC_IRQ_SOURCE_DC4_VLINE0 , +DC_IRQ_SOURCE_DC5_VLINE0 , +DC_IRQ_SOURCE_DC6_VLINE0 , +DAL_IRQ_SOURCES_NUMBER };
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 32/34 drm/amd/display: Add double buffer machanism to OCSC
In reply to a message not in the archiveFrom: Xingyue Tao <[email protected]>
- Added double buffer mechanism to output CSC so that there's no tearing when adjusting brightness from Radeon settings
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h | 36 +++++++++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 46 +++++++++++++--------- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 32 ++------------- 3 files changed, 67 insertions(+), 47 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.h +36 -0
@@ -420,6 +420,41 @@TF_SF (CURSOR0_CURSOR_CONTROL ,CURSOR_ENABLE , mask_sh), \TF_SF (DPP_TOP0_DPP_CONTROL ,DPPCLK_RATE_CONTROL , mask_sh) +/* +* +DCN1 CM debug status register definition + +register :ID9_CM_STATUS do +implement_ref :cm +map to: :cmdebugind, at: j +width 32 +disclosure NEVER + +field :ID9_VUPDATE_CFG, [0], R +field :ID9_IGAM_LUT_MODE, [2..1], R +field :ID9_BNS_BYPASS, [3], R +field :ID9_ICSC_MODE, [5..4], R +field :ID9_DGAM_LUT_MODE, [8..6], R +field :ID9_HDR_BYPASS, [9], R +field :ID9_GAMUT_REMAP_MODE, [11..10], R +field :ID9_RGAM_LUT_MODE, [14..12], R +#1 free bit +field :ID9_OCSC_MODE, [18..16], R +field :ID9_DENORM_MODE, [21..19], R +field :ID9_ROUND_TRUNC_MODE, [25..22], R +field :ID9_DITHER_EN, [26], R +field :ID9_DITHER_MODE, [28..27], R +end +*/ + +#define TF_DEBUG_REG_LIST_SH_DCN10 \ + .CM_TEST_DEBUG_DATA_ID9_ICSC_MODE = 4, \ + .CM_TEST_DEBUG_DATA_ID9_OCSC_MODE = 16 + +#define TF_DEBUG_REG_LIST_MASK_DCN10 \ + .CM_TEST_DEBUG_DATA_ID9_ICSC_MODE = 0x30, \ + .CM_TEST_DEBUG_DATA_ID9_OCSC_MODE = 0x70000 +#define TF_REG_FIELD_LIST (type) \ type EXT_OVERSCAN_LEFT; \ type EXT_OVERSCAN_RIGHT; \
@@ -1015,6 +1050,7 @@type CM_BYPASS ; \type CM_TEST_DEBUG_INDEX ; \type CM_TEST_DEBUG_DATA_ID9_ICSC_MODE ; \ +type CM_TEST_DEBUG_DATA_ID9_OCSC_MODE ;\type FORMAT_CONTROL__ALPHA_EN ; \type CUR0_COLOR0 ; \type CUR0_COLOR1 ; \
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +28 -18
93 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +3 -29
@@ -319,41 +319,15 @@ static const struct dcn_dpp_registers tf_regs[] = { tf_regs(3), }; -/* -* -DCN1 CM debug status register definition - -register :ID9_CM_STATUS do -implement_ref :cm -map to: :cmdebugind, at: j -width 32 -disclosure NEVER - -field :ID9_VUPDATE_CFG, [0], R -field :ID9_IGAM_LUT_MODE, [2..1], R -field :ID9_BNS_BYPASS, [3], R -field :ID9_ICSC_MODE, [5..4], R -field :ID9_DGAM_LUT_MODE, [8..6], R -field :ID9_HDR_BYPASS, [9], R -field :ID9_GAMUT_REMAP_MODE, [11..10], R -field :ID9_RGAM_LUT_MODE, [14..12], R -#1 free bit -field :ID9_OCSC_MODE, [18..16], R -field :ID9_DENORM_MODE, [21..19], R -field :ID9_ROUND_TRUNC_MODE, [25..22], R -field :ID9_DITHER_EN, [26], R -field :ID9_DITHER_MODE, [28..27], R -end -*/ -static const struct dcn_dpp_shift tf_shift = {TF_REG_LIST_SH_MASK_DCN10 (__SHIFT), - .CM_TEST_DEBUG_DATA_ID9_ICSC_MODE =0x4 +TF_DEBUG_REG_LIST_SH_DCN10 + };static const struct dcn_dpp_mask tf_mask = {TF_REG_LIST_SH_MASK_DCN10 (_MASK), - .CM_TEST_DEBUG_DATA_ID9_ICSC_MODE =0x30 +TF_DEBUG_REG_LIST_MASK_DCN10 };static const struct dcn_mpc_registers mpc_regs = {
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 33/34 drm/amd/display: Only program MSA_TIMING_PARAM if it changed
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +10 -5
@@ -1183,16 +1183,21 @@ static void enable_stream_features(struct pipe_ctx *pipe_ctx) {struct dc_stream_state *stream = pipe_ctx->stream;struct dc_link *link = stream->sink->link; -union down_spread_ctrl downspread; +union down_spread_ctrl old_downspread; +union down_spread_ctrl new_downspread;core_link_read_dpcd (link,DP_DOWNSPREAD_CTRL , - &downspread.raw,sizeof (downspread)); + &old_downspread.raw,sizeof (old_downspread)); - downspread.bits.IGNORE_MSA_TIMING_PARAM = + new_downspread.raw = old_downspread.raw; + + new_downspread.bits.IGNORE_MSA_TIMING_PARAM = (stream->ignore_msa_timing_param) ?1 :0 ; -core_link_write_dpcd (link,DP_DOWNSPREAD_CTRL , - &downspread.raw,sizeof (downspread)); +if (new_downspread.raw != old_downspread.raw) { +core_link_write_dpcd (link,DP_DOWNSPREAD_CTRL , + &new_downspread.raw,sizeof (new_downspread)); + } } static enum dc_status enable_link_dp(
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 34/34 drm/amd/display: Move commit_planes_to_stream to amdgpu_dm
In reply to a message not in the archive--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 108 +++++++++++++++++++++- drivers/gpu/drm/amd/display/dc/core/dc.c | 89 ------------------ drivers/gpu/drm/amd/display/dc/dc_stream.h | 7 -- 3 files changed, 103 insertions(+), 101 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +103 -5
@@ -4012,6 +4012,97 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc,spin_unlock_irqrestore (&crtc->dev->event_lock, flags); } +/* +* TODO this whole function needs to go +* +* dc_surface_update is needlessly complex. See if we can just replace this +* with a dc_plane_state and follow the atomic model a bit more closely here. +*/ +static bool commit_planes_to_stream ( +struct dc *dc, +struct dc_plane_state **plane_states, +uint8_t new_plane_count, +struct dm_crtc_state *dm_new_crtc_state, +struct dm_crtc_state *dm_old_crtc_state, +struct dc_state *state) +{ +/* no need to dynamically allocate this. it's pretty small */ +struct dc_surface_update updates[MAX_SURFACES ]; +struct dc_flip_addrs *flip_addr; +struct dc_plane_info *plane_info; +struct dc_scaling_info *scaling_info; +int i; +struct dc_stream_state *dc_stream = dm_new_crtc_state->stream; +struct dc_stream_update *stream_update = +kzalloc (sizeof (struct dc_stream_update ),GFP_KERNEL ); + +if (!stream_update) { +BREAK_TO_DEBUGGER (); +return false; + } + + flip_addr =kcalloc (MAX_SURFACES ,sizeof (struct dc_flip_addrs ), +GFP_KERNEL ); + plane_info =kcalloc (MAX_SURFACES ,sizeof (struct dc_plane_info ), +GFP_KERNEL ); + scaling_info =kcalloc (MAX_SURFACES ,sizeof (struct dc_scaling_info ), +GFP_KERNEL ); + +if (!flip_addr || !plane_info || !scaling_info) { +kfree (flip_addr); +kfree (plane_info); +kfree (scaling_info); +kfree (stream_update); +return false; + } + +memset (updates,0 ,sizeof (updates)); + + stream_update->src = dc_stream->src; + stream_update->dst = dc_stream->dst; + stream_update->out_transfer_func = dc_stream->out_transfer_func; + +for (i =0 ; i < new_plane_count; i++) { + updates[i].surface = plane_states[i]; + updates[i].gamma = + (struct dc_gamma *)plane_states[i]->gamma_correction; + updates[i].in_transfer_func = plane_states[i]->in_transfer_func; + flip_addr[i].address = plane_states[i]->address; + flip_addr[i].flip_immediate = plane_states[i]->flip_immediate; + plane_info[i].color_space = plane_states[i]->color_space; + plane_info[i].input_tf = plane_states[i]->input_tf; + plane_info[i].format = plane_states[i]->format; + plane_info[i].plane_size = plane_states[i]->plane_size; + plane_info[i].rotation = plane_states[i]->rotation; + plane_info[i].horizontal_mirror = plane_states[i]->horizontal_mirror; + plane_info[i].stereo_format = plane_states[i]->stereo_format; + plane_info[i].tiling_info = plane_states[i]->tiling_info; + plane_info[i].visible = plane_states[i]->visible; + plane_info[i].per_pixel_alpha = plane_states[i]->per_pixel_alpha; + plane_info[i].dcc = plane_states[i]->dcc; + scaling_info[i].scaling_quality = plane_states[i]->scaling_quality; + scaling_info[i].src_rect = plane_states[i]->src_rect; + scaling_info[i].dst_rect = plane_states[i]->dst_rect; + scaling_info[i].clip_rect = plane_states[i]->clip_rect; + + updates[i].flip_addr = &flip_addr[i]; + updates[i].plane_info = &plane_info[i]; + updates[i].scaling_info = &scaling_info[i]; + } + +dc_commit_updates_for_stream ( + dc, + updates, + new_plane_count, + dc_stream, stream_update, plane_states, state); + +kfree (flip_addr); +kfree (plane_info); +kfree (scaling_info); +kfree (stream_update); +return true; +} + static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, struct drm_device *dev, struct amdgpu_display_manager *dm,
@@ -4027,6 +4118,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,struct drm_crtc_state *new_pcrtc_state =drm_atomic_get_new_crtc_state (state, pcrtc);struct dm_crtc_state *acrtc_state =to_dm_crtc_state (new_pcrtc_state); +struct dm_crtc_state *dm_old_crtc_state = +to_dm_crtc_state (drm_atomic_get_old_crtc_state (state, pcrtc));struct dm_atomic_state *dm_state =to_dm_atomic_state (state);int planes_count =0 ;unsigned long flags;
@@ -4105,10 +4198,12 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,spin_unlock_irqrestore (&pcrtc->dev->event_lock, flags); } -if (false ==dc_commit_planes_to_stream (dm->dc, + +if (false ==commit_planes_to_stream (dm->dc, plane_states_constructed, planes_count, - dc_stream_attach, + acrtc_state, + dm_old_crtc_state, dm_state->context))dm_error ("%s: Failed to attach plane!\n" , __func__); }else {
@@ -4333,8 +4428,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)struct amdgpu_crtc *acrtc =to_amdgpu_crtc (dm_new_con_state->base.crtc);struct dc_stream_status *status =NULL ; -if (acrtc) +if (acrtc) { new_crtc_state =drm_atomic_get_new_crtc_state (state, &acrtc->base); + old_crtc_state =drm_atomic_get_old_crtc_state (state, &acrtc->base); + }/* Skip any modesets/resets */ if (!acrtc ||drm_atomic_crtc_needs_modeset (new_crtc_state))
@@ -4357,11 +4454,12 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)WARN_ON (!status->plane_count);/*TODO How it works with MPO ?*/ -if (!dc_commit_planes_to_stream ( +if (!commit_planes_to_stream ( dm->dc, status->plane_states, status->plane_count, - dm_new_crtc_state->stream, + dm_new_crtc_state, +to_dm_crtc_state (old_crtc_state), dm_state->context))dm_error ("%s: Failed to update stream scaling!\n" , __func__); }
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -89
95 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_stream.h +0 -7
@@ -135,13 +135,6 @@ bool dc_is_stream_scaling_unchanged(* This does not trigger a flip. No surface address is programmed. */ -bool dc_commit_planes_to_stream ( -struct dc *dc, -struct dc_plane_state **plane_states, -uint8_t new_plane_count, -struct dc_stream_state *dc_stream, -struct dc_state *state); - void dc_commit_updates_for_stream(struct dc *dc, struct dc_surface_update *srf_updates, int surface_count,
Signature · 6 lines
2.14.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx