DC Patches April 26, 2023
Subsystems (5)
cover DC Patches April 26, 2023
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.165.0
- Add w/a to disable DP dual mode on certain ports
- Revert "Update scaler recout data for visual confirm"
- Filter out invalid bits in pipe_fuses
- Adding debug option to override Z8 watermark values
- Change default Z8 watermark values
- Workaround wrong HDR colorimetry with some receivers
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.165.0
Aric Cyr (1):
drm/amd/display: 3.2.234
George Shen (1):
drm/amd/display: Add w/a to disable DP dual mode on certain ports
Ilya Bakoulin (1):
drm/amd/display: Workaround wrong HDR colorimetry with some receivers
Leo Chen (2):
drm/amd/display: Change default Z8 watermark values drm/amd/display: Adding debug option to override Z8 watermark values
Leo Ma (1):
drm/amd/display: revert "Update scaler recout data for visual confirm"
Samson Tam (1):
drm/amd/display: filter out invalid bits in pipe_fuses
drivers/gpu/drm/amd/display/dc/core/dc.c | 7 +++++++ .../gpu/drm/amd/display/dc/core/dc_resource.c | 17 ----------------- drivers/gpu/drm/amd/display/dc/dc.h | 8 +++++++- .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 18 +++++++++++++++++- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 11 ++++++++++- .../amd/display/dc/dcn321/dcn321_resource.c | 10 +++++++++- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 11 +++++++++++ .../drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 ++-- .../drm/amd/display/dc/link/link_detection.c | 4 ++++ .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 10 +++++++++- 10 files changed, 76 insertions(+), 24 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/8 drm/amd/display: Workaround wrong HDR colorimetry with some receivers
From: Ilya Bakoulin <[email protected]>
[Why]
Some scalers do not pick up color space updates unless the DP link is disabled/re-enabled which can result in incorrect/washed out HDR colors in some cases.
[How]
Call set_dpms_on to disable the link, re-train and re-enable with the updated output color space.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/dc.h | 1 + 2 files changed, 8 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -0
@@ -3268,6 +3268,13 @@ static void commit_planes_do_stream_update(struct dc *dc, dc->hwss.prepare_bandwidth (dc, dc->current_state); dc->link_srv->set_dpms_on (dc->current_state, pipe_ctx); } + }else if (pipe_ctx->stream->link->wa_flags.blank_stream_on_ocs_change && stream_update->output_color_space + && !stream->dpms_off &&dc_is_dp_signal (pipe_ctx->stream->signal)) { +/* +* Workaround for firmware issue in some receivers where they don't pick up +* correct output color space unless DP link is disabled/re-enabled +*/ + dc->link_srv->set_dpms_on (dc->current_state, pipe_ctx); }if (stream_update->abm_level && pipe_ctx->stream_res.abm) {
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -1506,6 +1506,7 @@ struct dc_link {/* Forced DPIA into TBT3 compatibility mode. */ bool dpia_forced_tbt3_mode;bool dongle_mode_timing_override; +bool blank_stream_on_ocs_change; } wa_flags;struct link_mst_stream_allocation_table mst_stream_alloc_table;
Signature · 1 line
2.34.1
PATCH 2/8 drm/amd/display: Change default Z8 watermark values
In reply to Alan LiuFrom: Leo Chen <[email protected]>
[Why & How]
Previous Z8 watermark values were causing flickering and OTC underflow. Updating Z8 watermark values based on the measurement.
--- drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +2 -2
@@ -149,8 +149,8 @@ static struct _vcs_dpi_soc_bounding_box_st dcn3_14_soc = { .num_states = 5, .sr_exit_time_us = 16.5, .sr_enter_plus_exit_time_us = 18.5, - .sr_exit_z8_time_us = 210.0, - .sr_enter_plus_exit_z8_time_us = 310.0, + .sr_exit_z8_time_us = 268.0, + .sr_enter_plus_exit_z8_time_us = 393.0, .writeback_latency_us = 12.0, .dram_channel_width_bytes = 4, .round_trip_ping_latency_dcfclk_cycles = 106,
Signature · 1 line
2.34.1
PATCH 3/8 drm/amd/display: Adding debug option to override Z8 watermark values
In reply to Alan LiuFrom: Leo Chen <[email protected]>
[Why & How]
Adding debug options to override Z8 watermark values for testing purposes.
--- drivers/gpu/drm/amd/display/dc/dc.h | 4 ++++ drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 11 +++++++++++ 2 files changed, 15 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +4 -0
@@ -700,6 +700,8 @@ struct dc_virtual_addr_space_config {struct dc_bounding_box_overrides {int sr_exit_time_ns;int sr_enter_plus_exit_time_ns; +int sr_exit_z8_time_ns; +int sr_enter_plus_exit_z8_time_ns;int urgent_latency_ns;int percent_of_ideal_drambw;int dram_clock_change_latency_ns;
@@ -769,6 +771,8 @@ struct dc_debug_options {int sr_enter_plus_exit_time_dpm0_ns;int sr_exit_time_ns;int sr_enter_plus_exit_time_ns; +int sr_exit_z8_time_ns; +int sr_enter_plus_exit_z8_time_ns;int urgent_latency_ns;uint32_t underflow_assert_delay_us;int percent_of_ideal_drambw;
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +11 -0
@@ -1890,6 +1890,17 @@ void dcn20_patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_st dc->bb_overrides.sr_enter_plus_exit_time_ns /1000.0 ; } +if ((int )(bb->sr_exit_z8_time_us *1000 ) + != dc->bb_overrides.sr_exit_z8_time_ns + && dc->bb_overrides.sr_exit_z8_time_ns) { + bb->sr_exit_z8_time_us = dc->bb_overrides.sr_exit_z8_time_ns /1000.0 ; + } + +if ((int )(bb->sr_enter_plus_exit_z8_time_us *1000 ) + != dc->bb_overrides.sr_enter_plus_exit_z8_time_ns + && dc->bb_overrides.sr_enter_plus_exit_z8_time_ns) { + bb->sr_enter_plus_exit_z8_time_us = dc->bb_overrides.sr_enter_plus_exit_z8_time_ns /1000.0 ; + }if ((int )(bb->urgent_latency_us *1000 ) != dc->bb_overrides.urgent_latency_ns && dc->bb_overrides.urgent_latency_ns) { bb->urgent_latency_us = dc->bb_overrides.urgent_latency_ns /1000.0 ;
Signature · 1 line
2.34.1
PATCH 4/8 drm/amd/display: filter out invalid bits in pipe_fuses
In reply to Alan LiuFrom: Samson Tam <[email protected]>
[Why]
Reading pipe_fuses from register may have invalid bits set, which may
affect the num_pipes erroneously.
[How]
Add read_pipes_fuses() call and filter bits based on expected number
of pipes.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 10 +++++++++- .../gpu/drm/amd/display/dc/dcn321/dcn321_resource.c | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +9 -1
@@ -2082,6 +2082,14 @@ static struct resource_funcs dcn32_res_pool_funcs = { .restore_mall_state = dcn32_restore_mall_state, }; +static uint32_t read_pipe_fuses (struct dc_context *ctx) +{ +uint32_t value =REG_READ (CC_DC_PIPE_DIS ); +/* DCN32 support max 4 pipes */ + value = value &0xf ; +return value; +} + static bool dcn32_resource_construct( uint8_t num_virtual_links,
@@ -2125,7 +2133,7 @@ static bool dcn32_resource_construct( pool->base.res_cap = &res_cap_dcn32;/* max number of pipes for ASIC before checking for pipe fuses */ num_pipes = pool->base.res_cap->num_timing_generator; - pipe_fuses =REG_READ (CC_DC_PIPE_DIS ); + pipe_fuses =read_pipe_fuses (ctx);for (i =0 ; i < pool->base.res_cap->num_timing_generator; i++)if (pipe_fuses &1 << i)
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +9 -1
@@ -1633,6 +1633,14 @@ static struct resource_funcs dcn321_res_pool_funcs = { .restore_mall_state = dcn32_restore_mall_state, }; +static uint32_t read_pipe_fuses (struct dc_context *ctx) +{ +uint32_t value =REG_READ (CC_DC_PIPE_DIS ); +/* DCN321 support max 4 pipes */ + value = value &0xf ; +return value; +} + static bool dcn321_resource_construct( uint8_t num_virtual_links,
@@ -1675,7 +1683,7 @@ static bool dcn321_resource_construct( pool->base.res_cap = &res_cap_dcn321;/* max number of pipes for ASIC before checking for pipe fuses */ num_pipes = pool->base.res_cap->num_timing_generator; - pipe_fuses =REG_READ (CC_DC_PIPE_DIS ); + pipe_fuses =read_pipe_fuses (ctx);for (i =0 ; i < pool->base.res_cap->num_timing_generator; i++)if (pipe_fuses &1 << i)
Signature · 1 line
2.34.1
PATCH 5/8 drm/amd/display: revert "Update scaler recout data for visual confirm"
In reply to Alan LiuFrom: Leo Ma <[email protected]>
This reverts commit 8552024d1e2a008b6df544845d09120cfea9508b.
A regression is found on this change, so revert it for the time being and resubmit when issue is fixed.
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 17 ----------------- .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 18 +++++++++++++++++- 2 files changed, 17 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +0 -17
@@ -69,9 +69,6 @@#include "../dcn32/dcn32_resource.h" #include "../dcn321/dcn321_resource.h" -#define VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT 3 -#define VISUAL_CONFIRM_RECT_HEIGHT_MIN 1 -#define VISUAL_CONFIRM_RECT_HEIGHT_MAX 10#define DC_LOGGER_INIT (logger)
@@ -811,8 +808,6 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx)struct rect surf_clip = plane_state->clip_rect;bool split_tb = stream->view_format ==VIEW_3D_FORMAT_TOP_AND_BOTTOM ;int split_count, split_idx; -struct dpp *dpp = pipe_ctx->plane_res.dpp; -unsigned short visual_confirm_rect_height =VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT ;calculate_split_count_and_index (pipe_ctx, &split_count, &split_idx);if (stream->view_format ==VIEW_3D_FORMAT_SIDE_BY_SIDE )
@@ -881,18 +876,6 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx) data->recout.width = data->h_active - data->recout.x; } } - -/* Check bounds to ensure the VC bar height was set to a sane value */ -if (dpp !=NULL ) { -if ((dpp->ctx->dc->debug.visual_confirm_rect_height >=VISUAL_CONFIRM_RECT_HEIGHT_MIN ) && - (dpp->ctx->dc->debug.visual_confirm_rect_height <=VISUAL_CONFIRM_RECT_HEIGHT_MAX )) { - visual_confirm_rect_height = dpp->ctx->dc->debug.visual_confirm_rect_height; - } - -if (dpp->ctx->dc->debug.visual_confirm !=VISUAL_CONFIRM_DISABLE ) - data->recout.height = data->recout.height - -2 * (dpp->inst + visual_confirm_rect_height); - } }static void calculate_scaling_ratios (struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c +17 -1
@@ -39,6 +39,9 @@#define BLACK_OFFSET_RGB_Y 0x0#define BLACK_OFFSET_CBCR 0x8000 +#define VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT 3 +#define VISUAL_CONFIRM_RECT_HEIGHT_MIN 1 +#define VISUAL_CONFIRM_RECT_HEIGHT_MAX 10#define REG (reg)\ dpp->tf_regs->reg
@@ -588,6 +591,18 @@ static void dpp1_dscl_set_manual_ratio_init(static void dpp1_dscl_set_recout (struct dcn10_dpp *dpp,const struct rect *recout) { +int visual_confirm_on =0 ; +unsigned short visual_confirm_rect_height =VISUAL_CONFIRM_RECT_HEIGHT_DEFAULT ; + +if (dpp->base.ctx->dc->debug.visual_confirm !=VISUAL_CONFIRM_DISABLE ) + visual_confirm_on =1 ; + +/* Check bounds to ensure the VC bar height was set to a sane value */ +if ((dpp->base.ctx->dc->debug.visual_confirm_rect_height >=VISUAL_CONFIRM_RECT_HEIGHT_MIN ) && + (dpp->base.ctx->dc->debug.visual_confirm_rect_height <=VISUAL_CONFIRM_RECT_HEIGHT_MAX )) { + visual_confirm_rect_height = dpp->base.ctx->dc->debug.visual_confirm_rect_height; + } + REG_SET_2(RECOUT_START, 0, /* First pixel of RECOUT in the active OTG area */ RECOUT_START_X, recout->x,
@@ -598,7 +613,8 @@ static void dpp1_dscl_set_recout(struct dcn10_dpp *dpp,/* Number of RECOUT horizontal pixels */ RECOUT_WIDTH , recout->width,/* Number of RECOUT vertical lines */ - RECOUT_HEIGHT, recout->height); +RECOUT_HEIGHT , recout->height + - visual_confirm_on * 2 * (dpp->base.inst + visual_confirm_rect_height)); }/**
Signature · 1 line
2.34.1
PATCH 6/8 drm/amd/display: Add w/a to disable DP dual mode on certain ports
In reply to Alan LiuFrom: George Shen <[email protected]>
[Why]
Certain ports on DCN3.2 configs do not properly populate the BIOS info table flag to indicate DP dual mode is unsupported.
[How]
Add a workaround to disable DP dual mode on the ports with the missing BIOS info table flag.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c | 1 + drivers/gpu/drm/amd/display/dc/link/link_detection.c | 4 ++++ 3 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -887,6 +887,7 @@ struct dc_debug_options {bool override_odm_optimization;bool minimize_dispclk_using_odm;bool disable_subvp_high_refresh; +bool disable_dp_plus_plus_wa; };struct gpu_info_soc_bounding_box_v1_0 ;
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -0
@@ -729,6 +729,7 @@ static const struct dc_debug_options debug_defaults_drv = { .disable_fpo_vactive = false, .disable_boot_optimizations = false, .disable_subvp_high_refresh = true, + .disable_dp_plus_plus_wa = true, };static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/link/link_detection.c +4 -0
@@ -593,6 +593,10 @@ static bool detect_dp(struct dc_link *link,/* DP SST branch */ link->type = dc_connection_sst_branch; }else { +if (link->dc->debug.disable_dp_plus_plus_wa && + link->link_enc->features.flags.bits.IS_UHBR20_CAPABLE) +return false; +/* DP passive dongles */ sink_caps->signal = dp_passive_dongle_detection(link->ddc, sink_caps,
Signature · 1 line
2.34.1
PATCH 7/8 drm/amd/display: [FW Promotion] Release 0.0.165.0
In reply to Alan LiuFrom: Anthony Koo <[email protected]>
- Add dmub boot options to disable ips states on init
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +9 -1
@@ -398,6 +398,12 @@ enum dmub_lvtma_status_bit { DMUB_LVTMA_STATUS_BIT_EDP_ON = (1 << 1), }; +enum dmub_ips_disable_type { +DMUB_IPS_DISABLE_IPS1 =1 , +DMUB_IPS_DISABLE_IPS2 =2 , +DMUB_IPS_DISABLE_IPS2_Z10 =3 , +}; +/** * union dmub_fw_boot_options - Boot option definitions for SCRATCH14 */
@@ -423,7 +429,9 @@ union dmub_fw_boot_options { uint32_t usb4_dpia_bw_alloc_supported: 1; /* 1 if USB4 dpia BW allocation supported */ uint32_t disable_clk_ds: 1; /* 1 if disallow dispclk_ds and dppclk_ds*/ uint32_t disable_timeout_recovery : 1; /* 1 if timeout recovery should be disabled */ - uint32_t reserved : 13; /**< reserved */ + uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/ + uint32_t ips_disable: 2; /* options to disable ips support*/ + uint32_t reserved : 10; /**< reserved */ } bits;/**< boot bits */ uint32_t all;/**< 32-bit access to bits */ };
Signature · 1 line
2.34.1
PATCH 8/8 drm/amd/display: 3.2.234
In reply to Alan LiuFrom: Aric Cyr <[email protected]>
This version brings along following fixes:
- FW Release 0.0.165.0
- Add w/a to disable DP dual mode on certain ports
- Revert "Update scaler recout data for visual confirm"
- Filter out invalid bits in pipe_fuses
- Adding debug option to override Z8 watermark values
- Change default Z8 watermark values
- Workaround wrong HDR colorimetry with some receivers
--- 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
@@ -45,7 +45,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.233" +#define DC_VER "3.2.234"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.34.1
[Public]
Hi all,
This week this patchset was tested on the following systems:
Lenovo Thinkpad T14s Gen2, with AMD Ryzen 5 5650U
Lenovo Thinkpad T13s Gen4 with AMD Ryzen 5 6600U
Reference AMD RX6800
These systems were tested on the following display types:
eDP, (1080p 60hz [5650U]) (1920x1200 60hz [6600U]) (2560x1600 120hz[6600U]) VGA and DVI (1680x1050 60HZ [DP to VGA/DVI, USB-C to DVI/VGA]) DP/HDMI/USB-C (1440p 170hz, 4k 60hz, 4k 144hz [Includes USB-C to DP/HDMI adapters])
MST tested with Startech MST14DP123DP and 2x 4k 60Hz displays
DSC tested with Cable Matters 101075 (DP to 3x DP), and 201375 (USB-C to 3x DP) with 3x 4k60 displays HP Hook G2 with 1 and 2 4k60 Displays
The testing is a mix of automated and manual tests. Manual testing includes (but is not limited to):
Changing display configurations and settings
Benchmark testing
Feature testing (Freesync, etc.)
Automated testing includes (but is not limited to):
Script testing (scripts to automate some of the manual checks) IGT testing
The patchset consists of the amd-staging-drm-next branch (Head commit - f53eb9bfc5d7 BACKPORT: ASoC: SOF: fix compilation issue with readb/writeb helper) with new patches added on top of it. This branch is used for both Ubuntu and Chrome OS testing (ChromeOS on a bi-weekly basis).
Tested on Ubuntu 22.04.1 and Chrome OS
Thank you,
Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
amd.com
-----Original Message-----
From: Alan Liu <[email protected]>
Sent: April 26, 2023 12:27 PM
To: [email protected]
Cc: Wentland, Harry <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Siqueira, Rodrigo <[email protected]>; Pillai, Aurabindo <[email protected]>; Zhuo, Qingqing (Lillian) <[email protected]>; Li, Roman <[email protected]>; Lin, Wayne <[email protected]>; Wang, Chao-kai (Stylon) <[email protected]>; Chiu, Solomon <[email protected]>; Kotarac, Pavle <[email protected]>; Gutierrez, Agustin <[email protected]>; Liu, HaoPing (Alan) <[email protected]>; Wheeler, Daniel <[email protected]>
Subject: [PATCH 0/8] DC Patches April 26, 2023
This DC patchset brings improvements in multiple areas. In summary, we highlight:
- FW Release 0.0.165.0
- Add w/a to disable DP dual mode on certain ports
- Revert "Update scaler recout data for visual confirm"
- Filter out invalid bits in pipe_fuses
- Adding debug option to override Z8 watermark values
- Change default Z8 watermark values
- Workaround wrong HDR colorimetry with some receivers
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.165.0
Aric Cyr (1):
drm/amd/display: 3.2.234
George Shen (1):
drm/amd/display: Add w/a to disable DP dual mode on certain ports
Ilya Bakoulin (1):
drm/amd/display: Workaround wrong HDR colorimetry with some receivers
Leo Chen (2):
drm/amd/display: Change default Z8 watermark values drm/amd/display: Adding debug option to override Z8 watermark values
Leo Ma (1):
drm/amd/display: revert "Update scaler recout data for visual confirm"
Samson Tam (1):
drm/amd/display: filter out invalid bits in pipe_fuses
drivers/gpu/drm/amd/display/dc/core/dc.c | 7 +++++++ .../gpu/drm/amd/display/dc/core/dc_resource.c | 17 ----------------- drivers/gpu/drm/amd/display/dc/dc.h | 8 +++++++- .../drm/amd/display/dc/dcn10/dcn10_dpp_dscl.c | 18 +++++++++++++++++- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 11 ++++++++++- .../amd/display/dc/dcn321/dcn321_resource.c | 10 +++++++++- .../drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 11 +++++++++++ .../drm/amd/display/dc/dml/dcn314/dcn314_fpu.c | 4 ++-- .../drm/amd/display/dc/link/link_detection.c | 4 ++++ .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 10 +++++++++- 10 files changed, 76 insertions(+), 24 deletions(-)
--
2.34.1