DC Patches Feb 13, 2019
cover DC Patches Feb 13, 2019
From: Leo Li <[email protected]>
Summary of change:
* Fix S3 resume black screen on DCE8
* Fix dissapearing cursor on Raven sytems
* Cleanup DM plane commit logic
* Fixes for multiplane commits
* Fixes for seamless boot
Anthony Koo (5):
drm/amd/display: remove screen flashes on seamless boot drm/amd/display: Increase precision for backlight curve drm/amd/display: make seamless boot work generically drm/amd/display: Fix exception from AUX acquire failure drm/amd/display: Fix issue with link_active state not correct for MST
Bhawanpreet Lakha (2):
drm/amd/display: fix optimize_bandwidth func pointer for dce80 drm/amd/display: set clocks to 0 on suspend on dce80
Charlene Liu (2):
drm/amd/display: Add disable triple buffering DC debug option drm/amd/display: dcn add check surface in_use
David Francis (2):
drm/amd/display: Clean up wait on vblank event drm/amd/display: Make stream commits call into DC only once
Dmytro Laktyushkin (1):
drm/amd/display: Allow for plane-less resource reservation
Eric Bernstein (1):
drm/amd/display: Move enum gamut_remap_select to hw_shared.h
Eryk Brol (1):
drm/amd/display: Add DCN_VM aperture registers
Fatemeh Darbehani (1):
drm/amd/display: Remove redundant 'else' statement in
dcn1_update_clocks
Gary Kattan (1):
drm/amd/display: Ungate stream before programming registers
Josip Pavic (3):
drm/amd/display: send pipe set command to dmcu when stream unblanks drm/amd/display: send pipe set command to dmcu when backlight is set drm/amd/display: optionally optimize edp link rate based on timing
Jun Lei (3):
drm/amd/display: PPLIB Hookup
drm/amd/display: Add p_state_change_support flag to dc_clocks drm/amd/display: Add ability to override bounding box in DC construct
Leo (Hanghong) Ma (1):
drm/amd/display: Fix MST reboot/poweroff sequence
Mark McGarrity (1):
drm/amd/display: 3.2.19
Nicholas Kazlauskas (7):
drm/amd/display: Fix wrong z-order when updating overlay planes drm/amd/display: Don't expose support for DRM_FORMAT_RGB888 drm/amd/display: Fix update type mismatches in atomic check drm/amd/display: Do cursor updates after stream updates drm/amd/display: Clear stream->mode_changed after commit drm/amd/display: Fix negative cursor pos programming drm/amd/display: Reset planes that were disabled in init_pipes
Roman Li (1):
drm/amd/display: Raise dispclk value for dce11
Wesley Chalmers (1):
drm/amd/display: Set flip pending for pipe split
Yongqiang Sun (1):
drm/amd/display: Refactor for setup periodic interrupt.
mmcgarri (1):
drm/amd/display: 3.2.18
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 214 +++++++++-------- .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 20 +- drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 20 +- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 15 +- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 195 +++++++++++----- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 + drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 13 ++ drivers/gpu/drm/amd/display/dc/dc.h | 20 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 2 + drivers/gpu/drm/amd/display/dc/dc_stream.h | 24 +- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 45 ++-- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 4 +- drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c | 11 +- .../amd/display/dc/dce100/dce100_hw_sequencer.h | 4 + .../amd/display/dc/dce110/dce110_hw_sequencer.c | 62 +++-- .../drm/amd/display/dc/dce80/dce80_hw_sequencer.c | 2 +- .../gpu/drm/amd/display/dc/dce80/dce80_resource.c | 19 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_clk_mgr.c | 10 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 7 - .../gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 7 - .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 46 ++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 25 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 23 +- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 3 + .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 252 +++++++++++++++++++-- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 2 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 133 ++--------- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 13 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 6 +- drivers/gpu/drm/amd/display/dc/dm_pp_smu.h | 2 + drivers/gpu/drm/amd/display/dc/dm_services.h | 4 +- drivers/gpu/drm/amd/display/dc/dm_services_types.h | 2 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.c | 24 ++ .../gpu/drm/amd/display/dc/dml/display_mode_lib.h | 5 + drivers/gpu/drm/amd/display/dc/inc/core_types.h | 2 +- drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 3 + drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 6 + .../drm/amd/display/dc/inc/hw/timing_generator.h | 23 +- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 14 ++ drivers/gpu/drm/amd/display/include/dal_asic_id.h | 3 + .../drm/amd/display/modules/power/power_helpers.c | 23 +- 43 files changed, 855 insertions(+), 459 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1550088351-19449-1-git-send-email-sunpeng.li-5C7GfCeVMHo@public.gmane.org
PATCH 1/35 drm/amd/display: Fix MST reboot/poweroff sequence
From: "Leo (Hanghong) Ma" <[email protected]>
[Why]drm_dp_mst_topology_mgr_suspend() is added into the new reboot sequence, which disables the UP request at the beginning. Therefore sideband messages are blocked.
[How]
Finish MST sideband message transaction before UP request is suppressed.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -2
@@ -786,12 +786,13 @@ static int dm_suspend(void *handle)struct amdgpu_display_manager *dm = &adev->dm;int ret =0 ; +WARN_ON (adev->dm.cached_state); + adev->dm.cached_state =drm_atomic_helper_suspend (adev->ddev); +s3_handle_mst (adev->ddev, true);amdgpu_dm_irq_suspend (adev); -WARN_ON (adev->dm.cached_state); - adev->dm.cached_state =drm_atomic_helper_suspend (adev->ddev);dc_set_power_state (dm->dc,DC_ACPI_CM_POWER_STATE_D3 );
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/35 drm/amd/display: send pipe set command to dmcu when stream unblanks
In reply to a message not in the archiveFrom: Josip Pavic <[email protected]>
[Why]
When stream is blanked, pipe set command is sent to dmcu to notify it that the abm pipe is disabled. When stream is unblanked, no notification is made to dmcu that the abm pipe has been enabled, resulting in abm not being enabled in the firmware.
[How]
When stream is unblanked, send a pipe set command to dmcu.
--- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 32 ++++++++++++---------- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 ++- drivers/gpu/drm/amd/display/dc/inc/hw/abm.h | 1 + 3 files changed, 21 insertions(+), 16 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +17 -15
@@ -175,7 +175,6 @@ static void dmcu_set_backlight_level( uint32_t controller_id) {unsigned int backlight_8_bit =0 ; -uint32_t rampingBoundary =0xFFFF ;uint32_t s2;if (backlight_pwm_u16_16 &0x10000 )
@@ -185,17 +184,6 @@ static void dmcu_set_backlight_level(// Take MSB of fractional part since backlight is not max backlight_8_bit = (backlight_pwm_u16_16 >>8 ) &0xFF ; -/* set ramping boundary */ -REG_WRITE (MASTER_COMM_DATA_REG1 , rampingBoundary); - -/* setDMCUParam_Pipe */ -REG_UPDATE_2 (MASTER_COMM_CMD_REG , -MASTER_COMM_CMD_REG_BYTE0 ,MCP_ABM_PIPE_SET , -MASTER_COMM_CMD_REG_BYTE1 , controller_id); - -/* notifyDMCUMsg */ -REG_UPDATE (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,1 ); -/* waitDMCUReadyForCmd */ REG_WAIT (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,0 ,1 ,80000 );
@@ -305,21 +293,34 @@ static bool dce_abm_set_level(struct abm *abm, uint32_t level)return true; } -static bool dce_abm_immediate_disable (struct abm *abm) +static bool dce_abm_set_pipe (struct abm *abm,uint32_t controller_id) {struct dce_abm *abm_dce =TO_DCE_ABM (abm); +uint32_t rampingBoundary =0xFFFF ;REG_WAIT (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,0 ,1 ,80000 ); -/* setDMCUParam_ABMLevel */ +/* set ramping boundary */ +REG_WRITE (MASTER_COMM_DATA_REG1 , rampingBoundary); + +/* setDMCUParam_Pipe */ REG_UPDATE_2 (MASTER_COMM_CMD_REG ,MASTER_COMM_CMD_REG_BYTE0 ,MCP_ABM_PIPE_SET , -MASTER_COMM_CMD_REG_BYTE1 ,MCP_DISABLE_ABM_IMMEDIATELY ); +MASTER_COMM_CMD_REG_BYTE1 , controller_id);/* notifyDMCUMsg */ REG_UPDATE (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,1 ); +return true; +} + +static bool dce_abm_immediate_disable (struct abm *abm) +{ +struct dce_abm *abm_dce =TO_DCE_ABM (abm); + +dce_abm_set_pipe (abm,MCP_DISABLE_ABM_IMMEDIATELY ); + abm->stored_backlight_registers.BL_PWM_CNTL =REG_READ (BL_PWM_CNTL ); abm->stored_backlight_registers.BL_PWM_CNTL2 =
@@ -419,6 +420,7 @@ static const struct abm_funcs dce_funcs = { .abm_init = dce_abm_init, .set_abm_level = dce_abm_set_level, .init_backlight = dce_abm_init_backlight, + .set_pipe = dce_abm_set_pipe, .set_backlight_level_pwm = dce_abm_set_backlight_level_pwm, .get_current_backlight = dce_abm_get_current_backlight, .get_target_backlight = dce_abm_get_target_backlight,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +3 -1
@@ -2162,8 +2162,10 @@ static void dcn10_blank_pixel_data(if (!blank) {if (stream_res->tg->funcs->set_blank) stream_res->tg->funcs->set_blank (stream_res->tg, blank); -if (stream_res->abm) +if (stream_res->abm) { + stream_res->abm->funcs->set_pipe (stream_res->abm, stream_res->tg->inst +1 ); stream_res->abm->funcs->set_abm_level (stream_res->abm, stream->abm_level); + } }else if (blank) {if (stream_res->abm) stream_res->abm->funcs->set_abm_immediate_disable (stream_res->abm);
drivers/gpu/drm/amd/display/dc/inc/hw/abm.h +1 -0
@@ -46,6 +46,7 @@ struct abm_funcs {void (*abm_init)(struct abm *abm);bool (*set_abm_level)(struct abm *abm,unsigned int abm_level);bool (*set_abm_immediate_disable)(struct abm *abm); +bool (*set_pipe)(struct abm *abm,unsigned int controller_id);bool (*init_backlight)(struct abm *abm);/* backlight_pwm_u16_16 is unsigned 32 bit,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/35 drm/amd/display: remove screen flashes on seamless boot
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
We want boot to desktop to be seamless
[How]
During init pipes, avoid touching the pipes where GOP has already enabled the HW to the state we want.
--- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 10 +++++++- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 30 +++++++++++++++++++++- drivers/gpu/drm/amd/display/include/dal_asic_id.h | 3 +++ 3 files changed, 41 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +9 -1
@@ -1521,6 +1521,14 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)struct dc_link *edp_link =get_link_for_edp (dc);bool can_edp_fast_boot_optimize = false;bool apply_edp_fast_boot_optimization = false; +bool can_apply_seamless_boot = false; + +for (i =0 ; i < context->stream_count; i++) { +if (context->streams[i]->apply_seamless_boot_optimization) { + can_apply_seamless_boot = true; +break ; + } + }if (edp_link) {/* this seems to cause blank screens on DCE8 */
@@ -1549,7 +1557,7 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) } } -if (!apply_edp_fast_boot_optimization) { +if (!apply_edp_fast_boot_optimization && !can_apply_seamless_boot) {if (edp_link_to_turnoff) {/*turn off backlight before DP_blank and encoder powered down*/ dc->hwss.edp_backlight_control (edp_link_to_turnoff, false);
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +29 -1
@@ -959,9 +959,25 @@ static void dcn10_disable_plane(struct dc *dc, struct pipe_ctx *pipe_ctx)static void dcn10_init_pipes (struct dc *dc,struct dc_state *context) {int i; +bool can_apply_seamless_boot = false; + +for (i =0 ; i < context->stream_count; i++) { +if (context->streams[i]->apply_seamless_boot_optimization) { + can_apply_seamless_boot = true; +break ; + } + }for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct timing_generator *tg = dc->res_pool->timing_generators[i]; +struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; + +/* There is assumption that pipe_ctx is not mapping irregularly +* to non-preferred front end. If pipe_ctx->stream is not NULL, +* we will use the pipe, so don't disable +*/ +if (pipe_ctx->stream !=NULL ) +continue ;if (tg->funcs->is_tg_enabled (tg)) tg->funcs->lock (tg);
@@ -975,7 +991,9 @@ static void dcn10_init_pipes(struct dc *dc, struct dc_state *context) } } - dc->res_pool->mpc->funcs->mpc_init (dc->res_pool->mpc); +/* Cannot reset the MPC mux if seamless boot */ +if (!can_apply_seamless_boot) + dc->res_pool->mpc->funcs->mpc_init (dc->res_pool->mpc);for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct timing_generator *tg = dc->res_pool->timing_generators[i];
@@ -983,6 +1001,16 @@ static void dcn10_init_pipes(struct dc *dc, struct dc_state *context)struct dpp *dpp = dc->res_pool->dpps[i];struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; +// W/A for issue with dc_post_update_surfaces_to_stream + hubp->power_gated = true; + +/* There is assumption that pipe_ctx is not mapping irregularly +* to non-preferred front end. If pipe_ctx->stream is not NULL, +* we will use the pipe, so don't disable +*/ +if (pipe_ctx->stream !=NULL ) +continue ; + dpp->funcs->dpp_reset (dpp); pipe_ctx->stream_res.tg = tg;
drivers/gpu/drm/amd/display/include/dal_asic_id.h +3 -0
@@ -131,6 +131,7 @@#define INTERNAL_REV_RAVEN_A0 0x00/* First spin of Raven */ #define RAVEN_A0 0x01#define RAVEN_B0 0x21 +#define PICASSO_A0 0x41#if defined(CONFIG_DRM_AMD_DC_DCN1_01 )/* DCN1_01 */ #define RAVEN2_A0 0x81
@@ -165,4 +166,6 @@#define FAMILY_UNKNOWN 0xFF + +#endif /* __DAL_ASIC_ID_H__ */
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/35 drm/amd/display: Increase precision for backlight curve
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
We are currently losing precision when we convert from 16 bit --> 8 bit --> 16 bit.
[How]
We shouldn't down convert unnecessarily and lose precision. Keep values at 16 bit and use directly.
--- .../drm/amd/display/modules/power/power_helpers.c | 23 ++++------------------ 1 file changed, 4 insertions(+), 19 deletions(-)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +4 -19
@@ -165,18 +165,11 @@ struct iram_table_v_2_2 { };#pragma pack(pop) -static uint16_t backlight_8_to_16 (unsigned int backlight_8bit) -{ -return (uint16_t )(backlight_8bit *0x101 ); -} -static void fill_backlight_transform_table (struct dmcu_iram_parameters params,struct iram_table_v_2 *table) {unsigned int i;unsigned int num_entries =NUM_BL_CURVE_SEGS ; -unsigned int query_input_8bit; -unsigned int query_output_8bit;unsigned int lut_index; table->backlight_thresholds[0 ] =0 ;
@@ -194,16 +187,13 @@ static void fill_backlight_transform_table(struct dmcu_iram_parameters params,* format U4.10. */ for (i =1 ; i+1 < num_entries; i++) { - query_input_8bit =DIV_ROUNDUP ((i *256 ), num_entries); - lut_index = (params.backlight_lut_array_size -1 ) * i / (num_entries -1 );ASSERT (lut_index < params.backlight_lut_array_size); - query_output_8bit = params.backlight_lut_array[lut_index] >>8 ; table->backlight_thresholds[i] = -backlight_8_to_16 (query_input_8bit); +cpu_to_be16 (DIV_ROUNDUP ((i *65536 ), num_entries)); table->backlight_offsets[i] = -backlight_8_to_16 (query_output_8bit); +cpu_to_be16 (params.backlight_lut_array[lut_index]); } }
@@ -212,8 +202,6 @@ static void fill_backlight_transform_table_v_2_2(struct dmcu_iram_parameters par {unsigned int i;unsigned int num_entries =NUM_BL_CURVE_SEGS ; -unsigned int query_input_8bit; -unsigned int query_output_8bit;unsigned int lut_index; table->backlight_thresholds[0 ] =0 ;
@@ -231,16 +219,13 @@ static void fill_backlight_transform_table_v_2_2(struct dmcu_iram_parameters par* format U4.10. */ for (i =1 ; i+1 < num_entries; i++) { - query_input_8bit =DIV_ROUNDUP ((i *256 ), num_entries); - lut_index = (params.backlight_lut_array_size -1 ) * i / (num_entries -1 );ASSERT (lut_index < params.backlight_lut_array_size); - query_output_8bit = params.backlight_lut_array[lut_index] >>8 ; table->backlight_thresholds[i] = -backlight_8_to_16 (query_input_8bit); +cpu_to_be16 (DIV_ROUNDUP ((i *65536 ), num_entries)); table->backlight_offsets[i] = -backlight_8_to_16 (query_output_8bit); +cpu_to_be16 (params.backlight_lut_array[lut_index]); } }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/35 drm/amd/display: Ungate stream before programming registers
In reply to a message not in the archiveFrom: Gary Kattan <[email protected]>
[Why]
Certain tests fail after a fresh reboot. This is caused by writing to registers prior to ungating the stream we're trying to program.
[How]
Make sure the stream is ungated before writing to its registers. This also enables power-gating plane resources before init_hw initializes them.
Additionally, this does some refactoring to move gating/ungating from enable/disable_plane functions to where stream resources are enabled/disabled.
--- drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 6 ++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 8 ++++++-- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 4 ++++ 3 files changed, 16 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 -0
@@ -1300,6 +1300,10 @@ static enum dc_status apply_single_controller_ctx_to_hw(struct drr_params params = {0 };unsigned int event_triggers =0 ; +if (dc->hwss.disable_stream_gating) { + dc->hwss.disable_stream_gating (dc, pipe_ctx); + } +if (pipe_ctx->stream_res.audio !=NULL ) {struct audio_output audio_output;
@@ -2684,6 +2688,8 @@ static const struct hw_sequencer_funcs dce110_funcs = { .set_static_screen_control = set_static_screen_control, .reset_hw_ctx_wrap = dce110_reset_hw_ctx_wrap, .enable_stream_timing = dce110_enable_stream_timing, + .disable_stream_gating = NULL, + .enable_stream_gating = NULL, .setup_stereo = NULL, .set_avmute = dce110_set_avmute, .wait_for_mpcc_disconnect = dce110_wait_for_mpcc_disconnect,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 -2
@@ -1165,11 +1165,13 @@ static void reset_hw_ctx_wrap(struct clock_source *old_clk = pipe_ctx_old->clock_source;reset_back_end_for_pipe (dc, pipe_ctx_old, dc->current_state); +if (dc->hwss.enable_stream_gating) { + dc->hwss.enable_stream_gating (dc, pipe_ctx); + }if (old_clk) old_clk->funcs->cs_power_down (old_clk); } } - } static bool patch_address_for_sbs_tb_stereo(
@@ -2786,7 +2788,9 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .edp_wait_for_hpd_ready = hwss_edp_wait_for_hpd_ready, .set_cursor_position = dcn10_set_cursor_position, .set_cursor_attribute = dcn10_set_cursor_attribute, - .set_cursor_sdr_white_level = dcn10_set_cursor_sdr_white_level + .set_cursor_sdr_white_level = dcn10_set_cursor_sdr_white_level, + .disable_stream_gating = NULL, + .enable_stream_gating = NULL };
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +4 -0
@@ -68,6 +68,10 @@ struct stream_resource;struct hw_sequencer_funcs { +void (*disable_stream_gating)(struct dc *dc,struct pipe_ctx *pipe_ctx); + +void (*enable_stream_gating)(struct dc *dc,struct pipe_ctx *pipe_ctx); +void (*init_hw)(struct dc *dc);void (*init_pipes)(struct dc *dc,struct dc_state *context);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 6/35 drm/amd/display: Raise dispclk value for dce11
In reply to a message not in the archiveFrom: Roman Li <[email protected]>
[Why]
The visual corruption due to low display clock value. Observed on Carrizo 4K@60Hz.
[How]
There was earlier patch for dce_update_clocks:
Adding +15% workaround also to to dce11_update_clocks
--- drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_clk_mgr.c +8 -3
@@ -696,6 +696,11 @@ static void dce11_update_clocks(struct clk_mgr *clk_mgr, {struct dce_clk_mgr *clk_mgr_dce =TO_DCE_CLK_MGR (clk_mgr);struct dm_pp_power_level_change_request level_change_req; +int patched_disp_clk = context->bw.dce.dispclk_khz; + +/*TODO: W/A for dal3 linux, investigate why this works */ +if (!clk_mgr_dce->dfs_bypass_active) + patched_disp_clk = patched_disp_clk *115 /100 ; level_change_req.power_level =dce_get_required_clocks_state (clk_mgr, context);/* get max clock state from PPLIB */
@@ -705,9 +710,9 @@ static void dce11_update_clocks(struct clk_mgr *clk_mgr, clk_mgr_dce->cur_min_clks_state = level_change_req.power_level; } -if (should_set_clock (safe_to_lower, context->bw.dce.dispclk_khz, clk_mgr->clks.dispclk_khz)) { - context->bw.dce.dispclk_khz =dce_set_clock (clk_mgr, context->bw.dce.dispclk_khz); - clk_mgr->clks.dispclk_khz = context->bw.dce.dispclk_khz; +if (should_set_clock (safe_to_lower, patched_disp_clk, clk_mgr->clks.dispclk_khz)) { + context->bw.dce.dispclk_khz =dce_set_clock (clk_mgr, patched_disp_clk); + clk_mgr->clks.dispclk_khz = patched_disp_clk; }dce11_pplib_apply_display_requirements (clk_mgr->ctx->dc, context); }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 7/35 drm/amd/display: send pipe set command to dmcu when backlight is set
In reply to a message not in the archiveFrom: Josip Pavic <[email protected]>
[Why]
Previously, a change removed code that would send a pipe set command to dmcu each time the backlight was set, as it was thought to be superfluous. However, it is possible for the backlight to be set before a valid pipe has been set, which causes DMCU to hang after a DPMS restore on some systems.
[How]
Send a pipe set command to DMCU prior to setting the backlight.
--- drivers/gpu/drm/amd/display/dc/dce/dce_abm.c | 45 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 22 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_abm.c +23 -22
@@ -53,6 +53,27 @@#define MCP_DISABLE_ABM_IMMEDIATELY 255 +static bool dce_abm_set_pipe (struct abm *abm,uint32_t controller_id) +{ +struct dce_abm *abm_dce =TO_DCE_ABM (abm); +uint32_t rampingBoundary =0xFFFF ; + +REG_WAIT (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,0 , +1 ,80000 ); + +/* set ramping boundary */ +REG_WRITE (MASTER_COMM_DATA_REG1 , rampingBoundary); + +/* setDMCUParam_Pipe */ +REG_UPDATE_2 (MASTER_COMM_CMD_REG , +MASTER_COMM_CMD_REG_BYTE0 ,MCP_ABM_PIPE_SET , +MASTER_COMM_CMD_REG_BYTE1 , controller_id); + +/* notifyDMCUMsg */ +REG_UPDATE (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,1 ); + +return true; +}static unsigned int calculate_16_bit_backlight_from_pwm (struct dce_abm *abm_dce) {
@@ -184,6 +205,8 @@ static void dmcu_set_backlight_level(// Take MSB of fractional part since backlight is not max backlight_8_bit = (backlight_pwm_u16_16 >>8 ) &0xFF ; +dce_abm_set_pipe (&abm_dce->base, controller_id); +/* waitDMCUReadyForCmd */ REG_WAIT (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,0 ,1 ,80000 );
@@ -293,28 +316,6 @@ static bool dce_abm_set_level(struct abm *abm, uint32_t level)return true; } -static bool dce_abm_set_pipe (struct abm *abm,uint32_t controller_id) -{ -struct dce_abm *abm_dce =TO_DCE_ABM (abm); -uint32_t rampingBoundary =0xFFFF ; - -REG_WAIT (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,0 , -1 ,80000 ); - -/* set ramping boundary */ -REG_WRITE (MASTER_COMM_DATA_REG1 , rampingBoundary); - -/* setDMCUParam_Pipe */ -REG_UPDATE_2 (MASTER_COMM_CMD_REG , -MASTER_COMM_CMD_REG_BYTE0 ,MCP_ABM_PIPE_SET , -MASTER_COMM_CMD_REG_BYTE1 , controller_id); - -/* notifyDMCUMsg */ -REG_UPDATE (MASTER_COMM_CNTL_REG ,MASTER_COMM_INTERRUPT ,1 ); - -return true; -} -static bool dce_abm_immediate_disable (struct abm *abm) {struct dce_abm *abm_dce =TO_DCE_ABM (abm);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 8/35 drm/amd/display: Fix wrong z-order when updating overlay planes
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
If a commit updates an overlay plane via the legacy plane IOCTL then the only plane in the state will be the overlay plane.
Overlay planes need to be added first to the DC context, but in the scenario above the plane will be added last. This will result in wrong z-order during rendering.
[How]
If any non-cursor plane has been updated then the rest of the non-cursor planes should be added to the CRTC state.
The cursor plane doesn't need to be included for stream updates and locking it will cause performance issues. It should be ignored.
DC requires that the surface count passed during stream updates be the number of surfaces currently on the stream to enable fast updates. This previously wasn't the case without this patch, so this also allows this optimization to occur.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +36 -0
@@ -6046,6 +6046,42 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, goto fail; } +/* +* Add all primary and overlay planes on the CRTC to the state +* whenever a plane is enabled to maintain correct z-ordering +* and to enable fast surface updates. +*/ +drm_for_each_crtc (crtc, dev) { +bool modified = false; + +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) +continue ; + +if (new_plane_state->crtc == crtc || + old_plane_state->crtc == crtc) { + modified = true; +break ; + } + } + +if (!modified) +continue ; + +drm_for_each_plane_mask (plane, state->dev, crtc->state->plane_mask) { +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) +continue ; + + new_plane_state = +drm_atomic_get_plane_state (state, plane); + +if (IS_ERR (new_plane_state)) { + ret =PTR_ERR (new_plane_state); + goto fail; + } + } + } +/* Remove exiting planes if they are modified */ for_each_oldnew_plane_in_state_reverse (state, plane, old_plane_state, new_plane_state, i) { ret = dm_update_plane_state(dc, state, plane,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 9/35 drm/amd/display: Don't expose support for DRM_FORMAT_RGB888
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
This format isn't supported in DC and some IGT tests fail since we expose support for it.
[How]
Remove it.
--- 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
@@ -3877,7 +3877,6 @@ static const struct drm_plane_helper_funcs dm_plane_helper_funcs = {* check will succeed, and let DC implement proper check */ static const uint32_t rgb_formats[] = { -DRM_FORMAT_RGB888 ,DRM_FORMAT_XRGB8888 ,DRM_FORMAT_ARGB8888 ,DRM_FORMAT_RGBA8888 ,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 10/35 drm/amd/display: Fix update type mismatches in atomic check
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Whenever a stream or plane is added or removed from the context the pointer will change from old to new. We set lock and validation needed in these cases. But not all of these cases match update_type from dm_determine_update_type_for_commit - an example being overlay plane updates.
There are warnings for a few of these cases that should be fixed.
[How]
We can closer align to DC (and lock_and_validation_needed) by comparing stream and plane pointers.
Since the old stream/old plane state is never freed until sometime after the commit tail work finishes we are guaranteed to never get back the same block of memory when we remove and create a stream or plane state in the same commit.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +10 -6
@@ -5889,14 +5889,13 @@ dm_determine_update_type_for_commit(struct dc *dc, old_dm_crtc_state =to_dm_crtc_state (old_crtc_state); num_plane =0 ; -if (!new_dm_crtc_state->stream) { -if (!new_dm_crtc_state->stream && old_dm_crtc_state->stream) { - update_type =UPDATE_TYPE_FULL ; - goto cleanup; - } +if (new_dm_crtc_state->stream != old_dm_crtc_state->stream) { + update_type =UPDATE_TYPE_FULL ; + goto cleanup; + } +if (!new_dm_crtc_state->stream)continue ; - }for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, j) { new_plane_crtc = new_plane_state->crtc;
@@ -5907,6 +5906,11 @@ dm_determine_update_type_for_commit(struct dc *dc,if (plane->type ==DRM_PLANE_TYPE_CURSOR )continue ; +if (new_dm_plane_state->dc_state != old_dm_plane_state->dc_state) { + update_type =UPDATE_TYPE_FULL ; + goto cleanup; + } +if (!state->allow_modeset)continue ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 11/35 drm/amd/display: Do cursor updates after stream updates
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Cursor updates used to happen after vblank/flip/stream updates before the stream update refactor. They now happen before stream updates which means that they're not going to be synced with fb changes and that they're going to programmed for pipes that we're disabling within the same commit.
[How]
Move them after stream updates.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -3
@@ -4768,10 +4768,9 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,struct dc_plane_state *dc_plane;struct dm_plane_state *dm_new_plane_state =to_dm_plane_state (new_plane_state); -if (plane->type ==DRM_PLANE_TYPE_CURSOR ) { -handle_cursor_update (plane, old_plane_state); +/* Cursor plane is handled after stream updates */ +if (plane->type ==DRM_PLANE_TYPE_CURSOR )continue ; - }if (!fb || !crtc || pcrtc != crtc)continue ;
@@ -4964,6 +4963,10 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,mutex_unlock (&dm->dc_lock); } +for_each_oldnew_plane_in_state (state, plane, old_plane_state, new_plane_state, i) +if (plane->type ==DRM_PLANE_TYPE_CURSOR ) +handle_cursor_update (plane, old_plane_state); + cleanup:kfree (flip);kfree (full);
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 12/35 drm/amd/display: Clear stream->mode_changed after commit
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
The stream->mode_changed flag can persist in the following sequence of atomic commits:
Commit 1:
Enable CRTC0 (mode_changed = true), Enable CRTC1 (mode_changed = true)
Commit 2:
Disable CRTC1 (mode_changed = false)
In this sequence we want to keep the exiting CRTC0 but it's not in the atomic state for the commit since it hasn't been modified. In this case the stream->mode_changed flag persists as true and we don't re-program the planes for the existing stream.
[How]
The flag needs to be cleared and it makes the most sense to do it within DC after the state has been committed. Nothing following dc_commit_state should think that the stream's mode has changed.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -1138,6 +1138,9 @@ static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *c/* pplib is notified if disp_num changed */ dc->hwss.optimize_bandwidth (dc, context); +for (i =0 ; i < context->stream_count; i++) + context->streams[i]->mode_changed = false; +dc_release_state (dc->current_state); dc->current_state = context;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 13/35 drm/amd/display: Refactor for setup periodic interrupt.
In reply to a message not in the archiveFrom: Yongqiang Sun <[email protected]>
[Why]
Current periodic interrupt start point calc in optc is not clear.
[How]
1. DM convert delta time to lines number and dc will calculate the start position as per lines number and interrupt type.
2. hwss calculates the start point as per line offset.
3. optc programs vertical interrupts register as per start point and interrupt source.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 +- drivers/gpu/drm/amd/display/dc/dc_stream.h | 24 +++- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 6 +- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 145 ++++++++++++++++++++- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h | 2 + drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 133 +++---------------- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h | 13 +- .../drm/amd/display/dc/inc/hw/timing_generator.h | 23 ++-- drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 8 ++ 9 files changed, 215 insertions(+), 151 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -6
@@ -1626,13 +1626,13 @@ static void commit_planes_do_stream_update(struct dc *dc, stream_update->adjust->v_total_min, stream_update->adjust->v_total_max); -if (stream_update->periodic_vsync_config && 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,VLINE0 , &stream->periodic_vsync_config); +if (stream_update->periodic_interrupt0 && + dc->hwss.setup_periodic_interrupt) + dc->hwss.setup_periodic_interrupt (pipe_ctx,VLINE0 ); -if (stream_update->enhanced_sync_config && 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,VLINE1 , &stream->enhanced_sync_config); +if (stream_update->periodic_interrupt1 && + dc->hwss.setup_periodic_interrupt) + dc->hwss.setup_periodic_interrupt (pipe_ctx,VLINE1 ); if ((stream_update->hdr_static_metadata && !stream->use_dynamic_meta) || stream_update->vrr_infopacket ||
drivers/gpu/drm/amd/display/dc/dc_stream.h +17 -7
@@ -51,9 +51,19 @@ struct freesync_context {bool dummy; }; -union vline_config { -unsigned int line_number; -unsigned long long delta_in_ns; +enum vertical_interrupt_ref_point { +START_V_UPDATE =0 , +START_V_SYNC , +INVALID_POINT + +//For now, only v_update interrupt is used. +//START_V_BLANK, +//START_V_ACTIVE +}; + +struct periodic_interrupt_config { +enum vertical_interrupt_ref_point ref_point; +int lines_offset; };
@@ -106,8 +116,8 @@ struct dc_stream_state {/* DMCU info */ unsigned int abm_level; -union vline_config periodic_vsync_config; -union vline_config enhanced_sync_config; +struct periodic_interrupt_config periodic_interrupt0; +struct periodic_interrupt_config periodic_interrupt1;/* from core_stream struct */ struct dc_context *ctx;
@@ -158,8 +168,8 @@ struct dc_stream_update {struct dc_info_packet *hdr_static_metadata;unsigned int *abm_level; -union vline_config *periodic_vsync_config; -union vline_config *enhanced_sync_config; +struct periodic_interrupt_config *periodic_interrupt0; +struct periodic_interrupt_config *periodic_interrupt1;struct dc_crtc_timing_adjust *adjust;struct dc_info_packet *vrr_infopacket;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +2 -4
@@ -1333,10 +1333,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(if (!pipe_ctx->stream->apply_seamless_boot_optimization) dc->hwss.enable_stream_timing (pipe_ctx, context, dc); -if (pipe_ctx->stream_res.tg->funcs->program_vupdate_interrupt) - pipe_ctx->stream_res.tg->funcs->program_vupdate_interrupt ( - pipe_ctx->stream_res.tg, - &stream->timing); +if (dc->hwss.setup_vupdate_interrupt) + dc->hwss.setup_vupdate_interrupt (pipe_ctx); params.vertical_total_min = stream->adjust.v_total_min; params.vertical_total_max = stream->adjust.v_total_max;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +144 -1
157 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.h +2 -0
@@ -81,4 +81,6 @@ struct pipe_ctx *find_top_pipe_for_stream(struct dc_state *context, const struct dc_stream_state *stream); +int get_vupdate_offset_from_vsync (struct pipe_ctx *pipe_ctx); +#endif /* __DC_HWSS_DCN10_H__ */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +18 -115
160 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.h +9 -4
@@ -483,11 +483,16 @@ void optc1_program_timing(const struct dc_crtc_timing *dc_crtc_timing, bool use_vbios); -void optc1_program_vline_interrupt ( +void optc1_setup_vertical_interrupt0 (struct timing_generator *optc, -const struct dc_crtc_timing *dc_crtc_timing, -enum vline_select vline, -const union vline_config *vline_config); +uint32_t start_line, +uint32_t end_line); +void optc1_setup_vertical_interrupt1 ( +struct timing_generator *optc, +uint32_t start_line); +void optc1_setup_vertical_interrupt2 ( +struct timing_generator *optc, +uint32_t start_line);void optc1_program_global_sync (struct timing_generator *optc);
drivers/gpu/drm/amd/display/dc/inc/hw/timing_generator.h +9 -14
@@ -134,14 +134,6 @@ struct dc_crtc_timing;struct drr_params ; -union vline_config ; - - -enum vline_select { -VLINE0 , -VLINE1 , -VLINE2 -};struct timing_generator_funcs { bool (*validate_timing)(struct timing_generator *tg,
@@ -149,14 +141,17 @@ struct timing_generator_funcs {void (*program_timing)(struct timing_generator *tg,const struct dc_crtc_timing *timing,bool use_vbios); -void (*program_vline_interrupt)( +void (*setup_vertical_interrupt0)( +struct timing_generator *optc, +uint32_t start_line, +uint32_t end_line); +void (*setup_vertical_interrupt1)( +struct timing_generator *optc, +uint32_t start_line); +void (*setup_vertical_interrupt2)(struct timing_generator *optc, -const struct dc_crtc_timing *dc_crtc_timing, -enum vline_select vline, -const union vline_config *vline_config); +uint32_t start_line); -void (*program_vupdate_interrupt)(struct timing_generator *optc, -const struct dc_crtc_timing *dc_crtc_timing);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/inc/hw_sequencer.h +8 -0
@@ -38,6 +38,11 @@ enum pipe_gating_control {PIPE_GATING_CONTROL_INIT }; +enum vline_select { +VLINE0 , +VLINE1 +}; +struct dce_hwseq_wa {bool blnd_crtc_trigger;bool DEGVIDCN10_253;
@@ -224,6 +229,9 @@ struct hw_sequencer_funcs {void (*set_cursor_attribute)(struct pipe_ctx *pipe);void (*set_cursor_sdr_white_level)(struct pipe_ctx *pipe); +void (*setup_periodic_interrupt)(struct pipe_ctx *pipe_ctx,enum vline_select vline); +void (*setup_vupdate_interrupt)(struct pipe_ctx *pipe_ctx); + }; void color_space_to_black_color(
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 14/35 drm/amd/display: Add disable triple buffering DC debug option
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
Added a "disable_tri_buf" DC debug option. When set to 1 feature will be off.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -257,6 +257,7 @@ struct dc_debug_options {bool skip_detection_link_training;unsigned int force_odm_combine;//bit vector based on otg inst unsigned int force_fclk_khz; +bool disable_tri_buf; };struct dc_debug_data {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 15/35 drm/amd/display: Fix negative cursor pos programming
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
If the cursor pos passed from DM is less than the plane_state->dst_rect top left corner then the unsigned cursor pos wraps around to a large positive number since cursor pos is a u32.
There was an attempt to guard against this in hubp1_cursor_set_position by checking the src_x_offset and src_y_offset and offseting the cursor hotspot within hubp1_cursor_set_position.
However, the cursor position itself is still being programmed incorrectly as a large value.
This manifests itself visually as the cursor disappearing or containing strange artifacts near the middle of the screen on raven.
[How]
Don't subtract the destination rect top left corner from the pos but add it to the hotspot instead. This happens before the pos gets passed into hubp1_cursor_set_position.
This achieves the same result but avoids the subtraction wrap around. With this fix the original cursor programming logic can be used again.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c | 23 ++-------------------- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 4 ++-- 2 files changed, 4 insertions(+), 23 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +2 -21
@@ -1150,28 +1150,9 @@ void hubp1_cursor_set_position(REG_UPDATE (CURSOR_CONTROL ,CURSOR_ENABLE , cur_en); -//account for cases where we see negative offset relative to overlay plane -if (src_x_offset <0 && src_y_offset <0 ) { -REG_SET_2 (CURSOR_POSITION ,0 , -CURSOR_X_POSITION ,0 , -CURSOR_Y_POSITION ,0 ); - x_hotspot -= src_x_offset; - y_hotspot -= src_y_offset; - }else if (src_x_offset <0 ) { -REG_SET_2 (CURSOR_POSITION ,0 , -CURSOR_X_POSITION ,0 , -CURSOR_Y_POSITION , pos->y); - x_hotspot -= src_x_offset; - }else if (src_y_offset <0 ) { -REG_SET_2 (CURSOR_POSITION ,0 , +REG_SET_2 (CURSOR_POSITION ,0 ,CURSOR_X_POSITION , pos->x, -CURSOR_Y_POSITION ,0 ); - y_hotspot -= src_y_offset; - }else { -REG_SET_2 (CURSOR_POSITION ,0 , -CURSOR_X_POSITION , pos->x, -CURSOR_Y_POSITION , pos->y); - } +CURSOR_Y_POSITION , pos->y); REG_SET_2(CURSOR_HOT_SPOT, 0, CURSOR_HOT_SPOT_X, x_hotspot,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +2 -2
@@ -2693,8 +2693,8 @@ static void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) .mirror = pipe_ctx->plane_state->horizontal_mirror }; - pos_cpy.x -= pipe_ctx->plane_state->dst_rect.x; - pos_cpy.y -= pipe_ctx->plane_state->dst_rect.y; + pos_cpy.x_hotspot += pipe_ctx->plane_state->dst_rect.x; + pos_cpy.y_hotspot += pipe_ctx->plane_state->dst_rect.y;if (pipe_ctx->plane_state->address.type ==PLN_ADDR_TYPE_VIDEO_PROGRESSIVE )
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 16/35 drm/amd/display: PPLIB Hookup
In reply to a message not in the archiveFrom: Jun Lei <[email protected]>
[Why]
Make dml and integration with pplib clearer.
[How]
Change the way the dml formula is initialized to make its values more clear. Restructure DC interface with pplib into rv_funcs. Cap clocks received from pplib.
--- .../drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c | 20 ++++++------ drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c | 2 +- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 37 ++++++++++++++++------ .../gpu/drm/amd/display/dc/dcn10/dcn10_clk_mgr.c | 2 +- .../gpu/drm/amd/display/dc/dcn10/dcn10_resource.c | 6 ++-- drivers/gpu/drm/amd/display/dc/dm_pp_smu.h | 2 ++ drivers/gpu/drm/amd/display/dc/dm_services.h | 4 +-- drivers/gpu/drm/amd/display/dc/dm_services_types.h | 2 +- .../gpu/drm/amd/display/dc/dml/display_mode_lib.c | 24 ++++++++++++++ .../gpu/drm/amd/display/dc/dml/display_mode_lib.h | 5 +++ drivers/gpu/drm/amd/display/dc/inc/core_types.h | 2 +- 11 files changed, 78 insertions(+), 28 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_pp_smu.c +10 -10
@@ -611,17 +611,17 @@ void pp_rv_set_hard_min_fclk_by_freq(struct pp_smu *pp, int mhz) pp_funcs->set_hard_min_fclk_by_freq (pp_handle, mhz); } -void dm_pp_get_funcs_rv ( +void dm_pp_get_funcs (struct dc_context *ctx, -struct pp_smu_funcs_rv *funcs) +struct pp_smu_funcs *funcs) { - funcs->pp_smu.dm = ctx; - funcs->set_display_requirement = pp_rv_set_display_requirement; - funcs->set_wm_ranges = pp_rv_set_wm_ranges; - funcs->set_pme_wa_enable = pp_rv_set_pme_wa_enable; - funcs->set_display_count = pp_rv_set_active_display_count; - funcs->set_min_deep_sleep_dcfclk = pp_rv_set_min_deep_sleep_dcfclk; - funcs->set_hard_min_dcfclk_by_freq = pp_rv_set_hard_min_dcefclk_by_freq; - funcs->set_hard_min_fclk_by_freq = pp_rv_set_hard_min_fclk_by_freq; + funcs->rv_funcs.pp_smu.dm = ctx; + funcs->rv_funcs.set_display_requirement = pp_rv_set_display_requirement; + funcs->rv_funcs.set_wm_ranges = pp_rv_set_wm_ranges; + funcs->rv_funcs.set_pme_wa_enable = pp_rv_set_pme_wa_enable; + funcs->rv_funcs.set_display_count = pp_rv_set_active_display_count; + funcs->rv_funcs.set_min_deep_sleep_dcfclk = pp_rv_set_min_deep_sleep_dcfclk; + funcs->rv_funcs.set_hard_min_dcfclk_by_freq = pp_rv_set_hard_min_dcefclk_by_freq; + funcs->rv_funcs.set_hard_min_fclk_by_freq = pp_rv_set_hard_min_fclk_by_freq; }
drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c +1 -1
@@ -1391,7 +1391,7 @@ void dcn_bw_update_from_pplib(struct dc *dc)void dcn_bw_notify_pplib_of_wm_ranges (struct dc *dc) { -struct pp_smu_funcs_rv *pp = dc->res_pool->pp_smu; +struct pp_smu_funcs_rv *pp = &dc->res_pool->pp_smu->rv_funcs;struct pp_smu_wm_range_sets ranges = {0 };int min_fclk_khz, min_dcfclk_khz, socclk_khz;const int overdrive =5000000 ;/* 5 GHz to cover Overdrive */
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +28 -9
@@ -935,13 +935,31 @@ void hwss_edp_backlight_control(edp_receiver_ready_T9 (link); } +// Static helper function which calls the correct function +// based on pp_smu version +static void set_pme_wa_enable_by_version (struct dc *dc) +{ +struct pp_smu_funcs *pp_smu =NULL ; + +if (dc->res_pool->pp_smu) + pp_smu = dc->res_pool->pp_smu; + +if (pp_smu) { +if (pp_smu->ctx.ver ==PP_SMU_VER_RV && pp_smu->rv_funcs.set_pme_wa_enable) + pp_smu->rv_funcs.set_pme_wa_enable (&(pp_smu->ctx)); + } +} +void dce110_enable_audio_stream (struct pipe_ctx *pipe_ctx) { -struct dc *core_dc = pipe_ctx->stream->ctx->dc;/* notify audio driver for audio modes of monitor */ -struct pp_smu_funcs_rv *pp_smu = core_dc->res_pool->pp_smu; +struct dc *core_dc = pipe_ctx->stream->ctx->dc; +struct pp_smu_funcs *pp_smu =NULL ;unsigned int i, num_audio =1 ; +if (core_dc->res_pool->pp_smu) + pp_smu = core_dc->res_pool->pp_smu; +if (pipe_ctx->stream_res.audio) {for (i =0 ; i <MAX_PIPES ; i++) {/*current_state not updated yet*/
@@ -951,9 +969,9 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx) pipe_ctx->stream_res.audio->funcs->az_enable (pipe_ctx->stream_res.audio); -if (num_audio >=1 && pp_smu !=NULL && pp_smu->set_pme_wa_enable !=NULL ) +if (num_audio >=1 && pp_smu !=NULL )/*this is the first audio. apply the PME w/a in order to wake AZ from D3*/ - pp_smu->set_pme_wa_enable (&pp_smu->pp_smu); +set_pme_wa_enable_by_version (core_dc);/* un-mute audio */ /* TODO: audio should be per stream rather than per link */ pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control(
@@ -964,17 +982,18 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx)void dce110_disable_audio_stream (struct pipe_ctx *pipe_ctx,int option) {struct dc *dc = pipe_ctx->stream->ctx->dc; +struct pp_smu_funcs *pp_smu =NULL ; pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control ( pipe_ctx->stream_res.stream_enc, true);if (pipe_ctx->stream_res.audio) { -struct pp_smu_funcs_rv *pp_smu = dc->res_pool->pp_smu; +if (dc->res_pool->pp_smu) + pp_smu = dc->res_pool->pp_smu;if (option !=KEEP_ACQUIRED_RESOURCE || - !dc->debug.az_endpoint_mute_only) { + !dc->debug.az_endpoint_mute_only)/*only disalbe az_endpoint if power down or free*/ pipe_ctx->stream_res.audio->funcs->az_disable (pipe_ctx->stream_res.audio); - }if (dc_is_dp_signal (pipe_ctx->stream->signal)) pipe_ctx->stream_res.stream_enc->funcs->dp_audio_disable(
@@ -989,9 +1008,9 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option)update_audio_usage (&dc->current_state->res_ctx, dc->res_pool, pipe_ctx->stream_res.audio, false); pipe_ctx->stream_res.audio =NULL ; } -if (pp_smu !=NULL && pp_smu->set_pme_wa_enable !=NULL ) +if (pp_smu !=NULL )/*this is the first audio. apply the PME w/a in order to wake AZ from D3*/ - pp_smu->set_pme_wa_enable (&pp_smu->pp_smu); +set_pme_wa_enable_by_version (dc);/* TODO: notify audio driver for if audio modes list changed * add audio mode list change flag */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_clk_mgr.c +1 -1
@@ -171,7 +171,7 @@ static void dcn1_update_clocks(struct clk_mgr *clk_mgr,struct pp_smu_display_requirement_rv *smu_req_cur = &dc->res_pool->pp_smu_req;struct pp_smu_display_requirement_rv smu_req = *smu_req_cur; -struct pp_smu_funcs_rv *pp_smu = dc->res_pool->pp_smu; +struct pp_smu_funcs_rv *pp_smu = &dc->res_pool->pp_smu->rv_funcs;bool send_request_to_increase = false;bool send_request_to_lower = false;int display_count;
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +3 -3
@@ -848,14 +848,14 @@ void dcn10_clock_source_destroy(struct clock_source **clk_src) *clk_src =NULL ; } -static struct pp_smu_funcs_rv *dcn10_pp_smu_create (struct dc_context *ctx) +static struct pp_smu_funcs *dcn10_pp_smu_create (struct dc_context *ctx) { -struct pp_smu_funcs_rv *pp_smu =kzalloc (sizeof (*pp_smu),GFP_KERNEL ); +struct pp_smu_funcs *pp_smu =kzalloc (sizeof (*pp_smu),GFP_KERNEL );if (!pp_smu)return pp_smu; -dm_pp_get_funcs_rv (ctx, pp_smu); +dm_pp_get_funcs (ctx, pp_smu);return pp_smu; }
drivers/gpu/drm/amd/display/dc/dm_pp_smu.h +2 -0
@@ -30,6 +30,8 @@* interface to PPLIB/SMU to setup clocks and pstate requirements on SoC */ +typedef bool BOOLEAN ; +enum pp_smu_ver {/* * PP_SMU_INTERFACE_X should be interpreted as the interface defined
drivers/gpu/drm/amd/display/dc/dm_services.h +2 -2
@@ -223,8 +223,8 @@ bool dm_pp_notify_wm_clock_changes(const struct dc_context *ctx, struct dm_pp_wm_sets_with_clock_ranges *wm_with_clock_ranges); -void dm_pp_get_funcs_rv (struct dc_context *ctx, -struct pp_smu_funcs_rv *funcs); +void dm_pp_get_funcs (struct dc_context *ctx, +struct pp_smu_funcs *funcs);/* DAL calls this function to notify PP about completion of Mode Set. * For PP it means that current DCE clocks are those which were returned
drivers/gpu/drm/amd/display/dc/dm_services_types.h +1 -1
@@ -29,7 +29,7 @@#include "os_types.h" #include "dc_types.h" -struct pp_smu_funcs_rv ; +struct pp_smu_funcs ;struct dm_pp_clock_range {int min_khz;
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c +24 -0
@@ -29,6 +29,12 @@extern const struct _vcs_dpi_ip_params_st dcn1_0_ip;extern const struct _vcs_dpi_soc_bounding_box_st dcn1_0_soc; +static void set_soc_bounding_box_v2 (struct display_mode_lib *lib, +const struct _vcs_dpi_soc_bounding_box_st *soc_bb) +{ + lib->soc = *soc_bb; +} +static void set_soc_bounding_box (struct _vcs_dpi_soc_bounding_box_st *soc,enum dml_project project) {switch (project) {
@@ -41,6 +47,12 @@ static void set_soc_bounding_box(struct _vcs_dpi_soc_bounding_box_st *soc, enum } } +static void set_ip_params_v2 (struct display_mode_lib *lib, +const struct _vcs_dpi_ip_params_st *ip_params) +{ + lib->ip = *ip_params; +} +static void set_ip_params (struct _vcs_dpi_ip_params_st *ip,enum dml_project project) {switch (project) {
@@ -62,6 +74,18 @@ void dml_init_instance(struct display_mode_lib *lib, enum dml_project project) } } +void dml_init_instance_v2 (struct display_mode_lib *lib, +const struct _vcs_dpi_soc_bounding_box_st *soc_bb, +const struct _vcs_dpi_ip_params_st *ip_params, +enum dml_project project) +{ +if (lib->project != project) { +set_soc_bounding_box_v2 (lib, soc_bb); +set_ip_params_v2 (lib, ip_params); + lib->project = project; + } +} +const char *dml_get_status_message (enum dm_validation_status status) {switch (status) {
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.h +5 -0
@@ -43,6 +43,11 @@ struct display_mode_lib {void dml_init_instance (struct display_mode_lib *lib,enum dml_project project); +void dml_init_instance_v2 (struct display_mode_lib *lib, +const struct _vcs_dpi_soc_bounding_box_st *soc_bb, +const struct _vcs_dpi_ip_params_st *ip_params, +enum dml_project project); +const char *dml_get_status_message (enum dm_validation_status status);#endif
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -1
@@ -144,7 +144,7 @@ struct resource_pool {struct stream_encoder *stream_enc[MAX_PIPES *2 ];struct hubbub *hubbub;struct mpc *mpc; -struct pp_smu_funcs_rv *pp_smu; +struct pp_smu_funcs *pp_smu;struct pp_smu_display_requirement_rv pp_smu_req;struct dce_aux *engines[MAX_PIPES ];struct dce_i2c_hw *hw_i2cs[MAX_PIPES ];
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 17/35 drm/amd/display: 3.2.18
In reply to a message not in the archiveFrom: mmcgarri <[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
@@ -39,7 +39,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.17" +#define DC_VER "3.2.18"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 18/35 drm/amd/display: Move enum gamut_remap_select to hw_shared.h
In reply to a message not in the archiveFrom: Eric Bernstein <[email protected]>
This enum definition is shared, so move it to a shared location.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c | 7 ------- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c | 7 ------- drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h | 6 ++++++ 3 files changed, 6 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +0 -7
@@ -91,13 +91,6 @@ enum dscl_mode_sel { DSCL_MODE_DSCL_BYPASS = 6 }; -enum gamut_remap_select { -GAMUT_REMAP_BYPASS =0 , -GAMUT_REMAP_COEFF , -GAMUT_REMAP_COMA_COEFF , -GAMUT_REMAP_COMB_COEFF -}; -void dpp_read_state (struct dpp *dpp_base,struct dcn_dpp_state *s) {
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp_cm.c +0 -7
@@ -88,13 +88,6 @@ enum dscl_mode_sel {DSCL_MODE_DSCL_BYPASS =6 }; -enum gamut_remap_select { -GAMUT_REMAP_BYPASS =0 , -GAMUT_REMAP_COEFF , -GAMUT_REMAP_COMA_COEFF , -GAMUT_REMAP_COMB_COEFF -}; -static const struct dpp_input_csc_matrix dpp_input_csc_matrix[] = { {COLOR_SPACE_SRGB , {0x2000 ,0 ,0 ,0 ,0 ,0x2000 ,0 ,0 ,0 ,0 ,0x2000 ,0 } },
drivers/gpu/drm/amd/display/dc/inc/hw/hw_shared.h +6 -0
@@ -146,6 +146,12 @@ struct out_csc_color_matrix {uint16_t regval[12 ]; }; +enum gamut_remap_select { +GAMUT_REMAP_BYPASS =0 , +GAMUT_REMAP_COEFF , +GAMUT_REMAP_COMA_COEFF , +GAMUT_REMAP_COMB_COEFF +};enum opp_regamma {OPP_REGAMMA_BYPASS =0 ,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 19/35 drm/amd/display: Remove redundant 'else' statement in dcn1_update_clocks
In reply to a message not in the archiveFrom: Fatemeh Darbehani <[email protected]>
[Why]
DM has impelemented new pp_smu interface. 'Else' is not longer needed.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_clk_mgr.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_clk_mgr.c +0 -8
@@ -246,10 +246,6 @@ static void dcn1_update_clocks(struct clk_mgr *clk_mgr, pp_smu->set_hard_min_fclk_by_freq (&pp_smu->pp_smu, smu_req.hard_min_fclk_mhz); pp_smu->set_hard_min_dcfclk_by_freq (&pp_smu->pp_smu, smu_req.hard_min_dcefclk_mhz); pp_smu->set_min_deep_sleep_dcfclk (&pp_smu->pp_smu, smu_req.min_deep_sleep_dcefclk_mhz); - }else { -if (pp_smu->set_display_requirement) - pp_smu->set_display_requirement (&pp_smu->pp_smu, &smu_req); -dcn1_pplib_apply_display_requirements (dc, context); } }
@@ -272,10 +268,6 @@ static void dcn1_update_clocks(struct clk_mgr *clk_mgr, pp_smu->set_hard_min_fclk_by_freq (&pp_smu->pp_smu, smu_req.hard_min_fclk_mhz); pp_smu->set_hard_min_dcfclk_by_freq (&pp_smu->pp_smu, smu_req.hard_min_dcefclk_mhz); pp_smu->set_min_deep_sleep_dcfclk (&pp_smu->pp_smu, smu_req.min_deep_sleep_dcefclk_mhz); - }else { -if (pp_smu->set_display_requirement) - pp_smu->set_display_requirement (&pp_smu->pp_smu, &smu_req); -dcn1_pplib_apply_display_requirements (dc, context); } }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 20/35 drm/amd/display: make seamless boot work generically
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
Seamless boot code not working on all ASICs because of some underflow issues caused by some uninitialized HW state.
[How]
Keep some logical and power gating init code in hw_init. Move some per pipe init code to enable accelerated mode
--- .../amd/display/dc/dce110/dce110_hw_sequencer.c | 3 ++ .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 35 +++++++++++++++------- 2 files changed, 27 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -0
@@ -1551,6 +1551,9 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) } } +if (dc->hwss.init_pipes) + dc->hwss.init_pipes (dc, context); +if (edp_link) {/* this seems to cause blank screens on DCE8 */ if ((dc->ctx->dce_version == DCE_VERSION_8_0) ||
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +24 -11
@@ -889,22 +889,23 @@ void hwss1_plane_atomic_disconnect(struct dc *dc, struct pipe_ctx *pipe_ctx)dcn10_verify_allow_pstate_change_high (dc); } -static void plane_atomic_power_down (struct dc *dc,struct pipe_ctx *pipe_ctx) +static void plane_atomic_power_down (struct dc *dc, +struct dpp *dpp, +struct hubp *hubp) {struct dce_hwseq *hws = dc->hwseq; -struct dpp *dpp = pipe_ctx->plane_res.dpp;DC_LOGGER_INIT (dc->ctx->logger);if (REG (DC_IP_REQUEST_CNTL )) {REG_SET (DC_IP_REQUEST_CNTL ,0 ,IP_REQUEST_EN ,1 );dpp_pg_control (hws, dpp->inst, false); -hubp_pg_control (hws, pipe_ctx->plane_res.hubp->inst, false); +hubp_pg_control (hws, hubp->inst, false); dpp->funcs->dpp_reset (dpp);REG_SET (DC_IP_REQUEST_CNTL ,0 ,IP_REQUEST_EN ,0 );DC_LOG_DEBUG ( -"Power gated front end %d\n" , pipe_ctx->pipe_idx); +"Power gated front end %d\n" , hubp->inst); } }
@@ -931,7 +932,9 @@ static void plane_atomic_disable(struct dc *dc, struct pipe_ctx *pipe_ctx) hubp->power_gated = true; dc->optimized_required = false;/* We're powering off, no need to optimize */ -plane_atomic_power_down (dc, pipe_ctx); +plane_atomic_power_down (dc, + pipe_ctx->plane_res.dpp, + pipe_ctx->plane_res.hubp); pipe_ctx->stream =NULL ;memset (&pipe_ctx->stream_res,0 ,sizeof (pipe_ctx->stream_res));
@@ -1001,9 +1004,6 @@ static void dcn10_init_pipes(struct dc *dc, struct dc_state *context)struct dpp *dpp = dc->res_pool->dpps[i];struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i]; -// W/A for issue with dc_post_update_surfaces_to_stream - hubp->power_gated = true; -/* There is assumption that pipe_ctx is not mapping irregularly * to non-preferred front end. If pipe_ctx->stream is not NULL, * we will use the pipe, so don't disable
@@ -1108,6 +1108,22 @@ static void dcn10_init_hw(struct dc *dc) link->link_status.link_active = true; } +/* If taking control over from VBIOS, we may want to optimize our first +* mode set, so we need to skip powering down pipes until we know which +* pipes we want to use. +* Otherwise, if taking control is not possible, we need to power +* everything down. +*/ +if (dcb->funcs->is_accelerated_mode (dcb)) { +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +struct hubp *hubp = dc->res_pool->hubps[i]; +struct dpp *dpp = dc->res_pool->dpps[i]; + + dc->res_pool->opps[i]->mpc_tree_params.opp_id = dc->res_pool->opps[i]->inst; +plane_atomic_power_down (dc, dpp, hubp); + } + } +for (i =0 ; i < dc->res_pool->audio_count; i++) {struct audio *audio = dc->res_pool->audios[i];
@@ -1137,9 +1153,6 @@ static void dcn10_init_hw(struct dc *dc)enable_power_gating_plane (dc->hwseq, true);memset (&dc->res_pool->clk_mgr->clks,0 ,sizeof (dc->res_pool->clk_mgr->clks)); - -if (dc->hwss.init_pipes) - dc->hwss.init_pipes (dc, dc->current_state); } static void reset_hw_ctx_wrap(
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 21/35 drm/amd/display: Add DCN_VM aperture registers
In reply to a message not in the archiveFrom: Eryk Brol <[email protected]>
[Why]
For later use by the DC VM implementation
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.h +3 -0
@@ -595,6 +595,9 @@type AGP_BASE ;\type AGP_BOT ;\type AGP_TOP ;\ +type DCN_VM_SYSTEM_APERTURE_DEFAULT_SYSTEM ;\ +type DCN_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB ;\ +type DCN_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB ;\/* todo: get these from GVM instead of reading registers ourselves */ \type PAGE_DIRECTORY_ENTRY_HI32 ;\type PAGE_DIRECTORY_ENTRY_LO32 ;\
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 22/35 drm/amd/display: dcn add check surface in_use
In reply to a message not in the archiveFrom: Charlene Liu <[email protected]>
Driver need to poll the SURFACE_INUSE register to determine when to start the new task and write data to the checked surface.
Implement the wait functions, and add the necessary hubbub registers.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 ++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c | 46 ++++++++++++++++++++++ .../gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h | 25 ++++++++++-- .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 22 ++++++++++- drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h | 3 ++ drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h | 2 + 6 files changed, 97 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -0
@@ -1726,6 +1726,9 @@ static void commit_planes_for_stream(struct dc *dc,if (!pipe_ctx->plane_state)continue ; +/*make sure hw finished surface update*/ +if (dc->hwss.wait_surface_safe_to_update) + dc->hwss.wait_surface_safe_to_update (dc, pipe_ctx);/* Full fe update*/ if (update_type ==UPDATE_TYPE_FAST )
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c +46 -0
64 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.h +22 -3
@@ -52,7 +52,11 @@SR (DCHUBBUB_GLOBAL_TIMER_CNTL ), \SR (DCHUBBUB_TEST_DEBUG_INDEX ), \SR (DCHUBBUB_TEST_DEBUG_DATA ),\ - SR(DCHUBBUB_SOFT_RESET) +SR (DCHUBBUB_SOFT_RESET ),\ +SR (SURFACE_CHECK0_ADDRESS_MSB ),\ +SR (SURFACE_CHECK1_ADDRESS_MSB ),\ +SR (SURFACE_CHECK2_ADDRESS_MSB ),\ + SR(SURFACE_CHECK3_ADDRESS_MSB)#define HUBBUB_SR_WATERMARK_REG_LIST ()\ SR(DCHUBBUB_ARB_ALLOW_SR_ENTER_WATERMARK_A),\
@@ -116,6 +120,10 @@ struct dcn_hubbub_registers {uint32_t DCN_VM_AGP_BOT ;uint32_t DCN_VM_AGP_TOP ;uint32_t DCN_VM_AGP_BASE ; +uint32_t SURFACE_CHECK0_ADDRESS_MSB ; +uint32_t SURFACE_CHECK1_ADDRESS_MSB ; +uint32_t SURFACE_CHECK2_ADDRESS_MSB ; +uint32_t SURFACE_CHECK3_ADDRESS_MSB ; };/* set field name */
@@ -133,7 +141,11 @@ struct dcn_hubbub_registers {HUBBUB_SF (DCHUBBUB_ARB_DRAM_STATE_CNTL ,DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_VALUE , mask_sh), \HUBBUB_SF (DCHUBBUB_ARB_DRAM_STATE_CNTL ,DCHUBBUB_ARB_ALLOW_PSTATE_CHANGE_FORCE_ENABLE , mask_sh), \HUBBUB_SF (DCHUBBUB_ARB_SAT_LEVEL ,DCHUBBUB_ARB_SAT_LEVEL , mask_sh), \ - HUBBUB_SF(DCHUBBUB_ARB_DF_REQ_OUTSTAND, DCHUBBUB_ARB_MIN_REQ_OUTSTAND, mask_sh) +HUBBUB_SF (DCHUBBUB_ARB_DF_REQ_OUTSTAND ,DCHUBBUB_ARB_MIN_REQ_OUTSTAND , mask_sh),\ +HUBBUB_SF (SURFACE_CHECK0_ADDRESS_MSB ,CHECKER0_SURFACE_INUSE , mask_sh),\ +HUBBUB_SF (SURFACE_CHECK1_ADDRESS_MSB ,CHECKER1_SURFACE_INUSE , mask_sh),\ +HUBBUB_SF (SURFACE_CHECK2_ADDRESS_MSB ,CHECKER2_SURFACE_INUSE , mask_sh),\ + HUBBUB_SF(SURFACE_CHECK3_ADDRESS_MSB, CHECKER3_SURFACE_INUSE, mask_sh) #define HUBBUB_MASK_SH_LIST_DCN10(mask_sh)\ HUBBUB_MASK_SH_LIST_DCN(mask_sh), \
@@ -167,7 +179,12 @@ struct dcn_hubbub_registers {type FB_OFFSET ;\type AGP_BOT ;\type AGP_TOP ;\ - type AGP_BASE +type AGP_BASE ;\ +type CHECKER0_SURFACE_INUSE ;\ +type CHECKER1_SURFACE_INUSE ;\ +type CHECKER2_SURFACE_INUSE ;\ + type CHECKER3_SURFACE_INUSE + struct dcn_hubbub_shift {
@@ -215,6 +232,8 @@ void hubbub1_wm_read_state(struct hubbub *hubbub, struct dcn_hubbub_wm *wm);void hubbub1_soft_reset (struct hubbub *hubbub,bool reset); + +void hubbub1_wait_for_safe_surf_update (struct hubbub *hubbub,uint32_t hbup_inst); void hubbub1_construct(struct hubbub *hubbub, struct dc_context *ctx, const struct dcn_hubbub_registers *hubbub_regs,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +21 -1
@@ -88,6 +88,24 @@ static void log_mpc_crc(struct dc *dc, REG_READ(DPP_TOP0_DPP_CRC_VAL_B_A), REG_READ(DPP_TOP0_DPP_CRC_VAL_R_G)); } +void dcn10_wait_for_surface_safe_to_use (struct dc *dc, +struct pipe_ctx *pipe_ctx) +{ +struct hubbub *hubbub = dc->res_pool->hubbub; + +if (!pipe_ctx->plane_state) +return ; +if (!pipe_ctx->stream) +return ; + +if (!pipe_ctx->plane_state->visible) +return ; +if (hubbub->funcs->wait_for_surf_safe_update) { + hubbub->funcs->wait_for_surf_safe_update (dc->res_pool->hubbub, + pipe_ctx->plane_res.hubp->inst); + } +} +void dcn10_log_hubbub_state (struct dc *dc,struct dc_log_buffer_ctx *log_ctx) {struct dc_context *dc_ctx = dc->ctx;
@@ -2946,7 +2964,9 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .disable_stream_gating = NULL, .enable_stream_gating = NULL, .setup_periodic_interrupt = dcn10_setup_periodic_interrupt, - .setup_vupdate_interrupt = dcn10_setup_vupdate_interrupt + .setup_vupdate_interrupt = dcn10_setup_vupdate_interrupt, + .wait_surface_safe_to_update = dcn10_wait_for_surface_safe_to_use, + };
drivers/gpu/drm/amd/display/dc/inc/hw/dchubbub.h +3 -0
@@ -73,6 +73,9 @@ struct hubbub_funcs {void (*wm_read_state)(struct hubbub *hubbub,struct dcn_hubbub_wm *wm); + +void (*wait_for_surf_safe_update)(struct hubbub *hubbub, +uint32_t hbup_inst); };struct hubbub {
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +2 -0
@@ -232,6 +232,8 @@ struct hw_sequencer_funcs {void (*setup_periodic_interrupt)(struct pipe_ctx *pipe_ctx,enum vline_select vline);void (*setup_vupdate_interrupt)(struct pipe_ctx *pipe_ctx); +void (*wait_surface_safe_to_update)(struct dc *dc, +struct pipe_ctx *pipe_ctx); }; void color_space_to_black_color(
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 23/35 drm/amd/display: Allow for plane-less resource reservation
In reply to a message not in the archiveFrom: Dmytro Laktyushkin <[email protected]>
This change changes dc add plane logic to allow plane-less resource reservation (pipe split).
If a free pipe_ctx (no plane_state attached) is the head pipe, and is found with a bottom pipe attached, assign the plane to add on the bottom pipe.
In addition, prepend dcn10 to dcn10-specific reset_back_end_for_pipe and reset_hw_ctx_wrap
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 +++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +3 -0
@@ -1214,6 +1214,9 @@ bool dc_add_plane_to_context( free_pipe->clock_source = tail_pipe->clock_source; free_pipe->top_pipe = tail_pipe; tail_pipe->bottom_pipe = free_pipe; + }else if (free_pipe->bottom_pipe && free_pipe->bottom_pipe->plane_state ==NULL ) { +ASSERT (free_pipe->bottom_pipe->stream_res.opp != free_pipe->stream_res.opp); + free_pipe->bottom_pipe->plane_state = plane_state; }/* assign new surfaces*/
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +5 -6
@@ -732,7 +732,7 @@ static enum dc_status dcn10_enable_stream_timing(return DC_OK ; } -static void reset_back_end_for_pipe ( +static void dcn10_reset_back_end_for_pipe (struct dc *dc,struct pipe_ctx *pipe_ctx,struct dc_state *context)
@@ -1173,7 +1173,7 @@ static void dcn10_init_hw(struct dc *dc)memset (&dc->res_pool->clk_mgr->clks,0 ,sizeof (dc->res_pool->clk_mgr->clks)); } -static void reset_hw_ctx_wrap ( +static void dcn10_reset_hw_ctx_wrap (struct dc *dc,struct dc_state *context) {
@@ -1195,10 +1195,9 @@ static void reset_hw_ctx_wrap( pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {struct clock_source *old_clk = pipe_ctx_old->clock_source; -reset_back_end_for_pipe (dc, pipe_ctx_old, dc->current_state); -if (dc->hwss.enable_stream_gating) { +dcn10_reset_back_end_for_pipe (dc, pipe_ctx_old, dc->current_state); +if (dc->hwss.enable_stream_gating) dc->hwss.enable_stream_gating (dc, pipe_ctx); - }if (old_clk) old_clk->funcs->cs_power_down (old_clk); }
@@ -2944,7 +2943,7 @@ static const struct hw_sequencer_funcs dcn10_funcs = { .pipe_control_lock = dcn10_pipe_control_lock, .prepare_bandwidth = dcn10_prepare_bandwidth, .optimize_bandwidth = dcn10_optimize_bandwidth, - .reset_hw_ctx_wrap = reset_hw_ctx_wrap, + .reset_hw_ctx_wrap = dcn10_reset_hw_ctx_wrap, .enable_stream_timing = dcn10_enable_stream_timing, .set_drr = set_drr, .get_position = get_position,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 24/35 drm/amd/display: fix optimize_bandwidth func pointer for dce80
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
[Why]optimize_bandwidth was using dce100_prepare_bandwidth this is incorrect
[How]
change it to dce100_optimize_bandwidth
--- drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.h | 4 ++++ drivers/gpu/drm/amd/display/dc/dce80/dce80_hw_sequencer.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce100/dce100_hw_sequencer.h +4 -0
@@ -37,6 +37,10 @@ void dce100_prepare_bandwidth(struct dc *dc, struct dc_state *context); +void dce100_optimize_bandwidth ( +struct dc *dc, +struct dc_state *context); +bool dce100_enable_display_power_gating (struct dc *dc,uint8_t controller_id,struct dc_bios *dcb,enum pipe_gating_control power_gating);
drivers/gpu/drm/amd/display/dc/dce80/dce80_hw_sequencer.c +1 -1
@@ -77,6 +77,6 @@ void dce80_hw_sequencer_construct(struct dc *dc) dc->hwss.enable_display_power_gating = dce100_enable_display_power_gating; dc->hwss.pipe_control_lock = dce_pipe_control_lock; dc->hwss.prepare_bandwidth = dce100_prepare_bandwidth; - dc->hwss.optimize_bandwidth = dce100_prepare_bandwidth; + dc->hwss.optimize_bandwidth = dce100_optimize_bandwidth; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 25/35 drm/amd/display: Reset planes that were disabled in init_pipes
In reply to a message not in the archiveFrom: Nicholas Kazlauskas <[email protected]>
[Why]
Seamless boot tries to reuse planes that were enabled for the first commit applied.
In the case where Raven is booting with two monitors connected and the first commit contains two streams the screen corruption would occur because the second stream was trying to re-use a tg and plane that weren't previously enabled.
The state on the first commit looks something like the following:
TG0: enabled=1
TG1: enabled=0
TG2: enabled=0
TG3: enabled=0
New state: pipe=0, stream=0, plane=0, new_tg=0
New state: pipe=1, stream=1, plane=1, new_tg=1
New state: pipe=2, stream=NULL, plane=NULL, new_tg=NULL
New state: pipe=3, stream=NULL, plane=NULL, new_tg=NULL
Only one plane/tg is setup before we enter accelerated mode so we really want to disabling everything but that first plane.
[How]
Check if the stream is not NULL and if the tg is enabled before deciding whether to skip the plane disable.
Also ensure we're also disabling on the current state's pipe_ctx so we don't overwrite the fields in the new pending state.
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 -1
@@ -1026,9 +1026,14 @@ static void dcn10_init_pipes(struct dc *dc, struct dc_state *context)* to non-preferred front end. If pipe_ctx->stream is not NULL, * we will use the pipe, so don't disable */ -if (pipe_ctx->stream !=NULL ) +if (pipe_ctx->stream !=NULL && + pipe_ctx->stream_res.tg->funcs->is_tg_enabled ( + pipe_ctx->stream_res.tg))continue ; +/* Disable on the current state so the new one isn't cleared. */ + pipe_ctx = &dc->current_state->res_ctx.pipe_ctx[i]; + dpp->funcs->dpp_reset (dpp); pipe_ctx->stream_res.tg = tg;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 26/35 drm/amd/display: Fix exception from AUX acquire failure
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
AUX arbitration occurs between SW and FW components. When AUX acquire fails, it causes engine->ddc to be NULL, which leads to an exception when we try to release the AUX engine.
[How]
When AUX engine acquire fails, it should return from the function without trying to continue the operation. The upper level will determine if it wants to retry. i.e. dce_aux_transfer_with_retries will be used and retry.
--- drivers/gpu/drm/amd/display/dc/dce/dce_aux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +2 -2
@@ -374,7 +374,6 @@ static bool acquire(struct dce_aux *engine, struct ddc *ddc) { - enum gpio_result result;if (!is_engine_available (engine))
@@ -455,7 +454,8 @@ int dce_aux_transfer(struct ddc_service *ddc,memset (&aux_rep,0 ,sizeof (aux_rep)); aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]; -acquire (aux_engine, ddc_pin); +if (!acquire (aux_engine, ddc_pin)) +return -1 ;if (payload->i2c_over_aux) aux_req.type =AUX_TRANSACTION_TYPE_I2C ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 27/35 drm/amd/display: Set flip pending for pipe split
In reply to a message not in the archiveFrom: Wesley Chalmers <[email protected]>
[WHY]
When doing split pipe, if one pipe is pending on flip, the entire plane's status should be flip pending, otherwise corruption can occur when OS writes to a surface prematurely.
[HOW]
Clear the flip pending bit before checking pipes, then OR the flip pending bits from all pipes together to create the flip pending status of the entire plane.
--- drivers/gpu/drm/amd/display/dc/core/dc_surface.c | 13 +++++++++++++ drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_surface.c +13 -0
@@ -119,6 +119,19 @@ const struct dc_plane_status *dc_plane_get_status(if (core_dc->current_state ==NULL )return NULL ; +/* Find the current plane state and set its pending bit to false */ +for (i =0 ; i < core_dc->res_pool->pipe_count; i++) { +struct pipe_ctx *pipe_ctx = + &core_dc->current_state->res_ctx.pipe_ctx[i]; + +if (pipe_ctx->plane_state != plane_state) +continue ; + + pipe_ctx->plane_state->status.is_flip_pending = false; + +break ; + } +for (i =0 ; i < core_dc->res_pool->pipe_count; i++) {struct pipe_ctx *pipe_ctx = &core_dc->current_state->res_ctx.pipe_ctx[i];
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +1 -1
@@ -2689,7 +2689,7 @@ static void dcn10_update_pending_status(struct pipe_ctx *pipe_ctx) flip_pending = pipe_ctx->plane_res.hubp->funcs->hubp_is_flip_pending ( pipe_ctx->plane_res.hubp); - plane_state->status.is_flip_pending = flip_pending; + plane_state->status.is_flip_pending = plane_state->status.is_flip_pending || flip_pending;if (!flip_pending) plane_state->status.current_address = plane_state->status.requested_address;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 28/35 drm/amd/display: Clean up wait on vblank event
In reply to a message not in the archiveFrom: David Francis <[email protected]>
[Why]
The wait_for_vblank boolean in commit_tail was passed by reference into each stream commit, and if that commit was an asynchronous flip, it would disable vblank waits on all subsequent flips.
This made the behaviour depend on crtc order in a non-intuitive way, although since the asynchronous pageflip flag is only used by the legacy IOCTLs at the moment it is never an issue
[How]
Find wait_for_vblank before doing any stream commits
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +7 -11
@@ -4719,7 +4719,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,struct drm_device *dev, struct amdgpu_display_manager *dm, struct drm_crtc *pcrtc, - bool *wait_for_vblank) + bool wait_for_vblank) { uint32_t i, r;uint64_t timestamp_ns;
@@ -4786,14 +4786,6 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,if (pflip_needed) {/* -* Assume even ONE crtc with immediate flip means -* entire can't wait for VBLANK -* TODO Check if it's correct -*/ -if (new_pcrtc_state->pageflip_flags &DRM_MODE_PAGE_FLIP_ASYNC ) - *wait_for_vblank = false; - -/* * TODO This might fail and hence better not used, wait * explicitly on fences instead * and in general should be called for
@@ -4888,7 +4880,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,* hopefully eliminating dc_*_update structs in their entirety. */ if (flip_count) { - target = (uint32_t )drm_crtc_vblank_count (pcrtc) + *wait_for_vblank; + target = (uint32_t )drm_crtc_vblank_count (pcrtc) + wait_for_vblank;/* Prepare wait for target vblank early - before the fence-waits */ target_vblank = target - (uint32_t )drm_crtc_vblank_count (pcrtc) +amdgpu_get_vblank_counter_kms (pcrtc->dev, acrtc_attach->crtc_id);
@@ -5266,13 +5258,17 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)#endif } +for_each_new_crtc_in_state (state, crtc, new_crtc_state, j) +if (new_crtc_state->pageflip_flags &DRM_MODE_PAGE_FLIP_ASYNC ) + wait_for_vblank = false; +/* update planes when needed per crtc*/ for_each_new_crtc_in_state (state, crtc, new_crtc_state, j) { dm_new_crtc_state =to_dm_crtc_state (new_crtc_state);if (dm_new_crtc_state->stream)amdgpu_dm_commit_planes (state, dc_state, dev, - dm, crtc, &wait_for_vblank); + dm, crtc, wait_for_vblank); }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 29/35 drm/amd/display: Add p_state_change_support flag to dc_clocks
In reply to a message not in the archiveFrom: Jun Lei <[email protected]>
Will be used to signify if P-state change is supported.
--- drivers/gpu/drm/amd/display/dc/dc.h | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dc.h +1 -0
@@ -203,6 +203,7 @@ struct dc_clocks {int fclk_khz;int phyclk_khz;int dramclk_khz; +bool p_state_change_support; };struct dc_debug_options {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 30/35 drm/amd/display: set clocks to 0 on suspend on dce80
In reply to a message not in the archiveFrom: Bhawanpreet Lakha <[email protected]>
[Why]
When a dce80 asic was suspended, the clocks were not set to 0. Upon resume, the new clock was compared to the existing clock, they were found to be the same, and so the clock was not set. This resulted in a blackscreen.
[How]
In atomic commit, check to see if there are any active pipes. If no, set clocks to 0
--- drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dce80/dce80_resource.c +16 -3
@@ -792,9 +792,22 @@ bool dce80_validate_bandwidth(struct dc *dc, struct dc_state *context) { -/* TODO implement when needed but for now hardcode max value*/ - context->bw.dce.dispclk_khz = 681000; - context->bw.dce.yclk_khz =250000 *MEMORY_TYPE_MULTIPLIER_CZ ; + int i; +bool at_least_one_pipe = false; + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +if (context->res_ctx.pipe_ctx[i].stream) + at_least_one_pipe = true; + } + +if (at_least_one_pipe) { +/* TODO implement when needed but for now hardcode max value*/ + context->bw.dce.dispclk_khz =681000 ; + context->bw.dce.yclk_khz =250000 *MEMORY_TYPE_MULTIPLIER_CZ ; + }else { + context->bw.dce.dispclk_khz =0 ; + context->bw.dce.yclk_khz =0 ; + }return true; }
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 31/35 drm/amd/display: optionally optimize edp link rate based on timing
In reply to a message not in the archiveFrom: Josip Pavic <[email protected]>
[Why]
eDP v1.4 allows panels to report link rates other than RBR/HBR/HBR2, that may be more optimal for the panel's timing. Power can be saved by using a link rate closer to the required bandwidth of the panel's timing.
[How]
Scan the table of reported link rates from the panel, and select the minimum link rate that satisfies the bandwidth requirements of the panel's timing. Include a flag to make the feature optional.
--- drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 195 ++++++++++++++++------- drivers/gpu/drm/amd/display/dc/dc.h | 6 +- drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 2 + 3 files changed, 140 insertions(+), 63 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +133 -62
@@ -93,12 +93,10 @@ static void dpcd_set_link_settings(struct dc_link *link, const struct link_training_settings *lt_settings) { - uint8_t rate = (uint8_t) - (lt_settings->link_settings.link_rate); + uint8_t rate;union down_spread_ctrl downspread = { {0 } };union lane_count_set lane_count_set = { {0 } }; -uint8_t link_set_buffer[2 ]; downspread.raw = (uint8_t ) (lt_settings->link_settings.link_spread);
@@ -111,29 +109,42 @@ static void dpcd_set_link_settings( lane_count_set.bits.POST_LT_ADJ_REQ_GRANTED = link->dpcd_caps.max_ln_count.bits.POST_LT_ADJ_REQ_SUPPORTED; - link_set_buffer[0 ] = rate; - link_set_buffer[1 ] = lane_count_set.raw; - -core_link_write_dpcd (link,DP_LINK_BW_SET , - link_set_buffer,2 );core_link_write_dpcd (link,DP_DOWNSPREAD_CTRL , &downspread.raw,sizeof (downspread)); +core_link_write_dpcd (link,DP_LANE_COUNT_SET , + &lane_count_set.raw,1 ); +if (link->dpcd_caps.dpcd_rev.raw >=DPCD_REV_14 && - (link->dpcd_caps.link_rate_set >=1 && - link->dpcd_caps.link_rate_set <=8 )) { + lt_settings->link_settings.use_link_rate_set == true) { + rate =0 ; +core_link_write_dpcd (link,DP_LINK_BW_SET , &rate,1 );core_link_write_dpcd (link,DP_LINK_RATE_SET , - &link->dpcd_caps.link_rate_set,1 ); + <_settings->link_settings.link_rate_set,1 ); + }else { + rate = (uint8_t ) (lt_settings->link_settings.link_rate); +core_link_write_dpcd (link,DP_LINK_BW_SET , &rate,1 ); } -DC_LOG_HW_LINK_TRAINING ("%s\n %x rate = %x\n %x lane = %x\n %x spread = %x\n" , - __func__, -DP_LINK_BW_SET , - lt_settings->link_settings.link_rate, -DP_LANE_COUNT_SET , - lt_settings->link_settings.lane_count, -DP_DOWNSPREAD_CTRL , - lt_settings->link_settings.link_spread); +if (rate) { +DC_LOG_HW_LINK_TRAINING ("%s\n %x rate = %x\n %x lane = %x\n %x spread = %x\n" , + __func__, +DP_LINK_BW_SET , + lt_settings->link_settings.link_rate, +DP_LANE_COUNT_SET , + lt_settings->link_settings.lane_count, +DP_DOWNSPREAD_CTRL , + lt_settings->link_settings.link_spread); + }else { +DC_LOG_HW_LINK_TRAINING ("%s\n %x rate set = %x\n %x lane = %x\n %x spread = %x\n" , + __func__, +DP_LINK_RATE_SET , + lt_settings->link_settings.link_rate_set, +DP_LANE_COUNT_SET , + lt_settings->link_settings.lane_count, +DP_DOWNSPREAD_CTRL , + lt_settings->link_settings.link_spread); + } }
@@ -952,6 +963,8 @@ enum link_training_result dc_link_dp_perform_link_training( lt_settings.link_settings.link_rate = link_setting->link_rate; lt_settings.link_settings.lane_count = link_setting->lane_count; + lt_settings.link_settings.use_link_rate_set = link_setting->use_link_rate_set; + lt_settings.link_settings.link_rate_set = link_setting->link_rate_set;/*@todo[vdevulap] move SS to LS, should not be handled by displaypath*/
@@ -1075,7 +1088,7 @@ static struct dc_link_settings get_max_link_cap(struct dc_link *link) {/* Set Default link settings */ struct dc_link_settings max_link_cap = {LANE_COUNT_FOUR ,LINK_RATE_HIGH , -LINK_SPREAD_05_DOWNSPREAD_30KHZ }; +LINK_SPREAD_05_DOWNSPREAD_30KHZ , false,0 };/* Higher link settings based on feature supported */ if (link->link_enc->features.flags.bits.IS_HBR2_CAPABLE)
@@ -1629,47 +1642,65 @@ bool dp_validate_mode_timing(return false; } -void decide_link_settings (struct dc_stream_state *stream, -struct dc_link_settings *link_setting) +static bool decide_dp_link_settings (struct dc_link *link,struct dc_link_settings *link_setting,uint32_t req_bw) { -struct dc_link_settings initial_link_setting = { -LANE_COUNT_ONE ,LINK_RATE_LOW ,LINK_SPREAD_DISABLED }; +LANE_COUNT_ONE ,LINK_RATE_LOW ,LINK_SPREAD_DISABLED , false,0 };struct dc_link_settings current_link_setting = initial_link_setting; -struct dc_link *link; -uint32_t req_bw;uint32_t link_bw; - req_bw =bandwidth_in_kbps_from_timing (&stream->timing); - - link = stream->link; - -/* if preferred is specified through AMDDP, use it, if it's enough -* to drive the mode +/* search for the minimum link setting that: +* 1. is supported according to the link training result +* 2. could support the b/w requested by the timing */ -if (link->preferred_link_setting.lane_count != -LANE_COUNT_UNKNOWN && - link->preferred_link_setting.link_rate != -LINK_RATE_UNKNOWN ) { - *link_setting = link->preferred_link_setting; -return ; - } +while (current_link_setting.link_rate <= + link->verified_link_cap.link_rate) { + link_bw =bandwidth_in_kbps_from_link_settings ( + ¤t_link_setting); +if (req_bw <= link_bw) { + *link_setting = current_link_setting; +return true; + } -/* MST doesn't perform link training for now -* TODO: add MST specific link training routine -*/ -if (stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) { - *link_setting = link->verified_link_cap; -return ; +if (current_link_setting.lane_count < + link->verified_link_cap.lane_count) { + current_link_setting.lane_count = +increase_lane_count ( + current_link_setting.lane_count); + }else { + current_link_setting.link_rate = +increase_link_rate ( + current_link_setting.link_rate); + current_link_setting.lane_count = + initial_link_setting.lane_count; + } } -/* EDP use the link cap setting */ -if (link->connector_signal ==SIGNAL_TYPE_EDP ) { +return false; +} + +static bool decide_edp_link_settings (struct dc_link *link,struct dc_link_settings *link_setting,uint32_t req_bw) +{ +struct dc_link_settings initial_link_setting; +struct dc_link_settings current_link_setting; +uint32_t link_bw; + +if (link->dpcd_caps.dpcd_rev.raw <DPCD_REV_14 || + link->dpcd_caps.edp_supported_link_rates_count ==0 || + link->dc->config.optimize_edp_link_rate == false) { *link_setting = link->verified_link_cap; -return ; +return true; } +memset (&initial_link_setting,0 ,sizeof (initial_link_setting)); + initial_link_setting.lane_count =LANE_COUNT_ONE ; + initial_link_setting.link_rate = link->dpcd_caps.edp_supported_link_rates[0 ]; + initial_link_setting.link_spread =LINK_SPREAD_DISABLED ; + initial_link_setting.use_link_rate_set = true; + initial_link_setting.link_rate_set =0 ; + current_link_setting = initial_link_setting; +/* search for the minimum link setting that: * 1. is supported according to the link training result * 2. could support the b/w requested by the timing
@@ -1680,7 +1711,7 @@ void decide_link_settings(struct dc_stream_state *stream, ¤t_link_setting);if (req_bw <= link_bw) { *link_setting = current_link_setting; -return ; +return true; } if (current_link_setting.lane_count <
@@ -1689,13 +1720,53 @@ void decide_link_settings(struct dc_stream_state *stream,increase_lane_count ( current_link_setting.lane_count); }else { - current_link_setting.link_rate = -increase_link_rate ( - current_link_setting.link_rate); - current_link_setting.lane_count = - initial_link_setting.lane_count; +if (current_link_setting.link_rate_set < link->dpcd_caps.edp_supported_link_rates_count) { + current_link_setting.link_rate_set++; + current_link_setting.link_rate = + link->dpcd_caps.edp_supported_link_rates[current_link_setting.link_rate_set]; + current_link_setting.lane_count = + initial_link_setting.lane_count; + }else +break ; } } +return false; +} + +void decide_link_settings (struct dc_stream_state *stream, +struct dc_link_settings *link_setting) +{ +struct dc_link *link; +uint32_t req_bw; + + req_bw =bandwidth_in_kbps_from_timing (&stream->timing); + + link = stream->link; + +/* if preferred is specified through AMDDP, use it, if it's enough +* to drive the mode +*/ +if (link->preferred_link_setting.lane_count != +LANE_COUNT_UNKNOWN && + link->preferred_link_setting.link_rate != +LINK_RATE_UNKNOWN ) { + *link_setting = link->preferred_link_setting; +return ; + } + +/* MST doesn't perform link training for now +* TODO: add MST specific link training routine +*/ +if (stream->signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) { + *link_setting = link->verified_link_cap; +return ; + } + +if (link->connector_signal ==SIGNAL_TYPE_EDP ) { +if (decide_edp_link_settings (link, link_setting, req_bw)) +return ; + }else if (decide_dp_link_settings (link, link_setting, req_bw)) +return ;BREAK_TO_DEBUGGER ();ASSERT (link->verified_link_cap.lane_count !=LANE_COUNT_UNKNOWN );
@@ -2536,31 +2607,31 @@ enum dc_link_rate linkRateInKHzToLinkRateMultiplier(uint32_t link_rate_in_khz)void detect_edp_sink_caps (struct dc_link *link) { -uint8_t supported_link_rates[16 ] = {0 }; +uint8_t supported_link_rates[16 ];uint32_t entry;uint32_t link_rate_in_khz;enum dc_link_rate link_rate =LINK_RATE_UNKNOWN ;retrieve_link_cap (link); + link->dpcd_caps.edp_supported_link_rates_count =0 ; +memset (supported_link_rates,0 ,sizeof (supported_link_rates)); -if (link->dpcd_caps.dpcd_rev.raw >=DPCD_REV_14 ) { +if (link->dpcd_caps.dpcd_rev.raw >=DPCD_REV_14 && + link->dc->config.optimize_edp_link_rate) {// Read DPCD 00010h - 0001Fh 16 bytes at one shot core_link_read_dpcd (link,DP_SUPPORTED_LINK_RATES , supported_link_rates,sizeof (supported_link_rates)); - link->dpcd_caps.link_rate_set =0 ;for (entry =0 ; entry <16 ; entry +=2 ) {// DPCD register reports per-lane link rate = 16-bit link rate capability -// value X 200 kHz. Need multipler to find link rate in kHz. +// value X 200 kHz. Need multiplier to find link rate in kHz. link_rate_in_khz = (supported_link_rates[entry+1 ] *0x100 + supported_link_rates[entry]) *200 ;if (link_rate_in_khz !=0 ) { link_rate =linkRateInKHzToLinkRateMultiplier (link_rate_in_khz); -if (link->reported_link_cap.link_rate < link_rate) { - link->reported_link_cap.link_rate = link_rate; - link->dpcd_caps.link_rate_set = entry; - } + link->dpcd_caps.edp_supported_link_rates[link->dpcd_caps.edp_supported_link_rates_count] = link_rate; + link->dpcd_caps.edp_supported_link_rates_count++; } } }
drivers/gpu/drm/amd/display/dc/dc.h +5 -1
@@ -164,6 +164,7 @@ struct dc_config {bool gpu_vm_support;bool disable_disp_pll_sharing;bool fbc_support; +bool optimize_edp_link_rate; };enum visual_confirm {
@@ -648,6 +649,10 @@ struct dpcd_caps {union max_lane_count max_ln_count;union max_down_spread max_down_spread; +/* valid only for eDP v1.4 or higher*/ +uint8_t edp_supported_link_rates_count; +enum dc_link_rate edp_supported_link_rates[8 ]; +/* dongle type (DP converter, CV smart dongle) */ enum display_dongle_type dongle_type;/* Dongle's downstream count. */
@@ -665,7 +670,6 @@ struct dpcd_caps {int8_t branch_dev_name[6 ];int8_t branch_hw_revision;int8_t branch_fw_revision[2 ]; -uint8_t link_rate_set;bool allow_invalid_MSA_timing_param;bool panel_mode_edp;
drivers/gpu/drm/amd/display/dc/dc_dp_types.h +2 -0
@@ -94,6 +94,8 @@ struct dc_link_settings {enum dc_lane_count lane_count;enum dc_link_rate link_rate;enum dc_link_spread link_spread; +bool use_link_rate_set; +uint8_t link_rate_set; };struct dc_lane_settings {
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 32/35 drm/amd/display: Make stream commits call into DC only once
In reply to a message not in the archiveFrom: David Francis <[email protected]>
[Why]dc_commit_updates_for_stream is called twice per stream: once with the flip data and once will all other data. This causes problems when these DC calls have different numbers of planes
For example, a commit with a pageflip on plane A and a non-pageflip change on plane B will first call into DC with just plane A, causing plane B to be disabled. Then it will call into DC with both planes, re-enabling plane B
[How]
Merge flip and full into a single bundle
Apart from the single DC call, the logic should not be changed by this patch
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 129 +++++++++------------- 1 file changed, 54 insertions(+), 75 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +54 -75
@@ -4731,30 +4731,25 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,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)); -int flip_count =0 , planes_count =0 , vpos, hpos; +int planes_count =0 , vpos, hpos;unsigned long flags;struct amdgpu_bo *abo;uint64_t tiling_flags, dcc_address;uint32_t target, target_vblank; - -struct { -struct dc_surface_update surface_updates[MAX_SURFACES ]; -struct dc_flip_addrs flip_addrs[MAX_SURFACES ]; -struct dc_stream_update stream_update; - } *flip; +bool pflip_present = false;struct {struct dc_surface_update surface_updates[MAX_SURFACES ];struct dc_plane_info plane_infos[MAX_SURFACES ];struct dc_scaling_info scaling_infos[MAX_SURFACES ]; +struct dc_flip_addrs flip_addrs[MAX_SURFACES ];struct dc_stream_update stream_update; - } *full; + } *bundle; - flip =kzalloc (sizeof (*flip),GFP_KERNEL ); - full =kzalloc (sizeof (*full),GFP_KERNEL ); + bundle =kzalloc (sizeof (*bundle),GFP_KERNEL ); -if (!flip || !full) { -dm_error ("Failed to allocate update bundles\n" ); +if (!bundle) { +dm_error ("Failed to allocate update bundle\n" ); goto cleanup; }
@@ -4764,7 +4759,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,struct drm_crtc_state *new_crtc_state;struct drm_framebuffer *fb = new_plane_state->fb;struct amdgpu_framebuffer *afb =to_amdgpu_framebuffer (fb); -bool pflip_needed; +bool framebuffer_changed;struct dc_plane_state *dc_plane;struct dm_plane_state *dm_new_plane_state =to_dm_plane_state (new_plane_state);
@@ -4779,12 +4774,14 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,if (!new_crtc_state->active)continue ; - pflip_needed = old_plane_state->fb && + dc_plane = dm_new_plane_state->dc_state; + + framebuffer_changed = old_plane_state->fb && old_plane_state->fb != new_plane_state->fb; - dc_plane = dm_new_plane_state->dc_state; + pflip_present = pflip_present || framebuffer_changed; -if (pflip_needed) { +if (framebuffer_changed) {/* * TODO This might fail and hence better not used, wait * explicitly on fences instead
@@ -4806,22 +4803,22 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,amdgpu_bo_unreserve (abo); - flip->flip_addrs[flip_count].address.grph.addr.low_part =lower_32_bits (afb->address); - flip->flip_addrs[flip_count].address.grph.addr.high_part =upper_32_bits (afb->address); + bundle->flip_addrs[planes_count].address.grph.addr.low_part =lower_32_bits (afb->address); + bundle->flip_addrs[planes_count].address.grph.addr.high_part =upper_32_bits (afb->address); dcc_address =get_dcc_address (afb->address, tiling_flags); - flip->flip_addrs[flip_count].address.grph.meta_addr.low_part =lower_32_bits (dcc_address); - flip->flip_addrs[flip_count].address.grph.meta_addr.high_part =upper_32_bits (dcc_address); + bundle->flip_addrs[planes_count].address.grph.meta_addr.low_part =lower_32_bits (dcc_address); + bundle->flip_addrs[planes_count].address.grph.meta_addr.high_part =upper_32_bits (dcc_address); - flip->flip_addrs[flip_count].flip_immediate = + bundle->flip_addrs[planes_count].flip_immediate = (crtc->state->pageflip_flags &DRM_MODE_PAGE_FLIP_ASYNC ) !=0 ; timestamp_ns =ktime_get_ns (); - flip->flip_addrs[flip_count].flip_timestamp_in_us =div_u64 (timestamp_ns,1000 ); - flip->surface_updates[flip_count].flip_addr = &flip->flip_addrs[flip_count]; - flip->surface_updates[flip_count].surface = dc_plane; + bundle->flip_addrs[planes_count].flip_timestamp_in_us =div_u64 (timestamp_ns,1000 ); + bundle->surface_updates[planes_count].flip_addr = &bundle->flip_addrs[planes_count]; + bundle->surface_updates[planes_count].surface = dc_plane; -if (!flip->surface_updates[flip_count].surface) { +if (!bundle->surface_updates[planes_count].surface) {DRM_ERROR ("No surface for CRTC: id=%d\n" , acrtc_attach->crtc_id);continue ;
@@ -4833,53 +4830,45 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, acrtc_state, acrtc_state->stream, dc_plane, - flip->flip_addrs[flip_count].flip_timestamp_in_us); + bundle->flip_addrs[planes_count].flip_timestamp_in_us);DRM_DEBUG_DRIVER ("%s Flipping to hi: 0x%x, low: 0x%x\n" , __func__, - flip->flip_addrs[flip_count].address.grph.addr.high_part, - flip->flip_addrs[flip_count].address.grph.addr.low_part); - - flip_count +=1 ; + bundle->flip_addrs[planes_count].address.grph.addr.high_part, + bundle->flip_addrs[planes_count].address.grph.addr.low_part); } - full->surface_updates[planes_count].surface = dc_plane; + bundle->surface_updates[planes_count].surface = dc_plane;if (new_pcrtc_state->color_mgmt_changed) { - full->surface_updates[planes_count].gamma = dc_plane->gamma_correction; - full->surface_updates[planes_count].in_transfer_func = dc_plane->in_transfer_func; + bundle->surface_updates[planes_count].gamma = dc_plane->gamma_correction; + bundle->surface_updates[planes_count].in_transfer_func = dc_plane->in_transfer_func; } - full->scaling_infos[planes_count].scaling_quality = dc_plane->scaling_quality; - full->scaling_infos[planes_count].src_rect = dc_plane->src_rect; - full->scaling_infos[planes_count].dst_rect = dc_plane->dst_rect; - full->scaling_infos[planes_count].clip_rect = dc_plane->clip_rect; - full->surface_updates[planes_count].scaling_info = &full->scaling_infos[planes_count]; + bundle->scaling_infos[planes_count].scaling_quality = dc_plane->scaling_quality; + bundle->scaling_infos[planes_count].src_rect = dc_plane->src_rect; + bundle->scaling_infos[planes_count].dst_rect = dc_plane->dst_rect; + bundle->scaling_infos[planes_count].clip_rect = dc_plane->clip_rect; + bundle->surface_updates[planes_count].scaling_info = &bundle->scaling_infos[planes_count]; - full->plane_infos[planes_count].color_space = dc_plane->color_space; - full->plane_infos[planes_count].format = dc_plane->format; - full->plane_infos[planes_count].plane_size = dc_plane->plane_size; - full->plane_infos[planes_count].rotation = dc_plane->rotation; - full->plane_infos[planes_count].horizontal_mirror = dc_plane->horizontal_mirror; - full->plane_infos[planes_count].stereo_format = dc_plane->stereo_format; - full->plane_infos[planes_count].tiling_info = dc_plane->tiling_info; - full->plane_infos[planes_count].visible = dc_plane->visible; - full->plane_infos[planes_count].per_pixel_alpha = dc_plane->per_pixel_alpha; - full->plane_infos[planes_count].dcc = dc_plane->dcc; - full->surface_updates[planes_count].plane_info = &full->plane_infos[planes_count]; + bundle->plane_infos[planes_count].color_space = dc_plane->color_space; + bundle->plane_infos[planes_count].format = dc_plane->format; + bundle->plane_infos[planes_count].plane_size = dc_plane->plane_size; + bundle->plane_infos[planes_count].rotation = dc_plane->rotation; + bundle->plane_infos[planes_count].horizontal_mirror = dc_plane->horizontal_mirror; + bundle->plane_infos[planes_count].stereo_format = dc_plane->stereo_format; + bundle->plane_infos[planes_count].tiling_info = dc_plane->tiling_info; + bundle->plane_infos[planes_count].visible = dc_plane->visible; + bundle->plane_infos[planes_count].per_pixel_alpha = dc_plane->per_pixel_alpha; + bundle->plane_infos[planes_count].dcc = dc_plane->dcc; + bundle->surface_updates[planes_count].plane_info = &bundle->plane_infos[planes_count]; planes_count +=1 ; } -/* -* TODO: For proper atomic behaviour, we should be calling into DC once with -* all the changes. However, DC refuses to do pageflips and non-pageflip -* changes in the same call. Change DC to respect atomic behaviour, -* hopefully eliminating dc_*_update structs in their entirety. -*/ -if (flip_count) { +if (pflip_present) { target = (uint32_t )drm_crtc_vblank_count (pcrtc) + wait_for_vblank;/* Prepare wait for target vblank early - before the fence-waits */ target_vblank = target - (uint32_t)drm_crtc_vblank_count(pcrtc) +
@@ -4914,43 +4903,34 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,if (acrtc_state->stream) {if (acrtc_state->freesync_timing_changed) - flip->stream_update.adjust = + bundle->stream_update.adjust = &acrtc_state->stream->adjust;if (acrtc_state->freesync_vrr_info_changed) - flip->stream_update.vrr_infopacket = + bundle->stream_update.vrr_infopacket = &acrtc_state->stream->vrr_infopacket; } - -mutex_lock (&dm->dc_lock); -dc_commit_updates_for_stream (dm->dc, - flip->surface_updates, - flip_count, - acrtc_state->stream, - &flip->stream_update, - dc_state); -mutex_unlock (&dm->dc_lock); }if (planes_count) {if (new_pcrtc_state->mode_changed) { - full->stream_update.src = acrtc_state->stream->src; - full->stream_update.dst = acrtc_state->stream->dst; + bundle->stream_update.src = acrtc_state->stream->src; + bundle->stream_update.dst = acrtc_state->stream->dst; }if (new_pcrtc_state->color_mgmt_changed) - full->stream_update.out_transfer_func = acrtc_state->stream->out_transfer_func; + bundle->stream_update.out_transfer_func = acrtc_state->stream->out_transfer_func; acrtc_state->stream->abm_level = acrtc_state->abm_level;if (acrtc_state->abm_level != dm_old_crtc_state->abm_level) - full->stream_update.abm_level = &acrtc_state->abm_level; + bundle->stream_update.abm_level = &acrtc_state->abm_level;mutex_lock (&dm->dc_lock);dc_commit_updates_for_stream (dm->dc, - full->surface_updates, + bundle->surface_updates, planes_count, acrtc_state->stream, - &full->stream_update, + &bundle->stream_update, dc_state);mutex_unlock (&dm->dc_lock); }
@@ -4960,8 +4940,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,handle_cursor_update (plane, old_plane_state); cleanup: -kfree (flip); -kfree (full); +kfree (bundle); }/*
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 33/35 drm/amd/display: Add ability to override bounding box in DC construct
In reply to a message not in the archiveFrom: Jun Lei <[email protected]>
Add a dc_bounding_box_overrides struct to define bb overrides. It is loaded in during DC init.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 2 ++ drivers/gpu/drm/amd/display/dc/dc.h | 10 ++++++++++ 2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc.c +2 -0
@@ -621,6 +621,8 @@ static bool construct(struct dc *dc,#endif enum dce_version dc_version =DCE_VERSION_UNKNOWN ; +memcpy (&dc->bb_overrides, &init_params->bb_overrides,sizeof (dc->bb_overrides)); + dc_dceip =kzalloc (sizeof (*dc_dceip),GFP_KERNEL );if (!dc_dceip) {dm_error ("%s: failed to create dceip\n" , __func__);
drivers/gpu/drm/amd/display/dc/dc.h +10 -0
@@ -268,6 +268,14 @@ struct dc_debug_data {uint32_t auxErrorCount; }; +struct dc_bounding_box_overrides { +int sr_exit_time_ns; +int sr_enter_plus_exit_time_ns; +int urgent_latency_ns; +int percent_of_ideal_drambw; +int dram_clock_change_latency_ns; +}; +struct dc_state ;struct resource_pool ;struct dce_hwseq ;
@@ -277,6 +285,7 @@ struct dc {struct dc_cap_funcs cap_funcs;struct dc_config config;struct dc_debug_options debug; +struct dc_bounding_box_overrides bb_overrides;struct dc_context *ctx;uint8_t link_count;
@@ -330,6 +339,7 @@ struct dc_init_data {struct hw_asic_id asic_id;void *driver;/* ctx */ struct cgs_device *cgs_device; +struct dc_bounding_box_overrides bb_overrides;int num_virtual_links;/*
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 34/35 drm/amd/display: 3.2.19
In reply to a message not in the archiveFrom: Mark McGarrity <[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
@@ -39,7 +39,7 @@#include "inc/hw/dmcu.h" #include "dml/display_mode_lib.h" -#define DC_VER "3.2.18" +#define DC_VER "3.2.19"#define MAX_SURFACES 3#define MAX_STREAMS 6
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 35/35 drm/amd/display: Fix issue with link_active state not correct for MST
In reply to a message not in the archiveFrom: Anthony Koo <[email protected]>
[Why]
For MST, link not disabled until all streams disabled
[How]
Add check for stream_count before setting link_active = false for MST
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +11 -4
@@ -2037,6 +2037,9 @@ static enum dc_status enable_link(break ; } +if (status ==DC_OK ) + pipe_ctx->stream->link->link_status.link_active = true; +return status; }
@@ -2060,6 +2063,14 @@ static void disable_link(struct dc_link *link, enum signal_type signal)dp_disable_link_phy_mst (link, signal); }else link->link_enc->funcs->disable_output (link->link_enc, signal); + +if (signal ==SIGNAL_TYPE_DISPLAY_PORT_MST ) { +/* MST disable link only when no stream use the link */ +if (link->mst_stream_alloc_table.stream_count <=0 ) + link->link_status.link_active = false; + }else { + link->link_status.link_active = false; + } } static bool dp_active_dongle_validate_timing(
@@ -2623,8 +2634,6 @@ void core_link_enable_stream( } } - stream->link->link_status.link_active = true; - core_dc->hwss.enable_audio_stream (pipe_ctx);/* turn off otg test pattern if enable */
@@ -2659,8 +2668,6 @@ void core_link_disable_stream(struct pipe_ctx *pipe_ctx, int option) core_dc->hwss.disable_stream (pipe_ctx, option);disable_link (pipe_ctx->stream->link, pipe_ctx->stream->signal); - - pipe_ctx->stream->link->link_status.link_active = false; }void core_link_set_avmute (struct pipe_ctx *pipe_ctx,bool enable)
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx