drm/amd/display: Disable display writeback on Linux for NV10
Subsystems (3)
PATCH 393/459 drm/amd/display: Disable display writeback on Linux for NV10
From: hersen wu <[email protected]>
[WHY] system crash when initialize dwb current linux driver does not support dwb.
disable this feature for now.
[HOW] set num_dwb = 0 to disable dwb for now
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +1 -1
@@ -623,7 +623,7 @@ static const struct resource_caps res_cap_nv10 = { .num_audio = 7, .num_stream_encoder = 6, .num_pll = 6, - .num_dwb = 1, + .num_dwb = 0, .num_ddc = 6, .num_vmid = 16,#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT
Signature · 6 lines
2.20.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): 20190617194915.18618-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org
PATCH 394/459 drm/amd/display: Acquire DSC HW resource only if required by stream
From: Nikola Cornij <[email protected]>
[why]
There are ASICs that have fewer DSC engines than pipes, which makes DSC a resource that should be used only if required.
[how]
Acquire DSC HW resource if required by stream and release when not required anymore.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 19 +-- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 139 ++++++++++-------- .../drm/amd/display/dc/dcn20/dcn20_resource.h | 2 + .../gpu/drm/amd/display/dc/inc/core_types.h | 10 ++ 4 files changed, 97 insertions(+), 73 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +7 -12
@@ -1736,19 +1736,14 @@ static void commit_planes_do_stream_update(struct dc *dc,#if defined(CONFIG_DRM_AMD_DC_DSC_SUPPORT )if (stream_update->dsc_config && dc->hwss.pipe_control_lock_global) { -if (stream_update->dsc_config->num_slices_h && - stream_update->dsc_config->num_slices_v) { -/* dsc enable */ - dc->hwss.pipe_control_lock_global (dc, pipe_ctx, true); -dp_set_dsc_enable (pipe_ctx, true); - dc->hwss.pipe_control_lock_global (dc, pipe_ctx, false); - }else { -/* dsc disable */ - dc->hwss.pipe_control_lock_global (dc, pipe_ctx, true); -dp_set_dsc_enable (pipe_ctx, false); - dc->hwss.pipe_control_lock_global (dc, pipe_ctx, false); - } +bool enable_dsc = (stream_update->dsc_config->num_slices_h && stream_update->dsc_config->num_slices_v); + + dc->hwss.pipe_control_lock_global (dc, pipe_ctx, true); +dp_set_dsc_enable (pipe_ctx, enable_dsc); + dc->hwss.pipe_control_lock_global (dc, pipe_ctx, false); +if (!stream->is_dsc_enabled) + dc->res_pool->funcs->remove_dsc_from_stream_resource (dc, context, stream); }#endif /* Full fe update*/
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +78 -61
223 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.h +2 -0
@@ -121,6 +121,8 @@ enum dc_status dcn20_build_mapped_resource(const struct dc *dc, struct dc_stateenum dc_status dcn20_add_stream_to_ctx (struct dc *dc,struct dc_state *new_ctx,struct dc_stream_state *dc_stream);enum dc_status dcn20_remove_stream_from_ctx (struct dc *dc,struct dc_state *new_ctx,struct dc_stream_state *dc_stream);enum dc_status dcn20_get_default_swizzle_mode (struct dc_plane_state *plane_state); +enum dc_status dcn20_add_dsc_to_stream_resource (struct dc *dc,struct dc_state *dc_ctx,struct dc_stream_state *dc_stream); +enum dc_status dcn20_remove_dsc_from_stream_resource (struct dc *dc,struct dc_state *new_ctx,struct dc_stream_state *dc_stream); void dcn20_patch_bounding_box( struct dc *dc,
drivers/gpu/drm/amd/display/dc/inc/core_types.h +10 -0
@@ -142,6 +142,16 @@ struct resource_funcs {display_e2e_pipe_params_st *pipes, int pipe_cnt);#endif + +#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT +enum dc_status (*add_dsc_to_stream_resource)(struct dc *dc, +struct dc_state *dc_ctx, +struct dc_stream_state *dc_stream); + +enum dc_status (*remove_dsc_from_stream_resource)(struct dc *dc, +struct dc_state *new_ctx, +struct dc_stream_state *dc_stream); +#endif };struct audio_support {
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 395/459 drm/amd/display: Implement DSC MST fair share algorithm
In reply to a message not in the archiveFrom: Wenjing Liu <[email protected]>
[why]
The current policy will always enable DSC to 12 bpp regardless of if the current bandwidth is enough for MST displays. This logic is not optimal because user will get lower quality output if DSC compression is enabled.
This change to is to implement a DSC MST bandwidth fair share algorithm so we will dynamically decide if DSC is needed and what quality (target bpp) is needed to fairly destribute the MST bandwidth in one MST topology. This will allow user to see the most optimal image quality with the given bandwidth.
[how]
We will start with lowest bandwidth possible and run a Max-Min fairness algorithm to fairly distribute the available bandwidth. If there is still remaining bandwidth, we will try to fit the timing without DSC compression.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_dsc.h | 2 ++ drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 26 +++++++++++++------ 3 files changed, 21 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -1
@@ -2817,7 +2817,7 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx, int option)disable_link (pipe_ctx->stream->link, pipe_ctx->stream->signal);#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT -if (pipe_ctx->stream->timing.flags.DSC && +if (pipe_ctx->stream->is_dsc_enabled &&dc_is_dp_signal (pipe_ctx->stream->signal)) {dp_set_dsc_enable (pipe_ctx, false); }
drivers/gpu/drm/amd/display/dc/dc_dsc.h +2 -0
@@ -38,6 +38,8 @@ bool dc_dsc_parse_dsc_dpcd(const uint8_t *dpcd_dsc_data,bool dc_dsc_compute_bandwidth_range (const struct dc *dc, +const uint32_t min_kbps, +const uint32_t max_kbps,const struct dsc_dec_dpcd_caps *dsc_sink_caps,const struct dc_crtc_timing *timing,struct dc_dsc_bw_range *range);
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +18 -8
@@ -284,7 +284,8 @@ const struct dc_dsc_policy dsc_policy = { };static void get_dsc_bandwidth_range ( -const struct dc_dsc_policy *policy, +const uint32_t min_bpp, +const uint32_t max_bpp,const struct dsc_enc_caps *dsc_caps,const struct dc_crtc_timing *timing,struct dc_dsc_bw_range *range)
@@ -293,8 +294,8 @@ static void get_dsc_bandwidth_range( range->stream_kbps =dc_bandwidth_in_kbps_from_timing (timing);/* max dsc target bpp */ - range->max_kbps =dsc_round_up (policy->max_target_bpp * timing->pix_clk_100hz); - range->max_target_bpp_x16 = policy->max_target_bpp *16 ; + range->max_kbps =dsc_round_up (max_bpp * timing->pix_clk_100hz); + range->max_target_bpp_x16 = max_bpp *16 ;if (range->max_kbps > range->stream_kbps) {/* max dsc target bpp is capped to native bandwidth */ range->max_kbps = range->stream_kbps;
@@ -302,8 +303,8 @@ static void get_dsc_bandwidth_range( }/* min dsc target bpp */ - range->min_kbps =dsc_round_up (policy->min_target_bpp * timing->pix_clk_100hz); - range->min_target_bpp_x16 = policy->min_target_bpp *16 ; + range->min_kbps =dsc_round_up (min_bpp * timing->pix_clk_100hz); + range->min_target_bpp_x16 = min_bpp *16 ;if (range->min_kbps > range->max_kbps) {/* min dsc target bpp is capped to max dsc bandwidth*/ range->min_kbps = range->max_kbps;
@@ -330,7 +331,8 @@ static bool decide_dsc_target_bpp_x16(memset (&range,0 ,sizeof (range)); -get_dsc_bandwidth_range (policy, dsc_common_caps, timing, &range); +get_dsc_bandwidth_range (policy->min_target_bpp, policy->max_target_bpp, + dsc_common_caps, timing, &range);if (target_bandwidth_kbps >= range.stream_kbps) {/* enough bandwidth without dsc */ *target_bpp_x16 =0 ;
@@ -753,6 +755,8 @@ bool dc_dsc_parse_dsc_dpcd(const uint8_t *dpcd_dsc_data, struct dsc_dec_dpcd_capbool dc_dsc_compute_bandwidth_range (const struct dc *dc, +const uint32_t min_bpp, +const uint32_t max_bpp,const struct dsc_dec_dpcd_caps *dsc_sink_caps,const struct dc_crtc_timing *timing,struct dc_dsc_bw_range *range)
@@ -760,10 +764,16 @@ bool dc_dsc_compute_bandwidth_range(bool is_dsc_possible = false;struct dsc_enc_caps dsc_enc_caps;struct dsc_enc_caps dsc_common_caps; +struct dc_dsc_config config; +get_dsc_enc_caps (dc, &dsc_enc_caps, timing->pix_clk_100hz); - is_dsc_possible =dc_intersect_dsc_caps (dsc_sink_caps, &dsc_enc_caps, timing->pixel_encoding, &dsc_common_caps); + is_dsc_possible =setup_dsc_config (dsc_sink_caps, + &dsc_enc_caps, +0 , + timing, &config);if (is_dsc_possible) -get_dsc_bandwidth_range (&dsc_policy, &dsc_common_caps, timing, range); +get_dsc_bandwidth_range (min_bpp, max_bpp, &dsc_common_caps, timing, range); +return is_dsc_possible; }
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 396/459 drm/amd/display: enable abm on dcn2
In reply to a message not in the archiveFrom: Josip Pavic <[email protected]>
[Why]
ABM is currently not enabled on DCN2.
[How]
Update the register name list for DCN2 and un-comment the code that creates the abm object.
--- drivers/gpu/drm/amd/display/dc/dce/dce_abm.h | 20 +++++++++++++++++++ .../drm/amd/display/dc/dcn20/dcn20_resource.c | 14 ++++++------- 2 files changed, 27 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_abm.h +20 -0
@@ -67,6 +67,22 @@SRI (DC_ABM1_HGLS_REG_READ_PROGRESS ,ABM , id), \ NBIO_SR(BIOS_SCRATCH_2) +#if defined(CONFIG_DRM_AMD_DC_DCN2_0 ) +#define ABM_DCN20_REG_LIST () \ + ABM_COMMON_REG_LIST_DCE_BASE(), \ + SR(DC_ABM1_HG_SAMPLE_RATE), \ + SR(DC_ABM1_LS_SAMPLE_RATE), \ + SR(BL1_PWM_BL_UPDATE_SAMPLE_RATE), \ + SR(DC_ABM1_HG_MISC_CTRL), \ + SR(DC_ABM1_IPCSC_COEFF_SEL), \ + SR(BL1_PWM_CURRENT_ABM_LEVEL), \ + SR(BL1_PWM_TARGET_ABM_LEVEL), \ + SR(BL1_PWM_USER_LEVEL), \ + SR(DC_ABM1_LS_MIN_MAX_PIXEL_VALUE_THRES), \ + SR(DC_ABM1_HGLS_REG_READ_PROGRESS), \ + NBIO_SR(BIOS_SCRATCH_2) +#endif +#define ABM_SF (reg_name, field_name, post_fix)\ .field_name = reg_name ## __ ## field_name ## post_fix
@@ -147,6 +163,10 @@ABM_SF (ABM0_DC_ABM1_HGLS_REG_READ_PROGRESS , \ ABM1_BL_REG_READ_MISSED_FRAME_CLEAR, mask_sh) +#if defined(CONFIG_DRM_AMD_DC_DCN2_0 ) +#define ABM_MASK_SH_LIST_DCN20 (mask_sh) ABM_MASK_SH_LIST_DCE110(mask_sh) +#endif +#define ABM_REG_FIELD_LIST (type) \ type ABM1_HG_NUM_OF_BINS_SEL; \ type ABM1_HG_VMAX_SEL; \
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +7 -7
@@ -271,19 +271,19 @@ static const struct dce_dmcu_shift dmcu_shift = {static const struct dce_dmcu_mask dmcu_mask = {DMCU_MASK_SH_LIST_DCN10 (_MASK) }; -/* +static const struct dce_abm_registers abm_regs = { -ABM_DCN10_REG_LIST(0) +ABM_DCN20_REG_LIST () };static const struct dce_abm_shift abm_shift = { -ABM_MASK_SH_LIST_DCN10(__SHIFT) +ABM_MASK_SH_LIST_DCN20 (__SHIFT) };static const struct dce_abm_mask abm_mask = { -ABM_MASK_SH_LIST_DCN10(_MASK) +ABM_MASK_SH_LIST_DCN20 (_MASK) }; -*/ +#define audio_regs (id)\ [id] = {\ AUD_COMMON_REG_LIST(id)\
@@ -2811,7 +2811,7 @@ static bool construct( goto create_fail; } -/*pool->base.abm = dce_abm_create(ctx, + pool->base.abm =dce_abm_create (ctx, &abm_regs, &abm_shift, &abm_mask);
@@ -2819,7 +2819,7 @@ static bool construct(dm_error ("DC: failed to create abm!\n" );BREAK_TO_DEBUGGER (); goto create_fail; -}*/ + } pool->base.pp_smu =dcn20_pp_smu_create (ctx);
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 397/459 drm/amd/display: Consider DSC target bpp precision when calculating DSC target bpp
In reply to a message not in the archiveFrom: Nikola Cornij <[email protected]>
[why]
DSC target bpp precision is a decoder DPCD and an AMD encoder capability. It must be taken into account when calculating target bitrate.
[how]
Add a DC DSC function that does this calculation.
--- drivers/gpu/drm/amd/display/dc/dc_dsc.h | 10 +++++---- drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 25 ++++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dsc.h +6 -4
@@ -24,12 +24,13 @@* * Author: AMD */ +struct dc_dsc_bw_range { -uint32_t min_kbps; +uint32_t min_kbps;/* Bandwidth if min_target_bpp_x16 is used */ uint32_t min_target_bpp_x16; -uint32_t max_kbps; +uint32_t max_kbps;/* Bandwidth if max_target_bpp_x16 is used */ uint32_t max_target_bpp_x16; -uint32_t stream_kbps; +uint32_t stream_kbps;/* Uncompressed stream bandwidth */ };
@@ -43,10 +44,11 @@ bool dc_dsc_compute_bandwidth_range(const struct dsc_dec_dpcd_caps *dsc_sink_caps, const struct dc_crtc_timing *timing, struct dc_dsc_bw_range *range); +bool dc_dsc_compute_config (const struct dc *dc,const struct dsc_dec_dpcd_caps *dsc_sink_caps, -int target_bandwidth, +uint32_t target_bandwidth_kbps,const struct dc_crtc_timing *timing,struct dc_dsc_config *dsc_cfg);#endif
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c +17 -8
@@ -283,6 +283,10 @@ const struct dc_dsc_policy dsc_policy = { .min_target_bpp = 8, }; + +/* Get DSC bandwidth range based on [min_bpp, max_bpp] target bitrate range, and timing's pixel clock +* and uncompressed bandwidth. +*/ static void get_dsc_bandwidth_range( const uint32_t min_bpp, const uint32_t max_bpp,
@@ -312,6 +316,7 @@ static void get_dsc_bandwidth_range( } } +/* Decides if DSC should be used and calculates target bpp if it should, applying DSC policy. * * Returns:
@@ -494,10 +499,10 @@ static int fit_num_slices_up(union dsc_enc_slice_caps slice_caps, int num_slices* * dsc_enc_caps - DSC encoder capabilities * -* target_bandwidth - Target bandwidth to fit the stream into. -* If 0, do not calculate target bpp. +* target_bandwidth_kbps - Target bandwidth to fit the stream into. +* If 0, do not calculate target bpp. * -* timing - The stream timing to fit into 'target_bandwidth' or apply +* timing - The stream timing to fit into 'target_bandwidth_kbps' or apply * maximum compression to, if 'target_badwidth == 0' * * dsc_cfg - DSC configuration to use if it was possible to come up with
@@ -510,7 +515,7 @@ static int fit_num_slices_up(union dsc_enc_slice_caps slice_caps, int num_slicesstatic bool setup_dsc_config (const struct dsc_dec_dpcd_caps *dsc_sink_caps,const struct dsc_enc_caps *dsc_enc_caps, -int target_bandwidth, +int target_bandwidth_kbps,const struct dc_crtc_timing *timing,struct dc_dsc_config *dsc_cfg) {
@@ -536,8 +541,8 @@ static bool setup_dsc_config(if (!is_dsc_possible) goto done; -if (target_bandwidth >0 ) { - is_dsc_possible =decide_dsc_target_bpp_x16 (&dsc_policy, &dsc_common_caps, target_bandwidth, timing, &target_bpp); +if (target_bandwidth_kbps >0 ) { + is_dsc_possible =decide_dsc_target_bpp_x16 (&dsc_policy, &dsc_common_caps, target_bandwidth_kbps, timing, &target_bpp); dsc_cfg->bits_per_pixel = target_bpp; }if (!is_dsc_possible)
@@ -753,6 +758,10 @@ bool dc_dsc_parse_dsc_dpcd(const uint8_t *dpcd_dsc_data, struct dsc_dec_dpcd_cap } +/* If DSC is possbile, get DSC bandwidth range based on [min_bpp, max_bpp] target bitrate range and +* timing's pixel clock and uncompressed bandwidth. +* If DSC is not possible, leave '*range' untouched. +*/ bool dc_dsc_compute_bandwidth_range( const struct dc *dc, const uint32_t min_bpp,
@@ -780,7 +789,7 @@ bool dc_dsc_compute_bandwidth_range(bool dc_dsc_compute_config (const struct dc *dc,const struct dsc_dec_dpcd_caps *dsc_sink_caps, -int target_bandwidth, +uint32_t target_bandwidth_kbps,const struct dc_crtc_timing *timing,struct dc_dsc_config *dsc_cfg) {
@@ -790,7 +799,7 @@ bool dc_dsc_compute_config(get_dsc_enc_caps (dc, &dsc_enc_caps, timing->pix_clk_100hz); is_dsc_possible =setup_dsc_config (dsc_sink_caps, &dsc_enc_caps, - target_bandwidth, + target_bandwidth_kbps, timing, dsc_cfg);return is_dsc_possible; }
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 398/459 drm/amd/display: Add power down display on boot flag
In reply to a message not in the archiveFrom: Thomas Lim <[email protected]>
[Why]
Due to the generic introduction of seamless boot, the display is no longer blanked upon boot. However, this causes corruption on some systems that does not lock the memory in the non-secure boot case, resulting in brief corruption on boot due to garbage being written into the frame buffer.
[How]
Add a flag, read during DC init, to determine whether display should be blanked on boot. Default to true.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -557,6 +557,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) init_data.flags.fbc_support = true; init_data.flags.power_down_display_on_boot = true; +#ifdef CONFIG_DRM_AMD_DC_DCN2_0 init_data.soc_bounding_box = adev->dm.soc_bounding_box;#endif
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 399/459 drm/amd/display: Remove duplicate define of TO_DCN20_HUBBUB
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
--- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.h | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.h +0 -3
@@ -29,9 +29,6 @@#include "dcn10/dcn10_hubbub.h" #include "dcn20_vmid.h" -#define TO_DCN20_HUBBUB (hubbub)\ - container_of(hubbub, struct dcn20_hubbub, base) -#define TO_DCN20_HUBBUB (hubbub)\ container_of(hubbub, struct dcn20_hubbub, base)
Signature · 6 lines
2.20.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx