DC Patches Feb 15th, 2021
Subsystems (3)
cover DC Patches Feb 15th, 2021
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* DC 3.2.123
* Firmware release 0.0.52
* Bug fixes on MPC OGAM sequence, display experience, etc.
* Improvements on timing, transmitter control, etc.
---
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.52
Aric Cyr (1):
drm/amd/display: 3.2.123
Chris Park (1):
drm/amd/display: AVMUTE simplification
Eric Bernstein (1):
drm/amd/display: Implement transmitter control v1.7
Lewis Huang (1):
drm/amd/display: remove global optimize seamless boot stream count
Martin Leung (1):
drm/amd/display: changing sr exit latency
Nicholas Kazlauskas (2):
drm/amd/display: Add dc_dmub_srv helpers for in/out DMCUB commands drm/amd/display: Fix MPC OGAM power on/off sequence
Po-Ting Chen (1):
drm/amd/display: Change ABM sample rate
Stylon Wang (1):
drm/amd/display: Add Freesync HDMI support to DM
Sung Lee (2):
drm/amd/display: Populate dcn2.1 bounding box before state duplication drm/amd/display: Copy over soc values before bounding box creation
Wesley Chalmers (2):
drm/amd/display: Old path for enabling DPG drm/amd/display: Unblank hubp based on plane enable
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 175 ++++++++++++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 + .../gpu/drm/amd/display/dc/basics/dc_common.c | 20 +- .../gpu/drm/amd/display/dc/basics/dc_common.h | 4 +- .../drm/amd/display/dc/bios/command_table2.c | 72 ++++++- drivers/gpu/drm/amd/display/dc/core/dc.c | 43 ++--- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 22 +++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 2 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 11 -- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 10 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 9 +- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c | 24 +-- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 8 +- 17 files changed, 300 insertions(+), 117 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/14 drm/amd/display: Change ABM sample rate
From: Po-Ting Chen <[email protected]>
[Why]
To get the pixel statistics on every frame, change ABM sample rate from 2 to 1.
[How]
Change LS, HS and BL sample rate to 1.
--- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c +5 -5
@@ -72,11 +72,11 @@ static void dmub_abm_init(struct abm *abm, uint32_t backlight) {struct dce_abm *dce_abm =TO_DMUB_ABM (abm); -REG_WRITE (DC_ABM1_HG_SAMPLE_RATE ,0x103 ); -REG_WRITE (DC_ABM1_HG_SAMPLE_RATE ,0x101 ); -REG_WRITE (DC_ABM1_LS_SAMPLE_RATE ,0x103 ); -REG_WRITE (DC_ABM1_LS_SAMPLE_RATE ,0x101 ); -REG_WRITE (BL1_PWM_BL_UPDATE_SAMPLE_RATE ,0x101 ); +REG_WRITE (DC_ABM1_HG_SAMPLE_RATE ,0x3 ); +REG_WRITE (DC_ABM1_HG_SAMPLE_RATE ,0x1 ); +REG_WRITE (DC_ABM1_LS_SAMPLE_RATE ,0x3 ); +REG_WRITE (DC_ABM1_LS_SAMPLE_RATE ,0x1 ); +REG_WRITE (BL1_PWM_BL_UPDATE_SAMPLE_RATE ,0x1 ); REG_SET_3(DC_ABM1_HG_MISC_CTRL, 0, ABM1_HG_NUM_OF_BINS_SEL, 0,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/14 drm/amd/display: remove global optimize seamless boot stream count
In reply to Qingqing ZhuoFrom: Lewis Huang <[email protected]>
[Why]
In following sequence driver will add counter twice on same edp stream.
1. Boot into OS.
2. Set timing with edp only.
3. Set timing with edp and external monitor.
4. Set visibility on for edp.
Step 2 and 3 will add seamless boot counter twice and subtract it once in step 4.
[How]
Remove global counter and calculate it is used.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 32 ++++++++++++++---------- drivers/gpu/drm/amd/display/dc/dc.h | 1 - 2 files changed, 19 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +19 -13
@@ -163,6 +163,18 @@ static uint32_t get_num_of_internal_disp(struct dc_link **links, uint32_t num_lireturn count; } +static int get_seamless_boot_stream_count (struct dc_state *ctx) +{ +uint8_t i; +uint8_t seamless_boot_stream_count =0 ; + +for (i =0 ; i < ctx->stream_count; i++) +if (ctx->streams[i]->apply_seamless_boot_optimization) + seamless_boot_stream_count++; + +return seamless_boot_stream_count; +} +static bool create_links (struct dc *dc,uint32_t num_virtual_links)
@@ -970,7 +982,6 @@ struct dc *dc_create(const struct dc_init_data *init_params) full_pipe_count, dc->res_pool->stream_enc_count); - dc->optimize_seamless_boot_streams =0 ; dc->caps.max_links = dc->link_count; dc->caps.max_audios = dc->res_pool->audio_count; dc->caps.linear_pitch_alignment =64 ;
@@ -1377,11 +1388,7 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c dc->hwss.enable_accelerated_mode (dc, context); } -for (i =0 ; i < context->stream_count; i++) -if (context->streams[i]->apply_seamless_boot_optimization) - dc->optimize_seamless_boot_streams++; - -if (context->stream_count > dc->optimize_seamless_boot_streams || +if (context->stream_count >get_seamless_boot_stream_count (context) || context->stream_count ==0 ) dc->hwss.prepare_bandwidth (dc, context);
@@ -1464,7 +1471,7 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *cdc_enable_stereo (dc, context, dc_streams, context->stream_count); -if (context->stream_count > dc->optimize_seamless_boot_streams || +if (context->stream_count >get_seamless_boot_stream_count (context) || context->stream_count ==0 ) {/* Must wait for no flips to be pending before doing optimize bw */ wait_for_no_pipes_pending (dc, context);
@@ -1578,7 +1585,7 @@ void dc_post_update_surfaces_to_stream(struct dc *dc)int i;struct dc_state *context = dc->current_state; -if ((!dc->optimized_required) || dc->optimize_seamless_boot_streams >0 ) +if ((!dc->optimized_required) ||get_seamless_boot_stream_count (context) >0 )return ;post_surface_trace (dc);
@@ -2400,7 +2407,7 @@ static void commit_planes_do_stream_update(struct dc *dc, dc->hwss.optimize_bandwidth (dc, dc->current_state); }else { -if (dc->optimize_seamless_boot_streams ==0 ) +if (get_seamless_boot_stream_count (context) ==0 ) dc->hwss.prepare_bandwidth (dc, dc->current_state);core_link_enable_stream (dc->current_state, pipe_ctx);
@@ -2439,7 +2446,7 @@ static void commit_planes_for_stream(struct dc *dc,int i, j;struct pipe_ctx *top_pipe_to_program =NULL ; -if (dc->optimize_seamless_boot_streams >0 && surface_count >0 ) { +if (get_seamless_boot_stream_count (context) >0 && surface_count >0 ) {/* Optimize seamless boot flag keeps clocks and watermarks high until * first flip. After first flip, optimization is required to lower * bandwidth. Important to note that it is expected UEFI will
@@ -2448,9 +2455,8 @@ static void commit_planes_for_stream(struct dc *dc,*/ if (stream->apply_seamless_boot_optimization) { stream->apply_seamless_boot_optimization = false; - dc->optimize_seamless_boot_streams--; -if (dc->optimize_seamless_boot_streams ==0 ) +if (get_seamless_boot_stream_count (context) ==0 ) dc->optimized_required = true; } }
@@ -2460,7 +2466,7 @@ static void commit_planes_for_stream(struct dc *dc,dc_allow_idle_optimizations (dc, false);#endif -if (dc->optimize_seamless_boot_streams ==0 ) +if (get_seamless_boot_stream_count (context) ==0 ) dc->hwss.prepare_bandwidth (dc, context);context_clock_trace (dc, context);
drivers/gpu/drm/amd/display/dc/dc.h +0 -1
@@ -628,7 +628,6 @@ struct dc {#endif /* Require to maintain clocks and bandwidth for UEFI enabled HW */ -int optimize_seamless_boot_streams;/* FBC compressor */ struct compressor *fbc_compressor;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/14 drm/amd/display: Old path for enabling DPG
In reply to Qingqing ZhuoFrom: Wesley Chalmers <[email protected]>
[Why]
We are not implementing the planned new HW
sequence for HUBP disable.
[How]
Revert most related changes to minimize regressions.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 11 ----------- drivers/gpu/drm/amd/display/dc/dc_stream.h | 11 ----------- 2 files changed, 22 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -11
@@ -2284,8 +2284,6 @@ static void copy_stream_update_to_stream(struct dc *dc,if (update->dither_option) stream->dither_option = *update->dither_option; -if (update->pending_test_pattern) - stream->test_pattern = *update->pending_test_pattern;/* update current stream with writeback info */ if (update->wb_update) {int i;
@@ -2382,15 +2380,6 @@ static void commit_planes_do_stream_update(struct dc *dc, } } -if (stream_update->pending_test_pattern) { -dc_link_dp_set_test_pattern (stream->link, - stream->test_pattern.type, - stream->test_pattern.color_space, - stream->test_pattern.p_link_settings, - stream->test_pattern.p_custom_pattern, - stream->test_pattern.cust_pattern_size); - } -/* Full fe update*/ if (update_type ==UPDATE_TYPE_FAST )continue ;
drivers/gpu/drm/amd/display/dc/dc_stream.h +0 -11
@@ -130,14 +130,6 @@ union stream_update_flags {uint32_t raw; }; -struct test_pattern { -enum dp_test_pattern type; -enum dp_test_pattern_color_space color_space; -struct link_training_settings const *p_link_settings; -unsigned char const *p_custom_pattern; -unsigned int cust_pattern_size; -}; -struct dc_stream_state {// sink is deprecated, new code should not reference // this pointer
@@ -235,8 +227,6 @@ struct dc_stream_state {uint32_t stream_id;bool is_dsc_enabled; - -struct test_pattern test_pattern;union stream_update_flags update_flags; };
@@ -271,7 +261,6 @@ struct dc_stream_update {struct dc_dsc_config *dsc_config;struct dc_transfer_func *func_shaper;struct dc_3dlut *lut3d_func; -struct test_pattern *pending_test_pattern; }; bool dc_is_stream_unchanged(
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/14 drm/amd/display: Unblank hubp based on plane enable
In reply to Qingqing ZhuoFrom: Wesley Chalmers <[email protected]>
[Why]
We are not implementing the planned new HW sequence to disable HUBP.
[How]
Revert most related changes to minimize possibility of regression.
--- .../gpu/drm/amd/display/dc/basics/dc_common.c | 20 ++++++------------- .../gpu/drm/amd/display/dc/basics/dc_common.h | 4 ++-- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +- 3 files changed, 9 insertions(+), 17 deletions(-)
drivers/gpu/drm/amd/display/dc/basics/dc_common.c +6 -14
@@ -49,24 +49,20 @@ bool is_rgb_cspace(enum dc_color_space output_color_space) } } -bool is_child_pipe_tree_visible (struct pipe_ctx *pipe_ctx) +bool is_lower_pipe_tree_visible (struct pipe_ctx *pipe_ctx) {if (pipe_ctx->plane_state && pipe_ctx->plane_state->visible)return true; -if (pipe_ctx->bottom_pipe &&is_child_pipe_tree_visible (pipe_ctx->bottom_pipe)) -return true; -if (pipe_ctx->next_odm_pipe &&is_child_pipe_tree_visible (pipe_ctx->next_odm_pipe)) +if (pipe_ctx->bottom_pipe &&is_lower_pipe_tree_visible (pipe_ctx->bottom_pipe))return true;return false; } -bool is_parent_pipe_tree_visible (struct pipe_ctx *pipe_ctx) +bool is_upper_pipe_tree_visible (struct pipe_ctx *pipe_ctx) {if (pipe_ctx->plane_state && pipe_ctx->plane_state->visible)return true; -if (pipe_ctx->top_pipe &&is_parent_pipe_tree_visible (pipe_ctx->top_pipe)) -return true; -if (pipe_ctx->prev_odm_pipe &&is_parent_pipe_tree_visible (pipe_ctx->prev_odm_pipe)) +if (pipe_ctx->top_pipe &&is_upper_pipe_tree_visible (pipe_ctx->top_pipe))return true;return false; }
@@ -75,13 +71,9 @@ bool is_pipe_tree_visible(struct pipe_ctx *pipe_ctx) {if (pipe_ctx->plane_state && pipe_ctx->plane_state->visible)return true; -if (pipe_ctx->top_pipe &&is_parent_pipe_tree_visible (pipe_ctx->top_pipe)) -return true; -if (pipe_ctx->bottom_pipe &&is_child_pipe_tree_visible (pipe_ctx->bottom_pipe)) -return true; -if (pipe_ctx->prev_odm_pipe &&is_parent_pipe_tree_visible (pipe_ctx->prev_odm_pipe)) +if (pipe_ctx->top_pipe &&is_upper_pipe_tree_visible (pipe_ctx->top_pipe))return true; -if (pipe_ctx->next_odm_pipe &&is_child_pipe_tree_visible (pipe_ctx->next_odm_pipe)) +if (pipe_ctx->bottom_pipe &&is_lower_pipe_tree_visible (pipe_ctx->bottom_pipe))return true;return false; }
drivers/gpu/drm/amd/display/dc/basics/dc_common.h +2 -2
@@ -30,9 +30,9 @@bool is_rgb_cspace (enum dc_color_space output_color_space); -bool is_child_pipe_tree_visible (struct pipe_ctx *pipe_ctx); +bool is_lower_pipe_tree_visible (struct pipe_ctx *pipe_ctx); -bool is_parent_pipe_tree_visible (struct pipe_ctx *pipe_ctx); +bool is_upper_pipe_tree_visible (struct pipe_ctx *pipe_ctx);bool is_pipe_tree_visible (struct pipe_ctx *pipe_ctx);
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +1 -1
@@ -1575,7 +1575,7 @@ static void dcn20_update_dchubp_dpp( -if (is_pipe_tree_visible (pipe_ctx)) +if (pipe_ctx->update_flags.bits.enable) dc->hwss.set_hubp_blank (dc, pipe_ctx, false); }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/14 drm/amd/display: changing sr exit latency
In reply to Qingqing ZhuoFrom: Martin Leung <[email protected]>
[Why]
Hardware team remeasured, need to update timings to increase latency slightly and avoid intermittent underflows.
[How]
sr exit latency update.
--- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +1 -1
@@ -181,7 +181,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_0_soc = { }, .min_dcfclk = 500.0, /* TODO: set this to actual min DCFCLK */ .num_states = 1, - .sr_exit_time_us = 12, + .sr_exit_time_us = 15.5, .sr_enter_plus_exit_time_us = 20, .urgent_latency_us = 4.0, .urgent_latency_pixel_data_only_us = 4.0,
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/14 drm/amd/display: Add dc_dmub_srv helpers for in/out DMCUB commands
In reply to Qingqing ZhuoFrom: Nicholas Kazlauskas <[email protected]>
[Why]
We added these in DMCUB for runtime feature detection but we didn't have helpers to call these with DC error handling/logging.
[How]
Add helpers.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 22 ++++++++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 2 ++ 2 files changed, 24 insertions(+)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +22 -0
@@ -27,6 +27,9 @@#include "dc_dmub_srv.h" #include "../dmub/dmub_srv.h" +#define CTX dc_dmub_srv->ctx +#define DC_LOGGER CTX->logger +static void dc_dmub_srv_construct (struct dc_dmub_srv *dc_srv,struct dc *dc,struct dmub_srv *dmub) {
@@ -106,6 +109,25 @@ void dc_dmub_srv_wait_idle(struct dc_dmub_srv *dc_dmub_srv)DC_ERROR ("Error waiting for DMUB idle: status=%d\n" , status); } +bool dc_dmub_srv_cmd_with_reply_data (struct dc_dmub_srv *dc_dmub_srv,union dmub_rb_cmd *cmd) +{ +struct dmub_srv *dmub; +enum dmub_status status; + +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return false; + + dmub = dc_dmub_srv->dmub; + + status =dmub_srv_cmd_with_reply_data (dmub, cmd); +if (status !=DMUB_STATUS_OK ) { +DC_LOG_DEBUG ("No reply for DMUB command: status=%d\n" , status); +return false; + } + +return true; +} +void dc_dmub_srv_wait_phy_init (struct dc_dmub_srv *dc_dmub_srv) {struct dmub_srv *dmub = dc_dmub_srv->dmub;
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +2 -0
@@ -56,6 +56,8 @@ void dc_dmub_srv_wait_idle(struct dc_dmub_srv *dc_dmub_srv);void dc_dmub_srv_wait_phy_init (struct dc_dmub_srv *dc_dmub_srv); +bool dc_dmub_srv_cmd_with_reply_data (struct dc_dmub_srv *dc_dmub_srv,union dmub_rb_cmd *cmd); +bool dc_dmub_srv_notify_stream_mask (struct dc_dmub_srv *dc_dmub_srv,unsigned int stream_mask);#endif /* _DMUB_DC_SRV_H_ */
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/14 drm/amd/display: Fix MPC OGAM power on/off sequence
In reply to Qingqing ZhuoFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Color corruption can occur on bootup into a login manager that applies a non-linear gamma LUT because the LUT may not actually be powered on before writing.
It's cleared on the next full pipe reprogramming as we switch to LUTB from LUTA and the pipe accessing the LUT has taken it out of light sleep mode.
[How]
The MPCC_OGAM_MEM_PWR_FORCE register does not force the current power mode when set to 0. It only forces when set light sleep, deep sleep or shutdown.
The register to actually force power on and ignore sleep modes is MPCC_OGAM_MEM_PWR_DIS - a value of 0 will enable power requests and a value of 1 will disable them.
When PWR_FORCE!=0 is combined with PWR_DIS=0 then MPCC OGAM memory is forced into the state specified by the force bits.
If PWR_FORCE is 0 then it respects the mode specified by MPCC_OGAM_MEM_LOW_PWR_MODE if the RAM LUT is not in use.
We set that bit to shutdown on low power, but otherwise it inherits from bootup defaults.
So for the fix:
1. Update the sequence to "force" power on when needed
We can use MPCC_OGAM_MEM_PWR_DIS for this to turn on the memory even when the block is in bypass and pending to be enabled for the next frame.
We need this for both low power enabled or disabled.
If we don't set this then we can run into issues when we first program the LUT from bootup.
2. Don't apply FORCE_SEL
Once we enable power requests with DIS=0 we run into the issue of the RAM being forced into light sleep and being unusable for display output. Leave this 0 like we used to for DCN20.
3. Rely on MPCC OGAM init to determine light sleep/deep sleep
MPC low power debug mode isn't enabled on any ASIC currently but we'll respect the setting determined during init if it is.
Lightly tested as working with IGT tests and desktop color adjustment.
4. Change the MPC resource default for DCN30
It was interleaving the dcn20 and dcn30 versions before depending on the sequence.
5. REG_WAIT for it to be on whenever we're powering up the memory
Otherwise we can write register values too early and we'll get corruption.
--- .../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c +13 -11
@@ -143,16 +143,18 @@ static void mpc3_power_on_ogam_lut( {struct dcn30_mpc *mpc30 =TO_DCN30_MPC (mpc); -if (mpc->ctx->dc->debug.enable_mem_low_power.bits.mpc) { -// Force power on -REG_UPDATE (MPCC_MEM_PWR_CTRL [mpcc_id],MPCC_OGAM_MEM_PWR_DIS , power_on == true ?1 :0 ); -// Wait for confirmation when powering on -if (power_on) -REG_WAIT (MPCC_MEM_PWR_CTRL [mpcc_id],MPCC_OGAM_MEM_PWR_STATE ,0 ,10 ,10 ); - }else { -REG_SET (MPCC_MEM_PWR_CTRL [mpcc_id],0 , -MPCC_OGAM_MEM_PWR_FORCE , power_on == true ?0 :1 ); - } +/* +* Powering on: force memory active so the LUT can be updated. +* Powering off: allow entering memory low power mode +* +* Memory low power mode is controlled during MPC OGAM LUT init. +*/ +REG_UPDATE (MPCC_MEM_PWR_CTRL [mpcc_id], +MPCC_OGAM_MEM_PWR_DIS , power_on !=0 ); + +/* Wait for memory to be powered on - we won't be able to write to it otherwise. */ +if (power_on) +REG_WAIT (MPCC_MEM_PWR_CTRL [mpcc_id],MPCC_OGAM_MEM_PWR_STATE ,0 ,10 ,10 ); } static void mpc3_configure_ogam_lut(
@@ -1427,7 +1429,7 @@ const struct mpc_funcs dcn30_mpc_funcs = { .acquire_rmu = mpcc3_acquire_rmu, .program_3dlut = mpc3_program_3dlut, .release_rmu = mpcc3_release_rmu, - .power_on_mpc_mem_pwr = mpc20_power_on_ogam_lut, + .power_on_mpc_mem_pwr = mpc3_power_on_ogam_lut, .get_mpc_out_mux = mpc1_get_mpc_out_mux, };
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/14 drm/amd/display: Populate dcn2.1 bounding box before state duplication
In reply to Qingqing ZhuoFrom: Sung Lee <[email protected]>
[Why]
If system is overclocked, only 1 bounding box state will be sent by SMU. This results in an empty state being copied for DML calculations causing black screens and corruption.
[How]
Fully populate bounding box before duplicating last state.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +2 -2
@@ -1616,11 +1616,11 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn2_1_soc.clock_limits[i] = clock_limits[i];if (clk_table->num_entries) { dcn2_1_soc.num_states = clk_table->num_entries +1 ; +/* fill in min DF PState */ + dcn2_1_soc.clock_limits[1 ] =construct_low_pstate_lvl (clk_table, closest_clk_lvl);/* duplicate last level */ dcn2_1_soc.clock_limits[dcn2_1_soc.num_states] = dcn2_1_soc.clock_limits[dcn2_1_soc.num_states -1 ]; dcn2_1_soc.clock_limits[dcn2_1_soc.num_states].state = dcn2_1_soc.num_states; -/* fill in min DF PState */ - dcn2_1_soc.clock_limits[1 ] =construct_low_pstate_lvl (clk_table, closest_clk_lvl); }dml_init_instance (&dc->dml, &dcn2_1_soc, &dcn2_1_ip,DML_PROJECT_DCN21 );
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/14 drm/amd/display: Add Freesync HDMI support to DM
In reply to Qingqing ZhuoFrom: Stylon Wang <[email protected]>
[Why]
Add necessary support for Freesync HDMI in Linux DM
[How]
- Support Freesync HDMI by calling DC interace
- Report Freesync capability to vrr_range debugfs from DRM
- Depends on coming DMCU/DMUB firmware to enable feature
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 175 ++++++++++++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 + 2 files changed, 144 insertions(+), 39 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +136 -39
@@ -34,6 +34,7 @@#include "dc/inc/hw/dmcu.h" #include "dc/inc/hw/abm.h" #include "dc/dc_dmub_srv.h" +#include "dc/dc_edid_parser.h" #include "amdgpu_dm_trace.h" #include "vid.h"
@@ -6995,6 +6996,12 @@ static void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *connector,*/ drm_mode_sort (&connector->probed_modes);amdgpu_dm_get_native_mode (connector); + +/* Freesync capabilities are reset by calling +* drm_add_edid_modes() and need to be +* restored here. +*/ +amdgpu_dm_update_freesync_caps (connector, edid); }else { amdgpu_dm_connector->num_modes =0 ; }
@@ -9718,11 +9725,84 @@ static bool is_dp_capable_without_timing_msa(struct dc *dc,return capable; } + +static bool parse_edid_cea (struct amdgpu_dm_connector *aconnector, +uint8_t *edid_ext,int len, +struct amdgpu_hdmi_vsdb_info *vsdb_info) +{ +int i; +struct amdgpu_device *adev =drm_to_adev (aconnector->base.dev); +struct dc *dc = adev->dm.dc; + +/* send extension block to DMCU for parsing */ +for (i =0 ; i < len; i +=8 ) { +bool res; +int offset; + +/* send 8 bytes a time */ +if (!dc_edid_parser_send_cea (dc, i, len, &edid_ext[i],8 )) +return false; + +if (i+8 == len) { +/* EDID block sent completed, expect result */ +int version, min_rate, max_rate; + + res =dc_edid_parser_recv_amd_vsdb (dc, &version, &min_rate, &max_rate); +if (res) { +/* amd vsdb found */ + vsdb_info->freesync_supported =1 ; + vsdb_info->amd_vsdb_version = version; + vsdb_info->min_refresh_rate_hz = min_rate; + vsdb_info->max_refresh_rate_hz = max_rate; +return true; + } +/* not amd vsdb */ +return false; + } + +/* check for ack*/ + res =dc_edid_parser_recv_cea_ack (dc, &offset); +if (!res) +return false; + } + +return false; +} + +static bool parse_hdmi_amd_vsdb (struct amdgpu_dm_connector *aconnector, +struct edid *edid,struct amdgpu_hdmi_vsdb_info *vsdb_info) +{ +uint8_t *edid_ext =NULL ; +int i; +bool valid_vsdb_found = false; + +/*----- drm_find_cea_extension() -----*/ +/* No EDID or EDID extensions */ +if (edid ==NULL || edid->extensions ==0 ) +return false; + +/* Find CEA extension */ +for (i =0 ; i < edid->extensions; i++) { + edid_ext = (uint8_t *)edid +EDID_LENGTH * (i +1 ); +if (edid_ext[0 ] ==CEA_EXT ) +break ; + } + +if (i == edid->extensions) +return false; + +/*----- cea_db_offsets() -----*/ +if (edid_ext[0 ] !=CEA_EXT ) +return false; + + valid_vsdb_found =parse_edid_cea (aconnector, edid_ext,EDID_LENGTH , vsdb_info); +return valid_vsdb_found; +} +void amdgpu_dm_update_freesync_caps (struct drm_connector *connector,struct edid *edid) {int i; -bool edid_check_required;struct detailed_timing *timing;struct detailed_non_pixel *data;struct detailed_data_monitor_range *range;
@@ -9733,6 +9813,8 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,struct drm_device *dev = connector->dev;struct amdgpu_device *adev =drm_to_adev (dev);bool freesync_capable = false; +struct amdgpu_hdmi_vsdb_info vsdb_info = {0 }; +bool hdmi_valid_vsdb_found = false;if (!connector->state) {DRM_ERROR ("%s - Connector has no state" , __func__);
@@ -9751,60 +9833,75 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, dm_con_state =to_dm_connector_state (connector->state); - edid_check_required = false;if (!amdgpu_dm_connector->dc_sink) {DRM_ERROR ("dc_sink NULL, could not add free_sync module.\n" ); goto update; }if (!adev->dm.freesync_module) goto update; -/* -* if edid non zero restrict freesync only for dp and edp -*/ -if (edid) { -if (amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_DISPLAY_PORT - || amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_EDP ) { + + +if (amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_DISPLAY_PORT + || amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_EDP ) { +bool edid_check_required = false; + +if (edid) { edid_check_required =is_dp_capable_without_timing_msa ( adev->dm.dc, amdgpu_dm_connector); } - } -if (edid_check_required == true && (edid->version >1 || - (edid->version ==1 && edid->revision >1 ))) { -for (i =0 ; i <4 ; i++) { - timing = &edid->detailed_timings[i]; - data = &timing->data.other_data; - range = &data->data.range; -/* -* Check if monitor has continuous frequency mode -*/ -if (data->type !=EDID_DETAIL_MONITOR_RANGE ) -continue ; -/* -* Check for flag range limits only. If flag == 1 then -* no additional timing information provided. -* Default GTF, GTF Secondary curve and CVT are not -* supported -*/ -if (range->flags !=1 ) -continue ; +if (edid_check_required == true && (edid->version >1 || + (edid->version ==1 && edid->revision >1 ))) { +for (i =0 ; i <4 ; i++) { + + timing = &edid->detailed_timings[i]; + data = &timing->data.other_data; + range = &data->data.range; +/* +* Check if monitor has continuous frequency mode +*/ +if (data->type !=EDID_DETAIL_MONITOR_RANGE ) +continue ; +/* +* Check for flag range limits only. If flag == 1 then +* no additional timing information provided. +* Default GTF, GTF Secondary curve and CVT are not +* supported +*/ +if (range->flags !=1 ) +continue ; - amdgpu_dm_connector->min_vfreq = range->min_vfreq; - amdgpu_dm_connector->max_vfreq = range->max_vfreq; - amdgpu_dm_connector->pixel_clock_mhz = - range->pixel_clock_mhz *10 ; + amdgpu_dm_connector->min_vfreq = range->min_vfreq; + amdgpu_dm_connector->max_vfreq = range->max_vfreq; + amdgpu_dm_connector->pixel_clock_mhz = + range->pixel_clock_mhz *10 ; - connector->display_info.monitor_range.min_vfreq = range->min_vfreq; - connector->display_info.monitor_range.max_vfreq = range->max_vfreq; + connector->display_info.monitor_range.min_vfreq = range->min_vfreq; + connector->display_info.monitor_range.max_vfreq = range->max_vfreq; -break ; - } +break ; + } -if (amdgpu_dm_connector->max_vfreq - - amdgpu_dm_connector->min_vfreq >10 ) { +if (amdgpu_dm_connector->max_vfreq - + amdgpu_dm_connector->min_vfreq >10 ) { - freesync_capable = true; + freesync_capable = true; + } + } + }else if (edid && amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_HDMI_TYPE_A ) { + hdmi_valid_vsdb_found =parse_hdmi_amd_vsdb (amdgpu_dm_connector, edid, &vsdb_info); +if (hdmi_valid_vsdb_found && vsdb_info.freesync_supported) { + timing = &edid->detailed_timings[i]; + data = &timing->data.other_data; + + amdgpu_dm_connector->min_vfreq = vsdb_info.min_refresh_rate_hz; + amdgpu_dm_connector->max_vfreq = vsdb_info.max_refresh_rate_hz; +if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq >10 ) + freesync_capable = true; + + connector->display_info.monitor_range.min_vfreq = vsdb_info.min_refresh_rate_hz; + connector->display_info.monitor_range.max_vfreq = vsdb_info.max_refresh_rate_hz; } }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +8 -0
@@ -475,6 +475,14 @@ struct dm_connector_state {uint64_t pbn; }; +struct amdgpu_hdmi_vsdb_info { +unsigned int amd_vsdb_version;/* VSDB version, should be used to determine which VSIF to send */ +bool freesync_supported;/* FreeSync Supported */ +unsigned int min_refresh_rate_hz;/* FreeSync Minimum Refresh Rate in Hz */ +unsigned int max_refresh_rate_hz;/* FreeSync Maximum Refresh Rate in Hz */ +}; + +#define to_dm_connector_state (x)\ container_of((x), struct dm_connector_state, base)
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH 09/14] drm/amd/display: Add Freesync HDMI support to DM
Quoted 230 lines · Qingqing Zhuo
From: Stylon Wang <[email protected]>
[Why]
Add necessary support for Freesync HDMI in Linux DM[How]
- Support Freesync HDMI by calling DC interace
- Report Freesync capability tovrr_rangedebugfs from DRM
- Depends on coming DMCU/DMUB firmware to enable featureSigned-off-by Stylon Wang <[email protected]>Reviewed-by Nicholas Kazlauskas <[email protected]>Acked-by Qingqing Zhuo <[email protected]>--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 175 ++++++++++++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 + 2 files changed, 144 insertions(+), 39 deletions(-)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +119
-38@@ -34,6 +34,7 @@#include "dc/inc/hw/dmcu.h" #include "dc/inc/hw/abm.h" #include "dc/dc_dmub_srv.h" +#include "dc/dc_edid_parser.h" #include "amdgpu_dm_trace.h" #include "vid.h" @@ -6995,6 +6996,12 @@ static void amdgpu_dm_connector_ddc_get_modes(struct drm_connector *connector,*/ drm_mode_sort (&connector->probed_modes);amdgpu_dm_get_native_mode (connector); + +/* Freesync capabilities are reset by calling +* drm_add_edid_modes() and need to be +* restored here. +*/ +amdgpu_dm_update_freesync_caps (connector, edid); }else { amdgpu_dm_connector->num_modes =0 ; }@@ -9718,11 +9725,84 @@ static bool is_dp_capable_without_timing_msa(struct dc *dc,return capable; } + +static bool parse_edid_cea (struct amdgpu_dm_connector *aconnector, +uint8_t *edid_ext,int len, +struct amdgpu_hdmi_vsdb_info *vsdb_info) +{ +int i; +struct amdgpu_device *adev =drm_to_adev (aconnector->base.dev); +struct dc *dc = adev->dm.dc; + +/* send extension block to DMCU for parsing */ +for (i =0 ; i < len; i +=8 ) { +bool res; +int offset; + +/* send 8 bytes a time */ +if (!dc_edid_parser_send_cea (dc, i, len, &edid_ext[i],8 )) +return false; + +if (i+8 == len) { +/* EDID block sent completed, expect result */ +int version, min_rate, max_rate; + + res =dc_edid_parser_recv_amd_vsdb (dc, &version, &min_rate, &max_rate); +if (res) { +/* amd vsdb found */ + vsdb_info->freesync_supported =1 ; + vsdb_info->amd_vsdb_version = version; + vsdb_info->min_refresh_rate_hz = min_rate; + vsdb_info->max_refresh_rate_hz = max_rate; +return true; + } +/* not amd vsdb */ +return false; + } + +/* check for ack*/ + res =dc_edid_parser_recv_cea_ack (dc, &offset); +if (!res) +return false; + } + +return false; +} + +static bool parse_hdmi_amd_vsdb (struct amdgpu_dm_connector *aconnector, +struct edid *edid,struct amdgpu_hdmi_vsdb_info *vsdb_info) +{ +uint8_t *edid_ext =NULL ; +int i; +bool valid_vsdb_found = false; + +/*----- drm_find_cea_extension() -----*/ +/* No EDID or EDID extensions */ +if (edid ==NULL || edid->extensions ==0 ) +return false; + +/* Find CEA extension */ +for (i =0 ; i < edid->extensions; i++) { + edid_ext = (uint8_t *)edid +EDID_LENGTH * (i +1 ); +if (edid_ext[0 ] ==CEA_EXT ) +break ; + } + +if (i == edid->extensions) +return false; + +/*----- cea_db_offsets() -----*/ +if (edid_ext[0 ] !=CEA_EXT ) +return false; + + valid_vsdb_found =parse_edid_cea (aconnector, edid_ext,EDID_LENGTH , vsdb_info); +return valid_vsdb_found; +} +void amdgpu_dm_update_freesync_caps (struct drm_connector *connector,struct edid *edid) {int i; -bool edid_check_required;struct detailed_timing *timing;struct detailed_non_pixel *data;struct detailed_data_monitor_range *range;@@ -9733,6 +9813,8 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,struct drm_device *dev = connector->dev;struct amdgpu_device *adev =drm_to_adev (dev);bool freesync_capable = false; +struct amdgpu_hdmi_vsdb_info vsdb_info = {0 }; +bool hdmi_valid_vsdb_found = false;if (!connector->state) {DRM_ERROR ("%s - Connector has no state" , __func__);@@ -9751,60 +9833,75 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, dm_con_state =to_dm_connector_state (connector->state); - edid_check_required = false;if (!amdgpu_dm_connector->dc_sink) {DRM_ERROR ("dc_sink NULL, could not add free_sync module.\n" ); goto update; }if (!adev->dm.freesync_module) goto update; -/* -* if edid non zero restrict freesync only for dp and edp -*/ -if (edid) { -if (amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_DISPLAY_PORT - || amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_EDP ) { + + +if (amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_DISPLAY_PORT + || amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_EDP ) { +bool edid_check_required = false; + +if (edid) { edid_check_required =is_dp_capable_without_timing_msa ( adev->dm.dc, amdgpu_dm_connector); } - } -if (edid_check_required == true && (edid->version >1 || - (edid->version ==1 && edid->revision >1 ))) { -for (i =0 ; i <4 ; i++) { - timing = &edid->detailed_timings[i]; - data = &timing->data.other_data; - range = &data->data.range; -/* -* Check if monitor has continuous frequency mode -*/ -if (data->type !=EDID_DETAIL_MONITOR_RANGE ) -continue ; -/* -* Check for flag range limits only. If flag == 1 then -* no additional timing information provided. -* Default GTF, GTF Secondary curve and CVT are not -* supported -*/ -if (range->flags !=1 ) -continue ; +if (edid_check_required == true && (edid->version >1 || + (edid->version ==1 && edid->revision >1 ))) { +for (i =0 ; i <4 ; i++) { + + timing = &edid->detailed_timings[i]; + data = &timing->data.other_data; + range = &data->data.range; +/* +* Check if monitor has continuous frequency mode +*/ +if (data->type !=EDID_DETAIL_MONITOR_RANGE ) +continue ; +/* +* Check for flag range limits only. If flag == 1 then +* no additional timing information provided. +* Default GTF, GTF Secondary curve and CVT are not +* supported +*/ +if (range->flags !=1 ) +continue ; - amdgpu_dm_connector->min_vfreq = range->min_vfreq; - amdgpu_dm_connector->max_vfreq = range->max_vfreq; - amdgpu_dm_connector->pixel_clock_mhz = - range->pixel_clock_mhz *10 ; + amdgpu_dm_connector->min_vfreq = range->min_vfreq; + amdgpu_dm_connector->max_vfreq = range->max_vfreq; + amdgpu_dm_connector->pixel_clock_mhz = + range->pixel_clock_mhz *10 ; - connector->display_info.monitor_range.min_vfreq = range->min_vfreq; - connector->display_info.monitor_range.max_vfreq = range->max_vfreq; + connector->display_info.monitor_range.min_vfreq = range->min_vfreq; + connector->display_info.monitor_range.max_vfreq = range->max_vfreq; -break ; - } +break ; + } -if (amdgpu_dm_connector->max_vfreq - - amdgpu_dm_connector->min_vfreq >10 ) { + if (amdgpu_dm_connector->max_vfreq -
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · line 9895
Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8
-1+ amdgpu_dm_connector->min_vfreq > 10) { - freesync_capable = true; + freesync_capable = true; + } + } + }else if (edid && amdgpu_dm_connector->dc_sink->sink_signal ==SIGNAL_TYPE_HDMI_TYPE_A ) { + hdmi_valid_vsdb_found =parse_hdmi_amd_vsdb (amdgpu_dm_connector, edid, &vsdb_info); +if (hdmi_valid_vsdb_found && vsdb_info.freesync_supported) { + timing = &edid->detailed_timings[i];
This variable is uninitialized, as reported by clang:
$ make -skj"$(nproc)" CC=clang allyesconfig drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.o
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9811:38: warning: variable 'i' is uninitialized when used here [-Wuninitialized]
timing = &edid->detailed_timings[i];
^
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:9721:7: note: initialize the variable 'i' to silence this warning
int i;
^
= 0
1 warning generated.Cheers,
Nathan
Quoted 38 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9
-0+ data = &timing->data.other_data; + + amdgpu_dm_connector->min_vfreq = vsdb_info.min_refresh_rate_hz; + amdgpu_dm_connector->max_vfreq = vsdb_info.max_refresh_rate_hz; +if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq >10 ) + freesync_capable = true; + + connector->display_info.monitor_range.min_vfreq = vsdb_info.min_refresh_rate_hz; + connector->display_info.monitor_range.max_vfreq = vsdb_info.max_refresh_rate_hz; } }drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +8
-0@@ -475,6 +475,14 @@ struct dm_connector_state {uint64_t pbn; }; +struct amdgpu_hdmi_vsdb_info { +unsigned int amd_vsdb_version;/* VSDB version, should be used to determine which VSIF to send */ +bool freesync_supported;/* FreeSync Supported */ +unsigned int min_refresh_rate_hz;/* FreeSync Minimum Refresh Rate in Hz */ +unsigned int max_refresh_rate_hz;/* FreeSync Maximum Refresh Rate in Hz */ +}; + +#define to_dm_connector_state (x)\ container_of((x), struct dm_connector_state, base)Signature · 6 lines
2.17.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/14 drm/amd/display: Copy over soc values before bounding box creation
In reply to Qingqing ZhuoFrom: Sung Lee <[email protected]>
[Why]
With certain fclock overclocks, state 1 may be chosen as the closest clock level. This may result in this state being empty if not populated beforehand, resulting in black screens and screen corruption.
[How]
Copy over all soc states to clock_limits before bounding box creation to avoid any cases with empty states.
--- drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +5 -0
@@ -1583,6 +1583,11 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn2_1_soc.num_chans = bw_params->num_channels;ASSERT (clk_table->num_entries); +/* Copy dcn2_1_soc.clock_limits to clock_limits to avoid copying over null states later */ +for (i =0 ; i < dcn2_1_soc.num_states +1 ; i++) { + clock_limits[i] = dcn2_1_soc.clock_limits[i]; + } +for (i =0 ; i < clk_table->num_entries; i++) {/* loop backwards*/ for (closest_clk_lvl =0 , j = dcn2_1_soc.num_states -1 ; j >=0 ; j--) {
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/14 drm/amd/display: AVMUTE simplification
In reply to Qingqing ZhuoFrom: Chris Park <[email protected]>
[Why]
Simplify AVMUTE logic in coding
[How]
Avoid multiple calls on TMDS AVMUTE
as updated logic now demands it.
--- drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +1 -1
@@ -649,7 +649,7 @@ void dcn30_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)if (pipe_ctx ==NULL )return ; -if (dc_is_hdmi_tmds_signal (pipe_ctx->stream->signal) && pipe_ctx->stream_res.stream_enc !=NULL ) +if (dc_is_hdmi_signal (pipe_ctx->stream->signal) && pipe_ctx->stream_res.stream_enc !=NULL ) pipe_ctx->stream_res.stream_enc->funcs->set_avmute ( pipe_ctx->stream_res.stream_enc, enable);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/14 drm/amd/display: Implement transmitter control v1.7
In reply to Qingqing ZhuoFrom: Eric Bernstein <[email protected]>
[Why]
Moving definition of transmitter control from atomfirmware to internal header.
[How]
Update the command table code to call 1.7 and make it the default fallback path.
--- .../drm/amd/display/dc/bios/command_table2.c | 72 ++++++++++++++++++- 1 file changed, 71 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +71 -1
@@ -218,6 +218,10 @@ static enum bp_result transmitter_control_v1_6(struct bios_parser *bp, struct bp_transmitter_control *cntl); +static enum bp_result transmitter_control_v1_7 ( +struct bios_parser *bp, +struct bp_transmitter_control *cntl); +static enum bp_result transmitter_control_fallback (struct bios_parser *bp,struct bp_transmitter_control *cntl);
@@ -233,6 +237,9 @@ static void init_transmitter_control(struct bios_parser *bp)case 6 : bp->cmd_tbl.transmitter_control = transmitter_control_v1_6;break ; +case 7 : + bp->cmd_tbl.transmitter_control = transmitter_control_v1_7; +break ;default :dm_output_to_console ("Don't have transmitter_control for v%d\n" , crev); bp->cmd_tbl.transmitter_control = transmitter_control_fallback;
@@ -304,13 +311,76 @@ static enum bp_result transmitter_control_v1_6(return result; } +static void transmitter_control_dmcub_v1_7 ( +struct dc_dmub_srv *dmcub, +struct dmub_dig_transmitter_control_data_v1_7 *dig) +{ +union dmub_rb_cmd cmd; + +memset (&cmd,0 ,sizeof (cmd)); + + cmd.dig1_transmitter_control.header.type =DMUB_CMD__VBIOS ; + cmd.dig1_transmitter_control.header.sub_type = +DMUB_CMD__VBIOS_DIG1_TRANSMITTER_CONTROL ; + cmd.dig1_transmitter_control.header.payload_bytes = +sizeof (cmd.dig1_transmitter_control) - +sizeof (cmd.dig1_transmitter_control.header); + cmd.dig1_transmitter_control.transmitter_control.dig_v1_7 = *dig; + +dc_dmub_srv_cmd_queue (dmcub, &cmd); +dc_dmub_srv_cmd_execute (dmcub); +dc_dmub_srv_wait_idle (dmcub); +} + +static enum bp_result transmitter_control_v1_7 ( +struct bios_parser *bp, +struct bp_transmitter_control *cntl) +{ +enum bp_result result =BP_RESULT_FAILURE ; +const struct command_table_helper *cmd = bp->cmd_helper; +struct dmub_dig_transmitter_control_data_v1_7 dig_v1_7 = {0 }; + + dig_v1_7.phyid = cmd->phy_id_to_atom (cntl->transmitter); + dig_v1_7.action = (uint8_t )cntl->action; + +if (cntl->action ==TRANSMITTER_CONTROL_SET_VOLTAGE_AND_PREEMPASIS ) + dig_v1_7.mode_laneset.dplaneset = (uint8_t )cntl->lane_settings; +else + dig_v1_7.mode_laneset.digmode = + cmd->signal_type_to_atom_dig_mode (cntl->signal); + + dig_v1_7.lanenum = (uint8_t )cntl->lanes_number; + dig_v1_7.hpdsel = cmd->hpd_sel_to_atom (cntl->hpd_sel); + dig_v1_7.digfe_sel = cmd->dig_encoder_sel_to_atom (cntl->engine_id); + dig_v1_7.connobj_id = (uint8_t )cntl->connector_obj_id.id; + dig_v1_7.symclk_units.symclk_10khz = cntl->pixel_clock/10 ; + +if (cntl->action ==TRANSMITTER_CONTROL_ENABLE || + cntl->action ==TRANSMITTER_CONTROL_ACTIAVATE || + cntl->action ==TRANSMITTER_CONTROL_DEACTIVATE ) { +DC_LOG_BIOS ("%s:dig_v1_7.symclk_units.symclk_10khz = %d\n" , + __func__, dig_v1_7.symclk_units.symclk_10khz); + } + +if (bp->base.ctx->dc->ctx->dmub_srv && + bp->base.ctx->dc->debug.dmub_command_table) { +transmitter_control_dmcub_v1_7 (bp->base.ctx->dmub_srv, &dig_v1_7); +return BP_RESULT_OK ; + } + +/*color_depth not used any more, driver has deep color factor in the Phyclk*/ +if (EXEC_BIOS_CMD_TABLE (dig1transmittercontrol, dig_v1_7)) + result =BP_RESULT_OK ; +return result; +} +static enum bp_result transmitter_control_fallback (struct bios_parser *bp,struct bp_transmitter_control *cntl) {if (bp->base.ctx->dc->ctx->dmub_srv && bp->base.ctx->dc->debug.dmub_command_table) { -return transmitter_control_v1_6 (bp, cntl); +return transmitter_control_v1_7 (bp, cntl); }return BP_RESULT_FAILURE ;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/14 drm/amd/display: [FW Promotion] Release 0.0.52
In reply to Qingqing ZhuoFrom: Anthony Koo <[email protected]>
[How]
Add new aux cmd fields for acquire and release
--- drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +5 -3
@@ -47,10 +47,10 @@/* Firmware versioning. */ #ifdef DMUB_EXPOSE_VERSION -#define DMUB_FW_VERSION_GIT_HASH 0x6444c02e7 +#define DMUB_FW_VERSION_GIT_HASH 0xb959929e3#define DMUB_FW_VERSION_MAJOR 0#define DMUB_FW_VERSION_MINOR 0 -#define DMUB_FW_VERSION_REVISION 51 +#define DMUB_FW_VERSION_REVISION 52#define DMUB_FW_VERSION_TEST 0#define DMUB_FW_VERSION_VBIOS 0#define DMUB_FW_VERSION_HOTFIX 0
@@ -564,9 +564,11 @@ struct aux_transaction_parameters { };struct dmub_cmd_dp_aux_control_data { -uint32_t handle;uint8_t instance; +uint8_t manual_acq_rel_enable;uint8_t sw_crc_enabled; +uint8_t pad; +uint16_t handle;uint16_t timeout;enum aux_channel_type type;struct aux_transaction_parameters dpaux;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/14 drm/amd/display: 3.2.123
In reply to Qingqing ZhuoFrom: Aric Cyr <[email protected]>
[How]
DC version update to 3.2.123.
--- 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
@@ -42,7 +42,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.122" +#define DC_VER "3.2.123"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[AMD Public Use]
Hi all,
This week this patchset was tested on a HP Envy 360, with Ryzen 5 4500U, on the following display types (via usb-c to dp/dvi/hdmi/vga):
4k 60z, 1440p 144hz, 1680*1050 60hz, internal eDP 1080p 60hz
Tested on a Sapphire Pulse RX5700XT on the following display types (via DP):
4k60 60hz, 1440p 144hz, 1680x1050 60hz.
Also using a MST hub at 2x 4k 30hz on both systems.
Thank you,
Dan Wheeler
Technologist | AMD
SW Display
O +(1) 905-882-2600 ext. 74665
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Qingqing Zhuo
Sent: February 11, 2021 4:45 PM
To: [email protected]
Cc: Brol, Eryk <[email protected]>; Li, Sun peng (Leo) <[email protected]>; Wentland, Harry <[email protected]>; Zhuo, Qingqing <[email protected]>; Siqueira, Rodrigo <[email protected]>; Li, Roman <[email protected]>; Jacob, Anson <[email protected]>; Pillai, Aurabindo <[email protected]>; Lakha, Bhawanpreet <[email protected]>; R, Bindu <[email protected]>
Subject: [PATCH 00/14] DC Patches Feb 15th, 2021
This DC patchset brings improvements in multiple areas. In summary, we highlight:
* DC 3.2.123
* Firmware release 0.0.52
* Bug fixes on MPC OGAM sequence, display experience, etc.
* Improvements on timing, transmitter control, etc.
---
Anthony Koo (1):
drm/amd/display: [FW Promotion] Release 0.0.52
Aric Cyr (1):
drm/amd/display: 3.2.123
Chris Park (1):
drm/amd/display: AVMUTE simplification
Eric Bernstein (1):
drm/amd/display: Implement transmitter control v1.7
Lewis Huang (1):
drm/amd/display: remove global optimize seamless boot stream count
Martin Leung (1):
drm/amd/display: changing sr exit latency
Nicholas Kazlauskas (2):
drm/amd/display: Add dc_dmub_srv helpers for in/out DMCUB commands drm/amd/display: Fix MPC OGAM power on/off sequence
Po-Ting Chen (1):
drm/amd/display: Change ABM sample rate
Stylon Wang (1):
drm/amd/display: Add Freesync HDMI support to DM
Sung Lee (2):
drm/amd/display: Populate dcn2.1 bounding box before state duplication drm/amd/display: Copy over soc values before bounding box creation
Wesley Chalmers (2):
drm/amd/display: Old path for enabling DPG drm/amd/display: Unblank hubp based on plane enable
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 175 ++++++++++++++---- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 + .../gpu/drm/amd/display/dc/basics/dc_common.c | 20 +- .../gpu/drm/amd/display/dc/basics/dc_common.h | 4 +- .../drm/amd/display/dc/bios/command_table2.c | 72 ++++++- drivers/gpu/drm/amd/display/dc/core/dc.c | 43 ++--- drivers/gpu/drm/amd/display/dc/dc.h | 3 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 22 +++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 2 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 11 -- drivers/gpu/drm/amd/display/dc/dce/dmub_abm.c | 10 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 2 +- .../drm/amd/display/dc/dcn21/dcn21_resource.c | 9 +- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 2 +- .../gpu/drm/amd/display/dc/dcn30/dcn30_mpc.c | 24 +-- .../drm/amd/display/dc/dcn30/dcn30_resource.c | 2 +- .../gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 8 +- 17 files changed, 300 insertions(+), 117 deletions(-)
Signature · 10 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cdaniel.wheeler%40amd.com%7C2d569284640143d031eb08d8ced6488d%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637486767057348581%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xFhBPL8DfWjR0kVn8BmpF740O8FUkxZrMgoQdOMMJEM%3D&reserved=0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx