DC Patches May 19 2023
cover DC Patches May 19 2023
This DC patchset brings improvements in multiple areas. In summary, we have:
- Improve the message printed
- Disable dcn315 pixel rate crb when scaling
- Update SR watermarks for DCN314
- Fix dcn315 pixel rate crb scaling check
- Reset CRTC State Before Restore from S2idle
- Have Payload Properly Created After Resume
- Trigger DIO FIFO resync on commit streams
- Revert vblank change that causes null pointer crash
- Fix possible underflow for displays with large vblank
- Apply 60us prefetch for DCFCLK <= 300Mhz
- Update correct DCN314 register header
Alan Liu (1):
drm/amd/display: Fix warning in disabling vblank irq
Alvin Lee (1):
drm/amd/display: Apply 60us prefetch for DCFCLK <= 300Mhz
Aric Cyr (1):
drm/amd/display: 3.2.237
Aurabindo Pillai (1):
drm/amd/display: improve the message printed when loading DC
Cruise Hung (2):
drm/amd/display: Fix DMUB debugging print issue drm/amd/display: Update correct DCN314 register header
Daniel Miess (2):
drm/amd/display: Revert vblank change that causes null pointer crash drm/amd/display: Fix possible underflow for displays with large vblank
Dmytro Laktyushkin (2):
drm/amd/display: disable dcn315 pixel rate crb when scaling drm/amd/display: fix dcn315 pixel rate crb scaling check
Fangzhi Zuo (1):
drm/amd/display: Have Payload Properly Created After Resume
Hersen Wu (1):
drm/amd/display: lower dp link training message level
Josip Pavic (1):
drm/amd/display: cache trace buffer size
Nicholas Kazlauskas (1):
drm/amd/display: Update SR watermarks for DCN314
Qingqing Zhuo (1):
drm/amd/display: Clean FPGA code in dc
Rodrigo Siqueira (1):
drm/amd/display: Reorganize DCN30 Makefile
Saaem Rizvi (2):
drm/amd/display: Trigger DIO FIFO resync on commit streams drm/amd/display: Trigger DIO FIFO resync on commit streams for DCN32
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 30 +++-- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 16 +-- .../dc/clk_mgr/dce112/dce112_clk_mgr.c | 8 +- .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c | 2 - .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 22 ++-- .../dc/clk_mgr/dcn201/dcn201_clk_mgr.c | 6 - .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 13 +-- .../dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c | 5 - .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 10 +- .../display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 18 +-- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 10 +- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 26 ++--- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 10 +- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 11 +- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 1 - drivers/gpu/drm/amd/display/dc/core/dc.c | 14 ++- .../gpu/drm/amd/display/dc/core/dc_stream.c | 30 ----- drivers/gpu/drm/amd/display/dc/dc.h | 4 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 103 ++++++------------ drivers/gpu/drm/amd/display/dc/dc_helper.c | 4 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 7 -- .../drm/amd/display/dc/dce/dce_clock_source.c | 38 ------- drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 2 - .../display/dc/dce110/dce110_hw_sequencer.c | 6 +- .../display/dc/dce112/dce112_hw_sequencer.c | 3 - .../display/dc/dce120/dce120_hw_sequencer.c | 3 - .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 36 +----- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 2 - .../drm/amd/display/dc/dcn10/dcn10_resource.c | 5 +- .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 4 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 5 - .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 4 - .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 1 - .../drm/amd/display/dc/dcn20/dcn20_resource.c | 15 +-- .../drm/amd/display/dc/dcn201/dcn201_hwseq.c | 20 +--- .../drm/amd/display/dc/dcn201/dcn201_optc.c | 1 - .../amd/display/dc/dcn201/dcn201_resource.c | 5 +- .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 4 - .../drm/amd/display/dc/dcn21/dcn21_resource.c | 10 +- drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 38 +++++-- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 28 ----- .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 4 - .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 1 - .../drm/amd/display/dc/dcn30/dcn30_resource.c | 8 +- .../amd/display/dc/dcn301/dcn301_resource.c | 10 +- .../amd/display/dc/dcn302/dcn302_resource.c | 5 +- .../amd/display/dc/dcn303/dcn303_resource.c | 5 +- .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 31 +----- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 4 - .../drm/amd/display/dc/dcn31/dcn31_resource.c | 17 +-- .../drm/amd/display/dc/dcn314/dcn314_dccg.c | 11 ++ .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 5 +- .../drm/amd/display/dc/dcn314/dcn314_hwseq.c | 27 +++++ .../drm/amd/display/dc/dcn314/dcn314_hwseq.h | 2 + .../drm/amd/display/dc/dcn314/dcn314_init.c | 5 +- .../amd/display/dc/dcn314/dcn314_resource.c | 10 +- .../amd/display/dc/dcn315/dcn315_resource.c | 30 ++--- .../amd/display/dc/dcn316/dcn316_resource.c | 17 +-- .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 21 +--- .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.h | 5 +- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 27 +++++ .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 2 + .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 5 +- .../drm/amd/display/dc/dcn32/dcn32_resource.c | 11 +- .../amd/display/dc/dcn321/dcn321_resource.c | 11 +- .../amd/display/dc/dml/dcn301/dcn301_fpu.c | 2 - .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 17 +-- .../dc/dml/dcn31/display_rq_dlg_calc_31.c | 8 -- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 6 +- .../dc/dml/dcn314/display_rq_dlg_calc_314.c | 8 -- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 4 +- .../dc/dml/dcn32/display_mode_vba_32.c | 4 +- .../dc/dml/dcn32/display_mode_vba_32.h | 2 +- .../amd/display/dc/dml/dcn321/dcn321_fpu.c | 4 - .../drm/amd/display/dc/dml/display_mode_lib.c | 1 - .../drm/amd/display/dc/dml/display_mode_lib.h | 1 - drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 3 + .../amd/display/dc/inc/hw_sequencer_private.h | 2 + .../display/dc/link/hwss/link_hwss_hpo_dp.c | 73 ------------- .../gpu/drm/amd/display/dc/link/link_dpms.c | 35 ++---- .../dc/link/protocols/link_dp_capability.c | 3 +- .../dc/link/protocols/link_dp_training.c | 17 ++- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dmub/src/Makefile | 2 +- .../drm/amd/display/dmub/src/dmub_dcn314.c | 62 +++++++++++ .../drm/amd/display/dmub/src/dmub_dcn314.h | 33 ++++++ .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 7 +- 87 files changed, 409 insertions(+), 740 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h
Signature · 1 line
2.25.1
PATCH 1/18 drm/amd/display: improve the message printed when loading DC
From: Aurabindo Pillai <[email protected]>
[Why&How]
Change how DC version and hardware version is printed when driver is loaded.
- Remove exclamation
- Add DC version and hardware version to both success and failure cases
- Add version in between appropriate filler words to make a complete statement.
--- 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
@@ -1666,10 +1666,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.dc =dc_create (&init_data);if (adev->dm.dc) { -DRM_INFO ("Display Core initialized with v%s! %s\n" ,DC_VER , +DRM_INFO ("Display Core v%s initialized on %s\n" ,DC_VER ,dce_version_to_string (adev->dm.dc->ctx->dce_version)); }else { -DRM_INFO ("Display Core failed to initialize with v%s!\n" ,DC_VER ); +DRM_INFO ("Display Core v%s failed to initialize on %s\n" ,DC_VER , +dce_version_to_string (adev->dm.dc->ctx->dce_version)); goto error; }
Signature · 1 line
2.25.1
Re: [PATCH 01/18] drm/amd/display: improve the message printed when loading DC
Hi,
Quoted 23 lines · Tom Chung
From: Aurabindo Pillai <[email protected]>
[Why&How]
Change how DC version and hardware version is printed when driver is loaded.- Remove exclamation
- Add DC version and hardware version to both success and failure cases
- Add version in between appropriate filler words to make a complete statement.Reviewed-by Harry Wentland <[email protected]>Acked-by Tom Chung <[email protected]>Signed-off-by Aurabindo Pillai <[email protected]>--- 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 +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 1668
Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0@@ -1666,10 +1666,11 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.dc =dc_create (&init_data);if (adev->dm.dc) {
// Check for NULL
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 1671
Quoted 4 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1
-1-DRM_INFO ("Display Core initialized with v%s! %s\n" ,DC_VER , +DRM_INFO ("Display Core v%s initialized on %s\n" ,DC_VER ,dce_version_to_string (adev->dm.dc->ctx->dce_version)); }else {
// adev->dm.dc is NULL here
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev)
Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2
-1-DRM_INFO ("Display Core failed to initialize with v%s!\n" ,DC_VER ); +DRM_INFO ("Display Core v%s failed to initialize on %s\n" ,DC_VER , + dce_version_to_string(adev->dm.dc->ctx->dce_version)); ^^^^NULL deref bug here.
I found this using static analysis with smatch.
drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm.c:1673 amdgpu_dm_init() error: we previously assumed 'adev->dm.dc' could be null (see line 1669)
If you fix this could you please consider adding:
Thanks,
Harshit
Quoted 3 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0goto error; }
PATCH 2/18 drm/amd/display: Fix DMUB debugging print issue
In reply to Tom ChungFrom: Cruise Hung <[email protected]>
[Why]
The DMUB diagnostic data was not printed out correctly.
[How]
Print the DMUB diagnostic data line by line.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 +++ drivers/gpu/drm/amd/display/dc/dc.h | 2 + drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 103 +++++++------------ 3 files changed, 49 insertions(+), 68 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +12 -0
@@ -4853,6 +4853,18 @@ void dc_process_dmub_dpia_hpd_int_enable(const struct dc *dc,DC_LOG_DEBUG ("%s: hpd_int_enable(%d)\n" , __func__, hpd_int_enable); } +/** +* dc_print_dmub_diagnostic_data - Print DMUB diagnostic data for debugging +* +* @dc: [in] dc structure +* +* +*/ +void dc_print_dmub_diagnostic_data (const struct dc *dc) +{ +dc_dmub_srv_log_diagnostic_data (dc->ctx->dmub_srv); +} +/** * dc_disable_accelerated_mode - disable accelerated mode * @dc: dc structure
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -2236,6 +2236,8 @@ enum dc_status dc_process_dmub_set_mst_slots(const struct dc *dc,void dc_process_dmub_dpia_hpd_int_enable (const struct dc *dc,uint32_t hpd_int_enable); +void dc_print_dmub_diagnostic_data (const struct dc *dc); +/* DSC Interfaces */ #include "dc_dsc.h"
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +35 -68
115 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH 3/18 drm/amd/display: disable dcn315 pixel rate crb when scaling
In reply to Tom ChungFrom: Dmytro Laktyushkin <[email protected]>
The rough calculation does not account for scaling. Also, make 2 segments the minimum allowed per surface to avoid potential 0 detile with mpc/odm combine on such outputs.
--- .../gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c +13 -0
@@ -1666,6 +1666,14 @@ static bool allow_pixel_rate_crb(struct dc *dc, struct dc_state *context)if (!res_ctx->pipe_ctx[i].stream)continue ; +/*Don't apply if scaling*/ +if (res_ctx->pipe_ctx[i].stream->src.width != res_ctx->pipe_ctx[i].stream->dst.width || + res_ctx->pipe_ctx[i].stream->src.height != res_ctx->pipe_ctx[i].stream->dst.height || + (res_ctx->pipe_ctx[i].top_pipe->plane_state && (res_ctx->pipe_ctx[i].top_pipe->plane_state->src_rect.width + != res_ctx->pipe_ctx[i].top_pipe->plane_state->dst_rect.width || + res_ctx->pipe_ctx[i].top_pipe->plane_state->src_rect.height + != res_ctx->pipe_ctx[i].top_pipe->plane_state->dst_rect.height))) +return false;/*Don't apply if MPO to avoid transition issues*/ if (res_ctx->pipe_ctx[i].top_pipe && res_ctx->pipe_ctx[i].top_pipe->plane_state != res_ctx->pipe_ctx[i].plane_state)return false;
@@ -1715,10 +1723,15 @@ static int dcn315_populate_dml_pipes_from_context(/* Ceil to crb segment size */ int approx_det_segs_required_for_pstate =dcn_get_approx_det_segs_required_for_pstate ( &context->bw_ctx.dml.soc, timing->pix_clk_100hz, bpp,DCN3_15_CRB_SEGMENT_SIZE_KB ); +if (approx_det_segs_required_for_pstate <=2 *DCN3_15_MAX_DET_SEGS ) {bool split_required = approx_det_segs_required_for_pstate >DCN3_15_MAX_DET_SEGS ; split_required = split_required || timing->pix_clk_100hz >=dcn_get_max_non_odm_pix_rate_100hz (&dc->dml.soc); split_required = split_required || (pipe->plane_state && pipe->plane_state->src_rect.width >5120 ); + +/* Minimum 2 segments to allow mpc/odm combine if its used later */ +if (approx_det_segs_required_for_pstate <2 ) + approx_det_segs_required_for_pstate =2 ;if (split_required) approx_det_segs_required_for_pstate += approx_det_segs_required_for_pstate %2 ; pipes[pipe_cnt].pipe.src.det_size_override = approx_det_segs_required_for_pstate;
Signature · 1 line
2.25.1
PATCH 4/18 drm/amd/display: Update SR watermarks for DCN314
In reply to Tom ChungFrom: Nicholas Kazlauskas <[email protected]>
[Why & How]
Update parameters for SR watermarks for DCN314
--- .../display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +8 -8
@@ -403,32 +403,32 @@ static struct wm_table lpddr5_wm_table = { .wm_inst = WM_A, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 16.5, - .sr_enter_plus_exit_time_us = 18.5, + .sr_exit_time_us = 30.0, + .sr_enter_plus_exit_time_us = 32.0, .valid = true, }, { .wm_inst = WM_B, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 16.5, - .sr_enter_plus_exit_time_us = 18.5, + .sr_exit_time_us = 30.0, + .sr_enter_plus_exit_time_us = 32.0, .valid = true, }, { .wm_inst = WM_C, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 16.5, - .sr_enter_plus_exit_time_us = 18.5, + .sr_exit_time_us = 30.0, + .sr_enter_plus_exit_time_us = 32.0, .valid = true, }, { .wm_inst = WM_D, .wm_type = WM_TYPE_PSTATE_CHG, .pstate_latency_us = 11.65333, - .sr_exit_time_us = 16.5, - .sr_enter_plus_exit_time_us = 18.5, + .sr_exit_time_us = 30.0, + .sr_enter_plus_exit_time_us = 32.0, .valid = true, }, }
Signature · 1 line
2.25.1
PATCH 5/18 drm/amd/display: Fix warning in disabling vblank irq
In reply to Tom ChungFrom: Alan Liu <[email protected]>
[Why]
During gpu-reset, we toggle vblank irq by calling dc_interrupt_set() instead of amdgpu_irq_get/put() because we don't want to change the irq source's refcount. However, we see the warning when vblank irq is enabled by dc_interrupt_set() during gpu-reset but disabled by amdgpu_irq_put() after gpu-reset.
[How]
Only in dm_gpureset_toggle_interrupts() we toggle vblank interrupts by calling dc_interrupt_set(). Apart from this we call dm_set_vblank() which uses amdgpu_irq_get/put() to operate vblank irq.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 21 ++++++++++++------- .../amd/display/amdgpu_dm/amdgpu_dm_crtc.c | 16 +++----------- 2 files changed, 16 insertions(+), 21 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +13 -8
@@ -2474,20 +2474,25 @@ static void dm_gpureset_toggle_interrupts(struct amdgpu_device *adev,if (acrtc && state->stream_status[i].plane_count !=0 ) { irq_source =IRQ_TYPE_PFLIP + acrtc->otg_inst; rc =dc_interrupt_set (adev->dm.dc, irq_source, enable) ?0 : -EBUSY ; -DRM_DEBUG_VBL ("crtc %d - vupdate irq %sabling: r=%d\n" , - acrtc->crtc_id, enable ?"en" :"dis" , rc);if (rc)DRM_WARN ("Failed to %s pflip interrupts\n" , enable ?"enable" :"disable" );if (enable) { - rc =amdgpu_dm_crtc_enable_vblank (&acrtc->base); -if (rc) -DRM_WARN ("Failed to enable vblank interrupts\n" ); - }else { -amdgpu_dm_crtc_disable_vblank (&acrtc->base); - } +if (amdgpu_dm_crtc_vrr_active (to_dm_crtc_state (acrtc->base.state))) + rc =amdgpu_dm_crtc_set_vupdate_irq (&acrtc->base, true); + }else + rc =amdgpu_dm_crtc_set_vupdate_irq (&acrtc->base, false); +if (rc) +DRM_WARN ("Failed to %sable vupdate interrupt\n" , enable ?"en" :"dis" ); + + irq_source =IRQ_TYPE_VBLANK + acrtc->otg_inst; +/* During gpu-reset we disable and then enable vblank irq, so +* don't use amdgpu_irq_get/put() to avoid refcount change. +*/ +if (!dc_interrupt_set (adev->dm.dc, irq_source, enable)) +DRM_WARN ("Failed to %sable vblank interrupt\n" , enable ?"en" :"dis" ); } }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c +3 -13
@@ -146,7 +146,6 @@ static void vblank_control_worker(struct work_struct *work)static inline int dm_set_vblank (struct drm_crtc *crtc,bool enable) { -enum dc_irq_source irq_source;struct amdgpu_crtc *acrtc =to_amdgpu_crtc (crtc);struct amdgpu_device *adev =drm_to_adev (crtc->dev);struct dm_crtc_state *acrtc_state =to_dm_crtc_state (crtc->state);
@@ -169,18 +168,9 @@ static inline int dm_set_vblank(struct drm_crtc *crtc, bool enable)if (rc)return rc; -if (amdgpu_in_reset (adev)) { - irq_source =IRQ_TYPE_VBLANK + acrtc->otg_inst; -/* During gpu-reset we disable and then enable vblank irq, so -* don't use amdgpu_irq_get/put() to avoid refcount change. -*/ -if (!dc_interrupt_set (adev->dm.dc, irq_source, enable)) - rc = -EBUSY ; - }else { - rc = (enable) - ?amdgpu_irq_get (adev, &adev->crtc_irq, acrtc->crtc_id) - :amdgpu_irq_put (adev, &adev->crtc_irq, acrtc->crtc_id); - } + rc = (enable) + ?amdgpu_irq_get (adev, &adev->crtc_irq, acrtc->crtc_id) + :amdgpu_irq_put (adev, &adev->crtc_irq, acrtc->crtc_id);if (rc)return rc;
Signature · 1 line
2.25.1
PATCH 6/18 drm/amd/display: lower dp link training message level
In reply to Tom ChungFrom: Hersen Wu <[email protected]>
[Why] some test apps report dp link training waring even dp training pass. there are 4 tries of lt within perform_link_training_with_retries. if lt pass within 4 tries, it will NOT be reated as lt failure. for each try of lt, if lt fails, current driver implementation prints message at warning level. this let people think dp lt does not work properly.
[How] for 1st, 2nd and 3rd try of lt, print message at debug level. for the 4th try of lt, print message at warning level.
--- .../dc/link/protocols/link_dp_training.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +13 -4
@@ -1653,10 +1653,19 @@ bool perform_link_training_with_retries(break ; } -DC_LOG_WARNING ("%s: Link(%d) training attempt %u of %d failed @ rate(%d) x lane(%d) @ spread = %x : fail reason:(%d)\n" , - __func__, link->link_index, (unsigned int )j +1 , attempts, - cur_link_settings.link_rate, cur_link_settings.lane_count, - cur_link_settings.link_spread, status); +if (j == (attempts -1 )) { +DC_LOG_WARNING ( +"%s: Link(%d) training attempt %u of %d failed @ rate(%d) x lane(%d) @ spread = %x : fail reason:(%d)\n" , + __func__, link->link_index, (unsigned int )j +1 , attempts, + cur_link_settings.link_rate, cur_link_settings.lane_count, + cur_link_settings.link_spread, status); + }else { +DC_LOG_HW_LINK_TRAINING ( +"%s: Link(%d) training attempt %u of %d failed @ rate(%d) x lane(%d) @ spread = %x : fail reason:(%d)\n" , + __func__, link->link_index, (unsigned int )j +1 , attempts, + cur_link_settings.link_rate, cur_link_settings.lane_count, + cur_link_settings.link_spread, status); + }dp_disable_link_phy (link, &pipe_ctx->link_res, signal);
Signature · 1 line
2.25.1
PATCH 7/18 drm/amd/display: fix dcn315 pixel rate crb scaling check
In reply to Tom ChungFrom: Dmytro Laktyushkin <[email protected]>
fix dcn315 pixel rate crb scaling check error
--- drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c +4 -4
@@ -1669,10 +1669,10 @@ static bool allow_pixel_rate_crb(struct dc *dc, struct dc_state *context)/*Don't apply if scaling*/ if (res_ctx->pipe_ctx[i].stream->src.width != res_ctx->pipe_ctx[i].stream->dst.width || res_ctx->pipe_ctx[i].stream->src.height != res_ctx->pipe_ctx[i].stream->dst.height || - (res_ctx->pipe_ctx[i].top_pipe->plane_state && (res_ctx->pipe_ctx[i].top_pipe->plane_state->src_rect.width - != res_ctx->pipe_ctx[i].top_pipe->plane_state->dst_rect.width || - res_ctx->pipe_ctx[i].top_pipe->plane_state->src_rect.height - != res_ctx->pipe_ctx[i].top_pipe->plane_state->dst_rect.height))) + (res_ctx->pipe_ctx[i].plane_state && (res_ctx->pipe_ctx[i].plane_state->src_rect.width + != res_ctx->pipe_ctx[i].plane_state->dst_rect.width || + res_ctx->pipe_ctx[i].plane_state->src_rect.height + != res_ctx->pipe_ctx[i].plane_state->dst_rect.height)))return false;/*Don't apply if MPO to avoid transition issues*/ if (res_ctx->pipe_ctx[i].top_pipe && res_ctx->pipe_ctx[i].top_pipe->plane_state != res_ctx->pipe_ctx[i].plane_state)
Signature · 1 line
2.25.1
PATCH 8/18 drm/amd/display: Have Payload Properly Created After Resume
In reply to Tom ChungFrom: Fangzhi Zuo <[email protected]>
At drm suspend sequence, MST dc_sink is removed. When commit cached MST stream back in drm resume sequence, the MST stream payload is not properly created and added into the payload table. After resume, topology change is reprobed by removing existing streams first. That leads to no payload is found in the existing payload table as below error "[drm] ERROR No payload for [MST PORT:] found in mst state"
1. In encoder .atomic_check routine, remove check existance of dc_sink
2. Bypass MST by checking existence of MST root port. dc_link_type cannot differentiate MST port before topology is rediscovered.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
@@ -2852,7 +2852,7 @@ static int dm_resume(void *handle)* this is the case when traversing through already created * MST connectors, should be skipped */ -if (aconnector->dc_link->type == dc_connection_mst_branch) +if (aconnector && aconnector->mst_root)continue ;mutex_lock (&aconnector->hpd_lock);
@@ -6776,7 +6776,7 @@ static int dm_encoder_helper_atomic_check(struct drm_encoder *encoder,int clock, bpp =0 ;bool is_y420 = false; -if (!aconnector->mst_output_port || !aconnector->dc_sink) +if (!aconnector->mst_output_port)return 0 ; mst_port = aconnector->mst_output_port;
Signature · 1 line
2.25.1
PATCH 9/18 drm/amd/display: Trigger DIO FIFO resync on commit streams
In reply to Tom ChungFrom: Saaem Rizvi <[email protected]>
[WHY]
Currently, there is an intermittent issue where a screen can either go blank or be corrupted.
[HOW]
To resolve the issue we trigger the ramping logic for DIO FIFO so that it goes back up to the correct speed.
--- .../display/dc/dce110/dce110_hw_sequencer.c | 3 +++ .../gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h | 4 ++- .../drm/amd/display/dc/dcn314/dcn314_dccg.c | 11 ++++++++ .../drm/amd/display/dc/dcn314/dcn314_dccg.h | 5 +++- .../drm/amd/display/dc/dcn314/dcn314_hwseq.c | 27 +++++++++++++++++++ .../drm/amd/display/dc/dcn314/dcn314_hwseq.h | 2 ++ .../drm/amd/display/dc/dcn314/dcn314_init.c | 1 + drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h | 3 +++ .../amd/display/dc/inc/hw_sequencer_private.h | 2 ++ 9 files changed, 56 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +3 -0
@@ -2291,6 +2291,9 @@ enum dc_status dce110_apply_ctx_to_hw(if (DC_OK != status)return status; + +if (hws->funcs.resync_fifo_dccg_dio) + hws->funcs.resync_fifo_dccg_dio (hws, dc, context); }if (dc->fbc_compressor)
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h +3 -1
@@ -208,7 +208,9 @@#define DCCG314_REG_FIELD_LIST (type) \ type DSCCLK3_DTO_PHASE;\ type DSCCLK3_DTO_MODULO;\ - type DSCCLK3_DTO_ENABLE; + type DSCCLK3_DTO_ENABLE;\ + type DENTIST_DISPCLK_RDIVIDER;\ + type DENTIST_DISPCLK_WDIVIDER;#define DCCG32_REG_FIELD_LIST (type) \ type DPSTREAMCLK0_EN;\
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.c +11 -0
@@ -45,6 +45,16 @@#define DC_LOGGER \ dccg->ctx->logger +static void dccg314_trigger_dio_fifo_resync ( +struct dccg *dccg) +{ +struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); +uint32_t dispclk_rdivider_value =0 ; + +REG_GET (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_RDIVIDER , &dispclk_rdivider_value); +REG_UPDATE (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_WDIVIDER , dispclk_rdivider_value); +} + static void dccg314_get_pixel_rate_div( struct dccg *dccg, uint32_t otg_inst,
@@ -357,6 +367,7 @@ static const struct dccg_funcs dccg314_funcs = { .disable_dsc = dccg31_disable_dscclk, .enable_dsc = dccg31_enable_dscclk, .set_pixel_rate_div = dccg314_set_pixel_rate_div, + .trigger_dio_fifo_resync = dccg314_trigger_dio_fifo_resync, .set_valid_pixel_rate = dccg314_set_valid_pixel_rate, };
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dccg.h +4 -1
@@ -192,7 +192,10 @@DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYBSYMCLK_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYCSYMCLK_GATE_DISABLE , mask_sh),\DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYDSYMCLK_GATE_DISABLE , mask_sh),\ - DCCG_SF(DCCG_GATE_DISABLE_CNTL2, PHYESYMCLK_GATE_DISABLE, mask_sh) +DCCG_SF (DCCG_GATE_DISABLE_CNTL2 ,PHYESYMCLK_GATE_DISABLE , mask_sh),\ +DCCG_SF (HDMISTREAMCLK0_DTO_PARAM ,HDMISTREAMCLK0_DTO_MODULO , mask_sh),\ +DCCG_SF (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_RDIVIDER , mask_sh),\ + DCCG_SF(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_WDIVIDER, mask_sh) struct dccg *dccg314_create( struct dc_context *ctx,
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.c +27 -0
@@ -390,6 +390,33 @@ void dcn314_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx) pix_per_cycle); } +void dcn314_resync_fifo_dccg_dio (struct dce_hwseq *hws,struct dc *dc,struct dc_state *context) +{ +uint8_t i; +struct pipe_ctx *pipe =NULL ; +bool otg_disabled[MAX_PIPES ] = {false}; + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { + pipe = &dc->current_state->res_ctx.pipe_ctx[i]; + +if (pipe->top_pipe || pipe->prev_odm_pipe) +continue ; + +if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal))) { + pipe->stream_res.tg->funcs->disable_crtc (pipe->stream_res.tg); +reset_sync_context_for_pipe (dc, context, i); + otg_disabled[i] = true; + } + } + + hws->ctx->dc->res_pool->dccg->funcs->trigger_dio_fifo_resync (hws->ctx->dc->res_pool->dccg); + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +if (otg_disabled[i]) + pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); + } +} +void dcn314_dpp_root_clock_control (struct dce_hwseq *hws,unsigned int dpp_inst,bool clock_on) {if (!hws->ctx->dc->debug.root_clock_optimization.bits.dpp)
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_hwseq.h +2 -0
@@ -41,6 +41,8 @@ unsigned int dcn314_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsigvoid dcn314_set_pixels_per_cycle (struct pipe_ctx *pipe_ctx); +void dcn314_resync_fifo_dccg_dio (struct dce_hwseq *hws,struct dc *dc,struct dc_state *context); +void dcn314_hubp_pg_control (struct dce_hwseq *hws,unsigned int hubp_inst,bool power_on);void dcn314_dpp_root_clock_control (struct dce_hwseq *hws,unsigned int dpp_inst,bool clock_on);
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c +1 -0
@@ -152,6 +152,7 @@ static const struct hwseq_private_funcs dcn314_private_funcs = { .setup_hpo_hw_control = dcn31_setup_hpo_hw_control, .calculate_dccg_k1_k2_values = dcn314_calculate_dccg_k1_k2_values, .set_pixels_per_cycle = dcn314_set_pixels_per_cycle, + .resync_fifo_dccg_dio = dcn314_resync_fifo_dccg_dio, };void dcn314_hw_sequencer_construct (struct dc *dc)
drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h +3 -0
@@ -159,6 +159,9 @@ struct dccg_funcs {int otg_inst, int pixclk_khz); +void (*trigger_dio_fifo_resync)( +struct dccg *dccg); + void (*dpp_root_clock_control)( struct dccg *dccg, unsigned int dpp_inst,
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer_private.h +2 -0
@@ -160,6 +160,8 @@ struct hwseq_private_funcs {unsigned int *k1_div, unsigned int *k2_div);void (*set_pixels_per_cycle)(struct pipe_ctx *pipe_ctx); +void (*resync_fifo_dccg_dio)(struct dce_hwseq *hws,struct dc *dc, +struct dc_state *context);bool (*is_dp_dig_pixel_rate_div_policy)(struct pipe_ctx *pipe_ctx);#endif };
Signature · 1 line
2.25.1
PATCH 10/18 drm/amd/display: Revert vblank change that causes null pointer crash
In reply to Tom ChungFrom: Daniel Miess <[email protected]>
Revert commit 43e5893f10ff606e60d1494c41acc59f54efedb0 drm/amd/display: Fix possible underflow for displays with large vblank Because it cause some regression
--- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +12 -7
@@ -33,7 +33,7 @@#include "dml/display_mode_vba.h" struct _vcs_dpi_ip_params_st dcn3_14_ip = { - .VBlankNomDefaultUS =800 , + .VBlankNomDefaultUS =668 , .gpuvm_enable =1 , .gpuvm_max_page_table_levels =1 , .hostvm_enable =1 ,
@@ -286,7 +286,7 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *cstruct resource_context *res_ctx = &context->res_ctx;struct pipe_ctx *pipe;bool upscaled = false; -const unsigned int max_allowed_vblank_nom =1023 ; +bool isFreesyncVideo = false;dc_assert_fp_enabled ();
@@ -300,11 +300,16 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *c pipe = &res_ctx->pipe_ctx[i]; timing = &pipe->stream->timing; - pipes[pipe_cnt].pipe.dest.vtotal = pipe->stream->adjust.v_total_min; - pipes[pipe_cnt].pipe.dest.vblank_nom = timing->v_total - pipes[pipe_cnt].pipe.dest.vactive; - pipes[pipe_cnt].pipe.dest.vblank_nom =min (pipes[pipe_cnt].pipe.dest.vblank_nom, dcn3_14_ip.VBlankNomDefaultUS); - pipes[pipe_cnt].pipe.dest.vblank_nom =max (pipes[pipe_cnt].pipe.dest.vblank_nom, timing->v_sync_width); - pipes[pipe_cnt].pipe.dest.vblank_nom =min (pipes[pipe_cnt].pipe.dest.vblank_nom, max_allowed_vblank_nom); + isFreesyncVideo = pipe->stream->adjust.v_total_max == pipe->stream->adjust.v_total_min; + isFreesyncVideo = isFreesyncVideo && pipe->stream->adjust.v_total_min > timing->v_total; + +if (!isFreesyncVideo) { + pipes[pipe_cnt].pipe.dest.vblank_nom = + dcn3_14_ip.VBlankNomDefaultUS / (timing->h_total / (timing->pix_clk_100hz /10000.0 )); + }else { + pipes[pipe_cnt].pipe.dest.vtotal = pipe->stream->adjust.v_total_min; + pipes[pipe_cnt].pipe.dest.vblank_nom = timing->v_total - pipes[pipe_cnt].pipe.dest.vactive; + } if (pipe->plane_state && (pipe->plane_state->src_rect.height < pipe->plane_state->dst_rect.height ||
Signature · 1 line
2.25.1
PATCH 11/18 drm/amd/display: Fix possible underflow for displays with large vblank
In reply to Tom ChungFrom: Daniel Miess <[email protected]>
[Why]
Underflow observed when using a display with a large vblank region and low refresh rate
[How]
Simplify calculation of vblank_nom
Increase value for VBlankNomDefaultUS to 800us
Fixed a null pointer from previous commit of this change
--- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +7 -12
@@ -33,7 +33,7 @@#include "dml/display_mode_vba.h" struct _vcs_dpi_ip_params_st dcn3_14_ip = { - .VBlankNomDefaultUS =668 , + .VBlankNomDefaultUS =800 , .gpuvm_enable =1 , .gpuvm_max_page_table_levels =1 , .hostvm_enable =1 ,
@@ -286,7 +286,7 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *cstruct resource_context *res_ctx = &context->res_ctx;struct pipe_ctx *pipe;bool upscaled = false; -bool isFreesyncVideo = false; +const unsigned int max_allowed_vblank_nom =1023 ;dc_assert_fp_enabled ();
@@ -300,16 +300,11 @@ int dcn314_populate_dml_pipes_from_context_fpu(struct dc *dc, struct dc_state *c pipe = &res_ctx->pipe_ctx[i]; timing = &pipe->stream->timing; - isFreesyncVideo = pipe->stream->adjust.v_total_max == pipe->stream->adjust.v_total_min; - isFreesyncVideo = isFreesyncVideo && pipe->stream->adjust.v_total_min > timing->v_total; - -if (!isFreesyncVideo) { - pipes[pipe_cnt].pipe.dest.vblank_nom = - dcn3_14_ip.VBlankNomDefaultUS / (timing->h_total / (timing->pix_clk_100hz /10000.0 )); - }else { - pipes[pipe_cnt].pipe.dest.vtotal = pipe->stream->adjust.v_total_min; - pipes[pipe_cnt].pipe.dest.vblank_nom = timing->v_total - pipes[pipe_cnt].pipe.dest.vactive; - } + pipes[pipe_cnt].pipe.dest.vtotal = pipe->stream->adjust.v_total_min; + pipes[pipe_cnt].pipe.dest.vblank_nom = timing->v_total - pipes[pipe_cnt].pipe.dest.vactive; + pipes[pipe_cnt].pipe.dest.vblank_nom =min (pipes[pipe_cnt].pipe.dest.vblank_nom, dcn3_14_ip.VBlankNomDefaultUS); + pipes[pipe_cnt].pipe.dest.vblank_nom =max (pipes[pipe_cnt].pipe.dest.vblank_nom, timing->v_sync_width); + pipes[pipe_cnt].pipe.dest.vblank_nom =min (pipes[pipe_cnt].pipe.dest.vblank_nom, max_allowed_vblank_nom); if (pipe->plane_state && (pipe->plane_state->src_rect.height < pipe->plane_state->dst_rect.height ||
Signature · 1 line
2.25.1
PATCH 12/18 drm/amd/display: Apply 60us prefetch for DCFCLK <= 300Mhz
In reply to Tom ChungFrom: Alvin Lee <[email protected]>
[Description]
- Previously we wanted to apply extra 60us of prefetch for min DCFCLK (200Mhz), but DCFCLK can be calculated to be 201Mhz which underflows also without the extra prefetch
- Instead, apply the the extra 60us prefetch for any DCFCLK freq <= 300Mhz
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 4 ++-- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +2 -2
@@ -811,7 +811,7 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerforman v->SwathHeightC[k], TWait, (v->DRAMSpeedPerState[mode_lib->vba.VoltageLevel] <=MEM_STROBE_FREQ_MHZ || - v->DCFCLKPerState[mode_lib->vba.VoltageLevel] <=MIN_DCFCLK_FREQ_MHZ ) ? + v->DCFCLKPerState[mode_lib->vba.VoltageLevel] <=DCFCLK_FREQ_EXTRA_PREFETCH_REQ_MHZ ) ? mode_lib->vba.ip.min_prefetch_in_strobe_us :0 ,/* Output */ &v->DSTXAfterScaler[k],
@@ -3315,7 +3315,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l v->swath_width_chroma_ub_this_state[k], v->SwathHeightYThisState[k], v->SwathHeightCThisState[k], v->TWait, - (v->DRAMSpeedPerState[i] <=MEM_STROBE_FREQ_MHZ || v->DCFCLKState[i][j] <=MIN_DCFCLK_FREQ_MHZ ) ? + (v->DRAMSpeedPerState[i] <=MEM_STROBE_FREQ_MHZ || v->DCFCLKState[i][j] <=DCFCLK_FREQ_EXTRA_PREFETCH_REQ_MHZ ) ? mode_lib->vba.ip.min_prefetch_in_strobe_us : 0,/* Output */
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.h +1 -1
@@ -53,7 +53,7 @@#define BPP_BLENDED_PIPE 0xffffffff#define MEM_STROBE_FREQ_MHZ 1600 -#define MIN_DCFCLK_FREQ_MHZ 200 +#define DCFCLK_FREQ_EXTRA_PREFETCH_REQ_MHZ 300#define MEM_STROBE_MAX_DELIVERY_TIME_US 60.0struct display_mode_lib ;
Signature · 1 line
2.25.1
PATCH 13/18 drm/amd/display: Clean FPGA code in dc
In reply to Tom ChungFrom: Qingqing Zhuo <[email protected]>
[Why]
Drop dead code for Linux.
[How]
Remove all IS_FPGA_MAXIMUS_DC and IS_DIAG_DC
--- .../dc/clk_mgr/dce112/dce112_clk_mgr.c | 8 +- .../dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c | 2 - .../display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c | 22 +++--- .../dc/clk_mgr/dcn201/dcn201_clk_mgr.c | 6 -- .../amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c | 13 +--- .../dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c | 5 -- .../display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c | 10 +-- .../display/dc/clk_mgr/dcn301/vg_clk_mgr.c | 18 +---- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 10 +-- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 10 +-- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 10 +-- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 11 +-- .../display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c | 1 - drivers/gpu/drm/amd/display/dc/core/dc.c | 2 - .../gpu/drm/amd/display/dc/core/dc_stream.c | 30 -------- drivers/gpu/drm/amd/display/dc/dc_helper.c | 4 +- drivers/gpu/drm/amd/display/dc/dc_types.h | 7 -- .../drm/amd/display/dc/dce/dce_clock_source.c | 38 ---------- drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c | 2 - .../display/dc/dce110/dce110_hw_sequencer.c | 3 - .../display/dc/dce112/dce112_hw_sequencer.c | 3 - .../display/dc/dce120/dce120_hw_sequencer.c | 3 - .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 36 +-------- .../gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 2 - .../drm/amd/display/dc/dcn10/dcn10_resource.c | 5 +- .../drm/amd/display/dc/dcn20/dcn20_hwseq.c | 5 -- .../gpu/drm/amd/display/dc/dcn20/dcn20_init.c | 4 - .../gpu/drm/amd/display/dc/dcn20/dcn20_optc.c | 1 - .../drm/amd/display/dc/dcn20/dcn20_resource.c | 15 +--- .../drm/amd/display/dc/dcn201/dcn201_hwseq.c | 20 +---- .../drm/amd/display/dc/dcn201/dcn201_optc.c | 1 - .../amd/display/dc/dcn201/dcn201_resource.c | 5 +- .../gpu/drm/amd/display/dc/dcn21/dcn21_init.c | 4 - .../drm/amd/display/dc/dcn21/dcn21_resource.c | 10 +-- .../drm/amd/display/dc/dcn30/dcn30_hwseq.c | 28 ------- .../gpu/drm/amd/display/dc/dcn30/dcn30_init.c | 4 - .../gpu/drm/amd/display/dc/dcn30/dcn30_optc.c | 1 - .../drm/amd/display/dc/dcn30/dcn30_resource.c | 8 +- .../amd/display/dc/dcn301/dcn301_resource.c | 10 +-- .../amd/display/dc/dcn302/dcn302_resource.c | 5 +- .../amd/display/dc/dcn303/dcn303_resource.c | 5 +- .../drm/amd/display/dc/dcn31/dcn31_hwseq.c | 31 +------- .../gpu/drm/amd/display/dc/dcn31/dcn31_init.c | 4 - .../drm/amd/display/dc/dcn31/dcn31_resource.c | 17 +---- .../drm/amd/display/dc/dcn314/dcn314_init.c | 4 - .../amd/display/dc/dcn314/dcn314_resource.c | 10 +-- .../amd/display/dc/dcn315/dcn315_resource.c | 17 +---- .../amd/display/dc/dcn316/dcn316_resource.c | 17 +---- .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 4 - .../drm/amd/display/dc/dcn32/dcn32_resource.c | 11 +-- .../amd/display/dc/dcn321/dcn321_resource.c | 11 +-- .../amd/display/dc/dml/dcn301/dcn301_fpu.c | 2 - .../drm/amd/display/dc/dml/dcn31/dcn31_fpu.c | 17 +---- .../dc/dml/dcn31/display_rq_dlg_calc_31.c | 8 -- .../amd/display/dc/dml/dcn314/dcn314_fpu.c | 6 +- .../dc/dml/dcn314/display_rq_dlg_calc_314.c | 8 -- .../drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 4 +- .../amd/display/dc/dml/dcn321/dcn321_fpu.c | 4 - .../drm/amd/display/dc/dml/display_mode_lib.c | 1 - .../drm/amd/display/dc/dml/display_mode_lib.h | 1 - .../display/dc/link/hwss/link_hwss_hpo_dp.c | 73 ------------------- .../gpu/drm/amd/display/dc/link/link_dpms.c | 35 +++------ .../dc/link/protocols/link_dp_capability.c | 3 +- 63 files changed, 78 insertions(+), 597 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dce112/dce112_clk_mgr.c +2 -6
@@ -111,13 +111,11 @@ int dce112_set_clock(struct clk_mgr *clk_mgr_base, int requested_clk_khz) bp->funcs->set_dce_clock (bp, &dce_clk_params); -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr_dce->dfs_bypass_disp_clk != actual_clock) dmcu->funcs->set_psr_wait_loop (dmcu, actual_clock /1000 /7 ); } - } clk_mgr_dce->dfs_bypass_disp_clk = actual_clock;return actual_clock;
@@ -149,17 +147,15 @@ int dce112_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_clk_khz)* from power down, we need mark the clock state as ClocksStateNominal * from HWReset, so when resume we will call pplib voltage regulator. */ -if (requested_clk_khz ==0 ) +if (requested_clk_khz ==0 ) { clk_mgr->cur_min_clks_state =DM_PP_CLOCKS_STATE_NOMINAL ; + } - -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr->dfs_bypass_disp_clk != actual_clock) dmcu->funcs->set_psr_wait_loop (dmcu, actual_clock /1000 /7 ); } - } clk_mgr->dfs_bypass_disp_clk = actual_clock;return actual_clock;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn10/rv1_clk_mgr_vbios_smu.c +0 -2
@@ -135,13 +135,11 @@ int rv1_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_di VBIOSSMC_MSG_SetDispclkFreq, khz_to_mhz_ceil(requested_dispclk_khz)); -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr->dfs_bypass_disp_clk != actual_dispclk_set_mhz) dmcu->funcs->set_psr_wait_loop (dmcu, actual_dispclk_set_mhz /7 ); } - }return actual_dispclk_set_mhz *1000 ; }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn20/dcn20_clk_mgr.c +9 -13
@@ -531,6 +531,11 @@ void dcn20_clk_mgr_construct(struct pp_smu_funcs *pp_smu, struct dccg *dccg) { + int dprefclk_did; +int target_div; +uint32_t pll_req_reg; +struct fixed31_32 pll_req; + clk_mgr->base.ctx = ctx; clk_mgr->pp_smu = pp_smu; clk_mgr->base.funcs = &dcn2_funcs;
@@ -547,19 +552,12 @@ void dcn20_clk_mgr_construct( clk_mgr->base.dprefclk_khz =700000 ;// 700 MHz planned if VCO is 3.85 GHz, will be retrieved -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - dcn2_funcs.update_clocks = dcn2_update_clocks_fpga; - clk_mgr->base.dentist_vco_freq_khz =3850000 ; - - }else {/* DFS Slice 2 should be used for DPREFCLK */ -int dprefclk_did =REG_READ (CLK3_CLK2_DFS_CNTL ); -/* Convert DPREFCLK DFS Slice DID to actual divider*/ -int target_div =dentist_get_divider_from_did (dprefclk_did); - + dprefclk_did =REG_READ (CLK3_CLK2_DFS_CNTL ); +/* Convert DPREFCLK DFS Slice DID to actual divider */ + target_div =dentist_get_divider_from_did (dprefclk_did);/* get FbMult value */ -uint32_t pll_req_reg =REG_READ (CLK3_CLK_PLL_REQ ); -struct fixed31_32 pll_req; + pll_req_reg =REG_READ (CLK3_CLK_PLL_REQ );/* set up a fixed-point number * this works because the int part is on the right edge of the register
@@ -582,7 +580,6 @@ void dcn20_clk_mgr_construct(/* Calculate the DPREFCLK in kHz.*/ clk_mgr->base.dprefclk_khz = (DENTIST_DIVIDER_RANGE_SCALE_FACTOR * clk_mgr->base.dentist_vco_freq_khz) / target_div; - }//Integrated_info table does not exist on dGPU projects so should not be referenced //anywhere in code for dGPUs. //Also there is no plan for now that DFS BYPASS will be used on NV10/12/14.
@@ -590,4 +587,3 @@ void dcn20_clk_mgr_construct(dce_clock_read_ss_info (clk_mgr); } -
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn201/dcn201_clk_mgr.c +0 -6
@@ -190,11 +190,6 @@ void dcn201_clk_mgr_construct(struct dc_context *ctx, clk_mgr->dprefclk_ss_divider =1000 ; clk_mgr->ss_on_dprefclk = false; -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - dcn201_funcs.update_clocks = dcn2_update_clocks_fpga; - clk_mgr->base.dprefclk_khz =600000 ; - clk_mgr->base.dentist_vco_freq_khz =3000000 ; - }else { clk_mgr->base.dprefclk_khz =REG_READ (CLK4_CLK2_CURRENT_CNT ); clk_mgr->base.dprefclk_khz *=100 ;
@@ -206,7 +201,6 @@ void dcn201_clk_mgr_construct(struct dc_context *ctx,if (clk_mgr->base.dentist_vco_freq_khz ==0 ) clk_mgr->base.dentist_vco_freq_khz =3000000 ; - }if (!debug->disable_dfs_bypass && bp->integrated_info)if (bp->integrated_info->gpu_cap_info &DFS_BYPASS_ENABLE )
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr.c +3 -10
@@ -705,6 +705,7 @@ void rn_clk_mgr_construct(struct dpm_clocks clock_table = {0 };enum pp_smu_status status =0 ;int is_green_sardine =0 ; +struct clk_log_info log_info = {0 };#if defined(CONFIG_DRM_AMD_DC_FP ) is_green_sardine =ASICREV_IS_GREEN_SARDINE (ctx->asic_id.hw_internal_rev);
@@ -725,12 +726,6 @@ void rn_clk_mgr_construct( clk_mgr->smu_ver =rn_vbios_smu_get_smu_version (clk_mgr); -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - dcn21_funcs.update_clocks = dcn2_update_clocks_fpga; - clk_mgr->base.dentist_vco_freq_khz =3600000 ; - }else { -struct clk_log_info log_info = {0 }; - clk_mgr->periodic_retraining_disabled =rn_vbios_smu_is_periodic_retraining_disabled (clk_mgr);/* SMU Version 55.51.0 and up no longer have an issue
@@ -766,7 +761,6 @@ void rn_clk_mgr_construct( }/* Saved clocks configured at boot for debug purposes */ rn_dump_clk_registers (&clk_mgr->base.boot_snapshot, &clk_mgr->base, &log_info); - } clk_mgr->base.dprefclk_khz =600000 ;dce_clock_read_ss_info (clk_mgr);
@@ -786,9 +780,8 @@ void rn_clk_mgr_construct( } } -if (!IS_FPGA_MAXIMUS_DC (ctx->dce_environment) && clk_mgr->smu_ver >=0x00371500 ) { -/* enable powerfeatures when displaycount goes to 0 */ +/* enable powerfeatures when displaycount goes to 0 */ +if (clk_mgr->smu_ver >=0x00371500 )rn_vbios_smu_enable_48mhz_tmdp_refclk_pwrdwn (clk_mgr, !debug->disable_48mhz_pwrdwn); - } }
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn21/rn_clk_mgr_vbios_smu.c +0 -5
@@ -147,16 +147,13 @@ int rn_vbios_smu_set_dispclk(struct clk_mgr_internal *clk_mgr, int requested_dis VBIOSSMC_MSG_SetDispclkFreq, khz_to_mhz_ceil(requested_dispclk_khz)); -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (dmcu && dmcu->funcs->is_dmcu_initialized (dmcu)) {if (clk_mgr->dfs_bypass_disp_clk != actual_dispclk_set_mhz) dmcu->funcs->set_psr_wait_loop (dmcu, actual_dispclk_set_mhz /7 ); } - }// pmfw always set clock more than or equal requested clock -if (!IS_DIAG_DC (dc->ctx->dce_environment))ASSERT (actual_dispclk_set_mhz >=khz_to_mhz_ceil (requested_dispclk_khz));return actual_dispclk_set_mhz *1000 ;
@@ -221,14 +218,12 @@ void rn_vbios_smu_set_phyclk(struct clk_mgr_internal *clk_mgr, int requested_phyint rn_vbios_smu_set_dppclk (struct clk_mgr_internal *clk_mgr,int requested_dpp_khz) {int actual_dppclk_set_mhz =-1 ; -struct dc *dc = clk_mgr->base.ctx->dc; actual_dppclk_set_mhz =rn_vbios_smu_send_msg_with_param ( clk_mgr, VBIOSSMC_MSG_SetDppclkFreq,khz_to_mhz_ceil (requested_dpp_khz)); -if (!IS_DIAG_DC (dc->ctx->dce_environment))ASSERT (actual_dppclk_set_mhz >=khz_to_mhz_ceil (requested_dpp_khz));return actual_dppclk_set_mhz *1000 ;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr.c +2 -8
@@ -521,6 +521,8 @@ void dcn3_clk_mgr_construct(struct pp_smu_funcs *pp_smu, struct dccg *dccg) { + struct clk_state_registers_and_bypass s = { 0 }; + clk_mgr->base.ctx = ctx; clk_mgr->base.funcs = &dcn3_funcs; clk_mgr->regs = &clk_mgr_regs;
@@ -537,13 +539,6 @@ void dcn3_clk_mgr_construct( clk_mgr->base.dprefclk_khz =730000 ;// 700 MHz planned if VCO is 3.85 GHz, will be retrieved -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - clk_mgr->base.funcs = &dcn3_fpga_funcs; - clk_mgr->base.dentist_vco_freq_khz =3650000 ; - - }else { -struct clk_state_registers_and_bypass s = {0 }; -/* integer part is now VCO frequency in kHz */ clk_mgr->base.dentist_vco_freq_khz =dcn30_get_vco_frequency_from_reg (clk_mgr);
@@ -557,7 +552,6 @@ void dcn3_clk_mgr_construct(//ASSERT(s.dprefclk != 0); if (s.dprefclk !=0 ) clk_mgr->base.dprefclk_khz = s.dprefclk *1000 ; - } clk_mgr->dfs_bypass_enabled = false;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn301/vg_clk_mgr.c +2 -16
@@ -117,7 +117,7 @@ static void vg_update_clocks(struct clk_mgr *clk_mgr_base, display_count =vg_get_active_display_cnt_wa (dc, context);/* if we can go lower, go lower */ -if (display_count ==0 && !IS_DIAG_DC (dc->ctx->dce_environment)) { +if (display_count ==0 ) {union display_idle_optimization_u idle_info = {0 }; idle_info.idle_info.df_request_disabled =1 ;
@@ -151,10 +151,8 @@ static void vg_update_clocks(struct clk_mgr *clk_mgr_base, }// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow. -if (!IS_DIAG_DC (dc->ctx->dce_environment)) {if (new_clocks->dppclk_khz <100000 ) new_clocks->dppclk_khz =100000 ; - }if (should_set_clock (safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
@@ -664,6 +662,7 @@ void vg_clk_mgr_construct( struct dccg *dccg) {struct smu_dpm_clks smu_dpm_clks = {0 }; +struct clk_log_info log_info = {0 }; clk_mgr->base.base.ctx = ctx; clk_mgr->base.base.funcs = &vg_funcs;
@@ -703,12 +702,6 @@ void vg_clk_mgr_construct(ASSERT (smu_dpm_clks.dpm_clks); -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - vg_funcs.update_clocks = dcn2_update_clocks_fpga; - clk_mgr->base.base.dentist_vco_freq_khz =3600000 ; - }else { -struct clk_log_info log_info = {0 }; - clk_mgr->base.smu_ver =dcn301_smu_get_smu_version (&clk_mgr->base);if (clk_mgr->base.smu_ver)
@@ -728,7 +721,6 @@ void vg_clk_mgr_construct( }/* Saved clocks configured at boot for debug purposes */ vg_dump_clk_registers (&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info); - } clk_mgr->base.base.dprefclk_khz =600000 ;dce_clock_read_ss_info (&clk_mgr->base);
@@ -746,12 +738,6 @@ void vg_clk_mgr_construct(if (smu_dpm_clks.dpm_clks && smu_dpm_clks.mc_address.quad_part !=0 )dm_helpers_free_gpu_mem (clk_mgr->base.base.ctx,DC_MEM_ALLOC_TYPE_FRAME_BUFFER , smu_dpm_clks.dpm_clks); -/* -if (!IS_FPGA_MAXIMUS_DC(ctx->dce_environment) && clk_mgr->base.smu_ver) { -enable powerfeatures when displaycount goes to 0 -dcn301_smu_enable_phy_refclk_pwrdwn(clk_mgr, !debug->disable_48mhz_pwrdwn); -} -*/ }void vg_clk_mgr_destroy (struct clk_mgr_internal *clk_mgr_int)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +1 -9
@@ -205,10 +205,8 @@ void dcn31_update_clocks(struct clk_mgr *clk_mgr_base, }// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow. -if (!IS_DIAG_DC (dc->ctx->dce_environment)) {if (new_clocks->dppclk_khz <100000 ) new_clocks->dppclk_khz =100000 ; - }if (should_set_clock (safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
@@ -672,6 +670,7 @@ void dcn31_clk_mgr_construct( struct dccg *dccg) {struct dcn31_smu_dpm_clks smu_dpm_clks = {0 }; +struct clk_log_info log_info = {0 }; clk_mgr->base.base.ctx = ctx; clk_mgr->base.base.funcs = &dcn31_funcs;
@@ -711,11 +710,6 @@ void dcn31_clk_mgr_construct(ASSERT (smu_dpm_clks.dpm_clks); -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - clk_mgr->base.base.funcs = &dcn3_fpga_funcs; - }else { -struct clk_log_info log_info = {0 }; - clk_mgr->base.smu_ver =dcn31_smu_get_smu_version (&clk_mgr->base);if (clk_mgr->base.smu_ver)
@@ -733,8 +727,6 @@ void dcn31_clk_mgr_construct(dcn31_dump_clk_registers (&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info); - } - clk_mgr->base.base.dprefclk_khz =600000 ; clk_mgr->base.base.clks.ref_dtbclk_khz =600000 ;dce_clock_read_ss_info (&clk_mgr->base);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +1 -9
@@ -241,10 +241,8 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base, }// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow. -if (!IS_DIAG_DC (dc->ctx->dce_environment)) {if (new_clocks->dppclk_khz <100000 ) new_clocks->dppclk_khz =100000 ; - }if (should_set_clock (safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
@@ -724,6 +722,7 @@ void dcn314_clk_mgr_construct( struct dccg *dccg) {struct dcn314_smu_dpm_clks smu_dpm_clks = {0 }; +struct clk_log_info log_info = {0 }; clk_mgr->base.base.ctx = ctx; clk_mgr->base.base.funcs = &dcn314_funcs;
@@ -763,11 +762,6 @@ void dcn314_clk_mgr_construct(ASSERT (smu_dpm_clks.dpm_clks); -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - clk_mgr->base.base.funcs = &dcn3_fpga_funcs; - }else { -struct clk_log_info log_info = {0 }; - clk_mgr->base.smu_ver =dcn314_smu_get_smu_version (&clk_mgr->base);if (clk_mgr->base.smu_ver)
@@ -785,8 +779,6 @@ void dcn314_clk_mgr_construct(dcn314_dump_clk_registers (&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info); - } - clk_mgr->base.base.dprefclk_khz =600000 ; clk_mgr->base.base.clks.ref_dtbclk_khz =600000 ;dce_clock_read_ss_info (&clk_mgr->base);
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +1 -9
@@ -184,12 +184,10 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, }// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow. -if (!IS_DIAG_DC (dc->ctx->dce_environment)) {if (new_clocks->dppclk_khz <MIN_DPP_DISP_CLK ) new_clocks->dppclk_khz =MIN_DPP_DISP_CLK ;if (new_clocks->dispclk_khz <MIN_DPP_DISP_CLK ) new_clocks->dispclk_khz =MIN_DPP_DISP_CLK ; - }if (should_set_clock (safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
@@ -600,6 +598,7 @@ void dcn315_clk_mgr_construct( struct dccg *dccg) {struct dcn315_smu_dpm_clks smu_dpm_clks = {0 }; +struct clk_log_info log_info = {0 }; clk_mgr->base.base.ctx = ctx; clk_mgr->base.base.funcs = &dcn315_funcs;
@@ -639,11 +638,6 @@ void dcn315_clk_mgr_construct(ASSERT (smu_dpm_clks.dpm_clks); -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - clk_mgr->base.base.funcs = &dcn3_fpga_funcs; - }else { -struct clk_log_info log_info = {0 }; - clk_mgr->base.smu_ver =dcn315_smu_get_smu_version (&clk_mgr->base);if (clk_mgr->base.smu_ver >0 )
@@ -658,8 +652,6 @@ void dcn315_clk_mgr_construct(dcn315_dump_clk_registers (&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info); - } - clk_mgr->base.base.dprefclk_khz =600000 ; clk_mgr->base.base.dprefclk_khz =dcn315_smu_get_dpref_clk (&clk_mgr->base); clk_mgr->base.base.clks.ref_dtbclk_khz = clk_mgr->base.base.dprefclk_khz;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c +1 -10
@@ -207,12 +207,10 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base, }// workaround: Limit dppclk to 100Mhz to avoid lower eDP panel switch to plus 4K monitor underflow. -if (!IS_DIAG_DC (dc->ctx->dce_environment)) {if (new_clocks->dppclk_khz <100000 ) new_clocks->dppclk_khz =100000 ;if (new_clocks->dispclk_khz <100000 ) new_clocks->dispclk_khz =100000 ; - }if (should_set_clock (safe_to_lower, new_clocks->dppclk_khz, clk_mgr->base.clks.dppclk_khz)) {if (clk_mgr->base.clks.dppclk_khz > new_clocks->dppclk_khz)
@@ -616,6 +614,7 @@ void dcn316_clk_mgr_construct( struct dccg *dccg) {struct dcn316_smu_dpm_clks smu_dpm_clks = {0 }; +struct clk_log_info log_info = {0 }; clk_mgr->base.base.ctx = ctx; clk_mgr->base.base.funcs = &dcn316_funcs;
@@ -655,12 +654,6 @@ void dcn316_clk_mgr_construct(ASSERT (smu_dpm_clks.dpm_clks); -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { - clk_mgr->base.base.funcs = &dcn3_fpga_funcs; - clk_mgr->base.base.dentist_vco_freq_khz =2500000 ; - }else { -struct clk_log_info log_info = {0 }; - clk_mgr->base.smu_ver =dcn316_smu_get_smu_version (&clk_mgr->base);if (clk_mgr->base.smu_ver >0 )
@@ -683,8 +676,6 @@ void dcn316_clk_mgr_construct(dcn316_dump_clk_registers (&clk_mgr->base.base.boot_snapshot, &clk_mgr->base.base, &log_info); - } - clk_mgr->base.base.dprefclk_khz =600000 ; clk_mgr->base.base.dprefclk_khz =dcn316_smu_get_dpref_clk (&clk_mgr->base); clk_mgr->base.base.clks.ref_dtbclk_khz = clk_mgr->base.base.dprefclk_khz;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +0 -1
@@ -941,7 +941,6 @@ void dcn32_clk_mgr_construct( clk_mgr->base.clks.ref_dtbclk_khz =268750 ; } -/* integer part is now VCO frequency in kHz */ clk_mgr->base.dentist_vco_freq_khz =dcn32_get_vco_frequency_from_reg (clk_mgr);
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -2
@@ -3588,7 +3588,6 @@ static void commit_planes_for_stream(struct dc *dc, } } -if (!IS_DIAG_DC (dc->ctx->dce_environment)) {for (i =0 ; i < surface_count; i++) {struct dc_plane_state *plane_state = srf_updates[i].surface;/*set logical flag for lock/unlock use*/
@@ -3611,7 +3610,6 @@ static void commit_planes_for_stream(struct dc *dc, plane_state->flip_immediate = false; } } - }// Update Type FULL, Surface updates for (j =0 ; j < dc->res_pool->pipe_count; j++) {
drivers/gpu/drm/amd/display/dc/core/dc_stream.c +0 -30
@@ -490,25 +490,6 @@ bool dc_stream_add_writeback(struct dc *dc,struct dwbc *dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst]; dwb->otg_inst = stream_status->primary_otg_inst; } -if (IS_DIAG_DC (dc->ctx->dce_environment)) { -if (!dc->hwss.update_bandwidth (dc, dc->current_state)) { -dm_error ("DC: update_bandwidth failed!\n" ); -return false; - } - -/* enable writeback */ -if (dc->hwss.enable_writeback) { -struct dwbc *dwb = dc->res_pool->dwbc[wb_info->dwb_pipe_inst]; - -if (dwb->funcs->is_enabled (dwb)) { -/* writeback pipe already enabled, only need to update */ - dc->hwss.update_writeback (dc, wb_info, dc->current_state); - }else { -/* Enable writeback pipe from scratch*/ - dc->hwss.enable_writeback (dc, wb_info, dc->current_state); - } - } - }return true; }
@@ -553,17 +534,6 @@ bool dc_stream_remove_writeback(struct dc *dc, } stream->num_wb_info = j; -if (IS_DIAG_DC (dc->ctx->dce_environment)) { -/* recalculate and apply DML parameters */ -if (!dc->hwss.update_bandwidth (dc, dc->current_state)) { -dm_error ("DC: update_bandwidth failed!\n" ); -return false; - } - -/* disable writeback */ -if (dc->hwss.disable_writeback) - dc->hwss.disable_writeback (dc, dwb_pipe_inst); - }return true; }
drivers/gpu/drm/amd/display/dc/dc_helper.c +1 -3
@@ -464,8 +464,7 @@ void generic_reg_wait(const struct dc_context *ctx, field_value =get_reg_field_value_ex (reg_val, mask, shift);if (field_value == condition_value) { -if (i * delay_between_poll_us >1000 && - !IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) +if (i * delay_between_poll_us >1000 )DC_LOG_DC ("REG_WAIT taking a while: %dms in %s line:%d\n" , delay_between_poll_us * i /1000 , func_name, line);
@@ -477,7 +476,6 @@ void generic_reg_wait(const struct dc_context *ctx, delay_between_poll_us, time_out_num_tries, func_name, line); -if (!IS_FPGA_MAXIMUS_DC (ctx->dce_environment))BREAK_TO_DEBUGGER (); }
drivers/gpu/drm/amd/display/dc/dc_types.h +0 -7
@@ -69,13 +69,6 @@ enum dce_environment {DCE_ENV_VIRTUAL_HW }; -/* Note: use these macro definitions instead of direct comparison! */ -#define IS_FPGA_MAXIMUS_DC (dce_environment) \ - (dce_environment == DCE_ENV_FPGA_MAXIMUS) - -#define IS_DIAG_DC (dce_environment) \ - (IS_FPGA_MAXIMUS_DC(dce_environment) || (dce_environment == DCE_ENV_DIAG)) -struct dc_perf_trace {unsigned long read_count;unsigned long write_count;
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +0 -38
@@ -920,25 +920,6 @@ static bool dce112_program_pix_clk(struct dce110_clk_src *clk_src =TO_DCE110_CLK_SRC (clock_source);struct bp_pixel_clock_parameters bp_pc_params = {0 }; -if (IS_FPGA_MAXIMUS_DC (clock_source->ctx->dce_environment)) { -unsigned int inst = pix_clk_params->controller_id -CONTROLLER_ID_D0 ; -unsigned dp_dto_ref_100hz =7000000 ; -unsigned clock_100hz = pll_settings->actual_pix_clk_100hz; - -/* Set DTO values: phase = target clock, modulo = reference clock */ -REG_WRITE (PHASE [inst], clock_100hz); -REG_WRITE (MODULO [inst], dp_dto_ref_100hz); - -/* Enable DTO */ -if (clk_src->cs_mask->PIPE0_DTO_SRC_SEL) -REG_UPDATE_2 (PIXEL_RATE_CNTL [inst], -DP_DTO0_ENABLE ,1 , -PIPE0_DTO_SRC_SEL ,1 ); -else -REG_UPDATE (PIXEL_RATE_CNTL [inst], -DP_DTO0_ENABLE ,1 ); -return true; - }/* First disable SS * ATOMBIOS will enable by default SS on PLL for DP, * do not disable it here
@@ -1015,25 +996,6 @@ static bool dcn31_program_pix_clk(REG_UPDATE (PIXEL_RATE_CNTL [inst],DP_DTO0_ENABLE ,1 ); }else { -if (IS_FPGA_MAXIMUS_DC (clock_source->ctx->dce_environment)) { -unsigned int inst = pix_clk_params->controller_id -CONTROLLER_ID_D0 ; -unsigned dp_dto_ref_100hz =7000000 ; -unsigned clock_100hz = pll_settings->actual_pix_clk_100hz; - -/* Set DTO values: phase = target clock, modulo = reference clock */ -REG_WRITE (PHASE [inst], clock_100hz); -REG_WRITE (MODULO [inst], dp_dto_ref_100hz); - -/* Enable DTO */ -if (clk_src->cs_mask->PIPE0_DTO_SRC_SEL) -REG_UPDATE_2 (PIXEL_RATE_CNTL [inst], -DP_DTO0_ENABLE ,1 , -PIPE0_DTO_SRC_SEL ,1 ); -else -REG_UPDATE (PIXEL_RATE_CNTL [inst], -DP_DTO0_ENABLE ,1 ); -return true; - }if (clk_src->cs_mask->PIPE0_DTO_SRC_SEL) REG_UPDATE(PIXEL_RATE_CNTL[inst],
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c +0 -2
@@ -1093,11 +1093,9 @@ static void dcn21_dmcu_construct(dce_dmcu_construct (dmcu_dce, ctx, regs, dmcu_shift, dmcu_mask); -if (!IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) { psp_version =dm_read_reg (ctx, mmMP0_SMN_C2PMSG_58); dmcu_dce->base.auto_load_dmcu = ((psp_version &0x00FF00FF ) >0x00110029 ); dmcu_dce->base.psp_version = psp_version; - } } struct dmcu *dce_dmcu_create(
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +0 -3
@@ -209,9 +209,6 @@ static bool dce110_enable_display_power_gating(struct dc_context *ctx = dc->ctx;unsigned int underlay_idx = dc->res_pool->underlay_pipe_index; -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) -return true; -if (power_gating ==PIPE_GATING_CONTROL_INIT ) cntl =ASIC_PIPE_INIT ;else if (power_gating ==PIPE_GATING_CONTROL_ENABLE )
drivers/gpu/drm/amd/display/dc/dce112/dce112_hw_sequencer.c +0 -3
@@ -120,9 +120,6 @@ static bool dce112_enable_display_power_gating(enum bp_pipe_control_action cntl;struct dc_context *ctx = dc->ctx; -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) -return true; -if (power_gating ==PIPE_GATING_CONTROL_INIT ) cntl =ASIC_PIPE_INIT ;else if (power_gating ==PIPE_GATING_CONTROL_ENABLE )
drivers/gpu/drm/amd/display/dc/dce120/dce120_hw_sequencer.c +0 -3
@@ -159,9 +159,6 @@ static bool dce120_enable_display_power_gating(enum bp_pipe_control_action cntl;struct dc_context *ctx = dc->ctx; -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) -return true; -if (power_gating ==PIPE_GATING_CONTROL_INIT ) cntl =ASIC_PIPE_INIT ;else if (power_gating ==PIPE_GATING_CONTROL_ENABLE )
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +4 -32
@@ -1012,7 +1012,6 @@ static void dcn10_reset_back_end_for_pipe(return ; } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { link = pipe_ctx->stream->link;/* DPMS may already disable or */ /* dpms_off status is incorrect due to fastboot
@@ -1038,7 +1037,6 @@ static void dcn10_reset_back_end_for_pipe( pipe_ctx->stream_res.audio =NULL ; } } - }/* by upper caller loop, parent pipe: pipe0, will be reset last. * back end share by all pipes and will be disable only when disable
@@ -1499,28 +1497,6 @@ void dcn10_init_hw(struct dc *dc)if (dc->res_pool->dccg && dc->res_pool->dccg->funcs->dccg_init) dc->res_pool->dccg->funcs->dccg_init (res_pool->dccg); -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - -REG_WRITE (REFCLK_CNTL ,0 ); -REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_ENABLE ,1 ); -REG_WRITE (DIO_MEM_PWR_CTRL ,0 ); - -if (!dc->debug.disable_clock_gate) { -/* enable all DCN clock gating */ -REG_WRITE (DCCG_GATE_DISABLE_CNTL ,0 ); - -REG_WRITE (DCCG_GATE_DISABLE_CNTL2 ,0 ); - -REG_UPDATE (DCFCLK_CNTL ,DCFCLK_GATE_DIS ,0 ); - } - -//Enable ability to power gate / don't force power on permanently -if (hws->funcs.enable_power_gating_plane) - hws->funcs.enable_power_gating_plane (hws, true); - -return ; - } -if (!dcb->funcs->is_accelerated_mode (dcb)) hws->funcs.disable_vga (dc->hwseq);
@@ -1532,7 +1508,6 @@ void dcn10_init_hw(struct dc *dc) res_pool->ref_clocks.xtalin_clock_inKhz = dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency; -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (res_pool->dccg && res_pool->hubbub) { (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
@@ -1549,7 +1524,6 @@ void dcn10_init_hw(struct dc *dc) res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; } - } }else ASSERT_CRITICAL (false);
@@ -3067,10 +3041,10 @@ void dcn10_prepare_bandwidth(struct hubbub *hubbub = dc->res_pool->hubbub;int min_fclk_khz, min_dcfclk_khz, socclk_khz; -if (dc->debug.sanity_checks) +if (dc->debug.sanity_checks) { hws->funcs.verify_allow_pstate_change_high (dc); + } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (context->stream_count ==0 ) context->bw_ctx.bw.dcn.clk.phyclk_khz =0 ;
@@ -3078,7 +3052,6 @@ void dcn10_prepare_bandwidth( dc->clk_mgr, context, false); - } dc->wm_optimized_required = hubbub->funcs->program_watermarks(hubbub, &context->bw_ctx.bw.dcn.watermarks,
@@ -3107,10 +3080,10 @@ void dcn10_optimize_bandwidth(struct hubbub *hubbub = dc->res_pool->hubbub;int min_fclk_khz, min_dcfclk_khz, socclk_khz; -if (dc->debug.sanity_checks) +if (dc->debug.sanity_checks) { hws->funcs.verify_allow_pstate_change_high (dc); + } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (context->stream_count ==0 ) context->bw_ctx.bw.dcn.clk.phyclk_khz =0 ;
@@ -3118,7 +3091,6 @@ void dcn10_optimize_bandwidth( dc->clk_mgr, context, true); - } hubbub->funcs->program_watermarks(hubbub, &context->bw_ctx.bw.dcn.watermarks,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +0 -2
@@ -653,8 +653,6 @@ void optc1_lock(struct timing_generator *optc)REG_SET (OTG_MASTER_UPDATE_LOCK ,0 ,OTG_MASTER_UPDATE_LOCK ,1 ); -/* Should be fast, status does not update on maximus */ -if (optc->ctx->dce_environment !=DCE_ENV_FPGA_MAXIMUS )REG_WAIT (OTG_MASTER_UPDATE_LOCK ,UPDATE_LOCK_STATUS ,1 ,1 ,10 );
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c +2 -3
@@ -1651,9 +1651,8 @@ static bool dcn10_resource_construct( }if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto fail; + &res_create_funcs)) + goto fail;dcn10_hw_sequencer_construct (dc); dc->caps.max_planes = pool->base.pipe_count;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +0 -5
@@ -2480,7 +2480,6 @@ static void dcn20_reset_back_end_for_pipe(return ; } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {/* DPMS may already disable or */ /* dpms_off status is incorrect due to fastboot * feature. When system resume from S4 with second
@@ -2506,10 +2505,6 @@ static void dcn20_reset_back_end_for_pipe( pipe_ctx->stream_res.audio =NULL ; } } - } -else if (pipe_ctx->stream_res.dsc) { - dc->link_srv->set_dsc_enable (pipe_ctx, false); - }/* by upper caller loop, parent pipe: pipe0, will be reset last. * back end share by all pipes and will be disable only when disable
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_init.c +0 -4
@@ -145,8 +145,4 @@ void dcn20_hw_sequencer_construct(struct dc *dc) dc->hwss = dcn20_funcs; dc->hwseq->funcs = dcn20_private_funcs; -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - dc->hwss.init_hw = dcn20_fpga_init_hw; - dc->hwseq->funcs.init_pipes =NULL ; - } }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_optc.c +0 -1
@@ -391,7 +391,6 @@ void optc2_triplebuffer_lock(struct timing_generator *optc)REG_SET (OTG_MASTER_UPDATE_LOCK ,0 ,OTG_MASTER_UPDATE_LOCK ,1 ); -if (optc->ctx->dce_environment !=DCE_ENV_FPGA_MAXIMUS )REG_WAIT (OTG_MASTER_UPDATE_LOCK ,UPDATE_LOCK_STATUS ,1 ,1 ,10 );
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +4 -11
@@ -2488,15 +2488,9 @@ static bool dcn20_resource_construct( dc->caps.dp_hdmi21_pcon_support = true; -if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) { +if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; - }else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - pool->base.pipe_count =4 ; - pool->base.mpcc_count = pool->base.pipe_count; - dc->debug = debug_defaults_diags; - }else { - dc->debug = debug_defaults_diags; - } +//dcn2.0x dc->work_arounds.dedcn20_305_wa = true;
@@ -2734,9 +2728,8 @@ static bool dcn20_resource_construct( }if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;dcn20_hw_sequencer_construct (dc);
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_hwseq.c +2 -18
@@ -228,26 +228,16 @@ void dcn201_init_hw(struct dc *dc)if (res_pool->dccg->funcs->dccg_init) res_pool->dccg->funcs->dccg_init (res_pool->dccg); -if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks) +if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks) { dc->clk_mgr->funcs->init_clocks (dc->clk_mgr); + } -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { -REG_WRITE (RBBMIF_TIMEOUT_DIS ,0xFFFFFFFF ); -REG_WRITE (RBBMIF_TIMEOUT_DIS_2 ,0xFFFFFFFF ); - - hws->funcs.dccg_init (hws); - -REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_REFDIV ,2 ); -REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_ENABLE ,1 ); -REG_WRITE (REFCLK_CNTL ,0 ); - }else { hws->funcs.bios_golden_init (dc);if (dc->ctx->dc_bios->fw_info_valid) { res_pool->ref_clocks.xtalin_clock_inKhz = dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency; -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (res_pool->dccg && res_pool->hubbub) { (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg, dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency,
@@ -262,7 +252,6 @@ void dcn201_init_hw(struct dc *dc) res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; } - } }else ASSERT_CRITICAL (false);for (i =0 ; i < dc->link_count; i++) {
@@ -276,7 +265,6 @@ void dcn201_init_hw(struct dc *dc) }if (hws->fb_offset.quad_part ==0 )read_mmhub_vm_setup (hws); - }/* Blank pixel data with OPP DPG */ for (i =0 ; i < res_pool->timing_generator_count; i++) {
@@ -362,10 +350,6 @@ void dcn201_init_hw(struct dc *dc) tg->funcs->tg_init (tg); } -/* end of FPGA. Below if real ASIC */ -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) -return ; -for (i =0 ; i < res_pool->audio_count; i++) {struct audio *audio = res_pool->audios[i];
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_optc.c +0 -1
@@ -55,7 +55,6 @@ static void optc201_triplebuffer_lock(struct timing_generator *optc)REG_SET (OTG_MASTER_UPDATE_LOCK ,0 ,OTG_MASTER_UPDATE_LOCK ,1 ); -if (optc->ctx->dce_environment !=DCE_ENV_FPGA_MAXIMUS )REG_WAIT (OTG_MASTER_UPDATE_LOCK ,UPDATE_LOCK_STATUS ,1 ,1 ,10 );
drivers/gpu/drm/amd/display/dc/dcn201/dcn201_resource.c +2 -3
@@ -1272,9 +1272,8 @@ static bool dcn201_resource_construct( }if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;dcn201_hw_sequencer_construct (dc);
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_init.c +0 -4
@@ -151,8 +151,4 @@ void dcn21_hw_sequencer_construct(struct dc *dc) dc->hwss = dcn21_funcs; dc->hwseq->funcs = dcn21_private_funcs; -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - dc->hwss.init_hw = dcn20_fpga_init_hw; - dc->hwseq->funcs.init_pipes =NULL ; - } }
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +2 -8
@@ -1503,11 +1503,6 @@ static bool dcn21_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - pool->base.pipe_count =4 ; - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags;// Init the vm_helper if (dc->vm_helper)
@@ -1721,9 +1716,8 @@ static bool dcn21_resource_construct( }if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;dcn21_hw_sequencer_construct (dc);
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_hwseq.c +0 -28
@@ -330,10 +330,6 @@ void dcn30_enable_writeback(DC_LOG_DWB ("%s dwb_pipe_inst = %d, mpcc_inst = %d" ,\ __func__, wb_info->dwb_pipe_inst,\ wb_info->mpcc_inst); -if (IS_DIAG_DC (dc->ctx->dce_environment)) { -/*till diags switch to warmup interface*/ -dcn30_mmhubbub_warmup (dc,1 , wb_info); - }/* Update writeback pipe */ dcn30_set_writeback (dc, wb_info, context);
@@ -447,28 +443,6 @@ void dcn30_init_hw(struct dc *dc)if (res_pool->dccg->funcs->dccg_init) res_pool->dccg->funcs->dccg_init (res_pool->dccg); -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - -REG_WRITE (REFCLK_CNTL ,0 ); -REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_ENABLE ,1 ); -REG_WRITE (DIO_MEM_PWR_CTRL ,0 ); - -if (!dc->debug.disable_clock_gate) { -/* enable all DCN clock gating */ -REG_WRITE (DCCG_GATE_DISABLE_CNTL ,0 ); - -REG_WRITE (DCCG_GATE_DISABLE_CNTL2 ,0 ); - -REG_UPDATE (DCFCLK_CNTL ,DCFCLK_GATE_DIS ,0 ); - } - -//Enable ability to power gate / don't force power on permanently -if (hws->funcs.enable_power_gating_plane) - hws->funcs.enable_power_gating_plane (hws, true); - -return ; - } -if (!dcb->funcs->is_accelerated_mode (dcb)) { hws->funcs.bios_golden_init (dc); hws->funcs.disable_vga (dc->hwseq);
@@ -491,7 +465,6 @@ void dcn30_init_hw(struct dc *dc) res_pool->ref_clocks.xtalin_clock_inKhz = dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency; -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (res_pool->dccg && res_pool->hubbub) { (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
@@ -508,7 +481,6 @@ void dcn30_init_hw(struct dc *dc) res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; } - } }else ASSERT_CRITICAL (false);
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_init.c +0 -4
@@ -151,8 +151,4 @@ void dcn30_hw_sequencer_construct(struct dc *dc) dc->hwss = dcn30_funcs; dc->hwseq->funcs = dcn30_private_funcs; -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - dc->hwss.init_hw = dcn20_fpga_init_hw; - dc->hwseq->funcs.init_pipes =NULL ; - } }
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_optc.c +0 -1
@@ -55,7 +55,6 @@ void optc3_triplebuffer_lock(struct timing_generator *optc)REG_SET (OTG_MASTER_UPDATE_LOCK ,0 ,OTG_MASTER_UPDATE_LOCK ,1 ); -if (optc->ctx->dce_environment !=DCE_ENV_FPGA_MAXIMUS )REG_WAIT (OTG_MASTER_UPDATE_LOCK ,UPDATE_LOCK_STATUS ,1 ,1 ,10 );
drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c +2 -6
@@ -2376,10 +2376,7 @@ static bool dcn30_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags; +// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
@@ -2577,8 +2574,7 @@ static bool dcn30_resource_construct(/* Audio, Stream Encoders including DIG and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) + &res_create_funcs)) goto create_fail;/* HW Sequencer and Plane caps */
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +3 -7
@@ -1513,10 +1513,7 @@ static bool dcn301_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags; +// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
@@ -1710,9 +1707,8 @@ static bool dcn301_resource_construct(/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;/* HW Sequencer and Plane caps */ dcn301_hw_sequencer_construct (dc);
drivers/gpu/drm/amd/display/dc/dcn302/dcn302_resource.c +1 -4
@@ -1309,8 +1309,6 @@ static bool dcn302_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else - dc->debug = debug_defaults_diags;// Init the vm_helper if (dc->vm_helper)
@@ -1489,8 +1487,7 @@ static bool dcn302_resource_construct(/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, pool, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) + &res_create_funcs)) goto create_fail;/* HW Sequencer and Plane caps */
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c +1 -4
@@ -1232,8 +1232,6 @@ static bool dcn303_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else - dc->debug = debug_defaults_diags;// Init the vm_helper if (dc->vm_helper)
@@ -1400,8 +1398,7 @@ static bool dcn303_resource_construct(/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, pool, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) + &res_create_funcs)) goto create_fail;/* HW Sequencer and Plane caps */
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +2 -29
@@ -117,28 +117,6 @@ void dcn31_init_hw(struct dc *dc)if (dc->clk_mgr && dc->clk_mgr->funcs->init_clocks) dc->clk_mgr->funcs->init_clocks (dc->clk_mgr); -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - -REG_WRITE (REFCLK_CNTL ,0 ); -REG_UPDATE (DCHUBBUB_GLOBAL_TIMER_CNTL ,DCHUBBUB_GLOBAL_TIMER_ENABLE ,1 ); -REG_WRITE (DIO_MEM_PWR_CTRL ,0 ); - -if (!dc->debug.disable_clock_gate) { -/* enable all DCN clock gating */ -REG_WRITE (DCCG_GATE_DISABLE_CNTL ,0 ); - -REG_WRITE (DCCG_GATE_DISABLE_CNTL2 ,0 ); - -REG_UPDATE (DCFCLK_CNTL ,DCFCLK_GATE_DIS ,0 ); - } - -//Enable ability to power gate / don't force power on permanently -if (hws->funcs.enable_power_gating_plane) - hws->funcs.enable_power_gating_plane (hws, true); - -return ; - } -if (!dcb->funcs->is_accelerated_mode (dcb)) { hws->funcs.bios_golden_init (dc);if (hws->funcs.disable_vga)
@@ -154,7 +132,6 @@ void dcn31_init_hw(struct dc *dc) res_pool->ref_clocks.xtalin_clock_inKhz = dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency; -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {if (res_pool->dccg && res_pool->hubbub) { (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
@@ -171,7 +148,6 @@ void dcn31_init_hw(struct dc *dc) res_pool->ref_clocks.dchub_ref_clock_inKhz = res_pool->ref_clocks.xtalin_clock_inKhz; } - } }else ASSERT_CRITICAL (false);
@@ -549,11 +525,11 @@ static void dcn31_reset_back_end_for_pipe( pipe_ctx->stream_res.tg, &pipe_ctx->stream->timing); pipe_ctx->stream->link->phy_state.symclk_ref_cnts.otg =0 ; -if (pipe_ctx->stream_res.tg->funcs->set_drr) +if (pipe_ctx->stream_res.tg->funcs->set_drr) { pipe_ctx->stream_res.tg->funcs->set_drr ( pipe_ctx->stream_res.tg,NULL ); + } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { link = pipe_ctx->stream->link;/* DPMS may already disable or */ /* dpms_off status is incorrect due to fastboot
@@ -580,9 +556,6 @@ static void dcn31_reset_back_end_for_pipe( pipe_ctx->stream_res.audio =NULL ; } } - }else if (pipe_ctx->stream_res.dsc) { - dc->link_srv->set_dsc_enable (pipe_ctx, false); - } pipe_ctx->stream =NULL ; DC_LOG_DEBUG("Reset back end for pipe %d, tg:%d\n",
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c +0 -4
@@ -154,8 +154,4 @@ void dcn31_hw_sequencer_construct(struct dc *dc) dc->hwss = dcn31_funcs; dc->hwseq->funcs = dcn31_private_funcs; -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - dc->hwss.init_hw = dcn20_fpga_init_hw; - dc->hwseq->funcs.init_pipes =NULL ; - } }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c +3 -14
@@ -1341,13 +1341,6 @@ static struct dce_hwseq *dcn31_hwseq_create( hws->regs = &hwseq_reg; hws->shifts = &hwseq_shift; hws->masks = &hwseq_mask; -/* DCN3.1 FPGA Workaround -* Need to enable HPO DP Stream Encoder before setting OTG master enable. -* To do so, move calling function enable_stream_timing to only be done AFTER calling -* function core_link_enable_stream -*/ -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) - hws->wa.dp_hpo_and_otg_sequence = true; }return hws; }
@@ -1988,10 +1981,7 @@ static bool dcn31_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags; +// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
@@ -2195,9 +2185,8 @@ static bool dcn31_resource_construct(/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;/* HW Sequencer and Plane caps */ dcn31_hw_sequencer_construct (dc);
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c +0 -4
@@ -160,8 +160,4 @@ void dcn314_hw_sequencer_construct(struct dc *dc) dc->hwss = dcn314_funcs; dc->hwseq->funcs = dcn314_private_funcs; -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - dc->hwss.init_hw = dcn20_fpga_init_hw; - dc->hwseq->funcs.init_pipes =NULL ; - } }
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +1 -9
@@ -1375,13 +1375,6 @@ static struct dce_hwseq *dcn314_hwseq_create( hws->regs = &hwseq_reg; hws->shifts = &hwseq_shift; hws->masks = &hwseq_mask; -/* DCN3.1 FPGA Workaround -* Need to enable HPO DP Stream Encoder before setting OTG master enable. -* To do so, move calling function enable_stream_timing to only be done AFTER calling -* function core_link_enable_stream -*/ -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) - hws->wa.dp_hpo_and_otg_sequence = true; }return hws; }
@@ -2101,8 +2094,7 @@ static bool dcn314_resource_construct(/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) + &res_create_funcs)) goto create_fail;/* HW Sequencer and Plane caps */
drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.c +3 -14
@@ -1342,13 +1342,6 @@ static struct dce_hwseq *dcn31_hwseq_create( hws->regs = &hwseq_reg; hws->shifts = &hwseq_shift; hws->masks = &hwseq_mask; -/* DCN3.1 FPGA Workaround -* Need to enable HPO DP Stream Encoder before setting OTG master enable. -* To do so, move calling function enable_stream_timing to only be done AFTER calling -* function core_link_enable_stream -*/ -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) - hws->wa.dp_hpo_and_otg_sequence = true; }return hws; }
@@ -1947,10 +1940,7 @@ static bool dcn315_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags; +// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
@@ -2131,9 +2121,8 @@ static bool dcn315_resource_construct(/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;/* HW Sequencer and Plane caps */ dcn31_hw_sequencer_construct (dc);
drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.c +3 -14
@@ -1340,13 +1340,6 @@ static struct dce_hwseq *dcn31_hwseq_create( hws->regs = &hwseq_reg; hws->shifts = &hwseq_shift; hws->masks = &hwseq_mask; -/* DCN3.1 FPGA Workaround -* Need to enable HPO DP Stream Encoder before setting OTG master enable. -* To do so, move calling function enable_stream_timing to only be done AFTER calling -* function core_link_enable_stream -*/ -if (IS_FPGA_MAXIMUS_DC (ctx->dce_environment)) - hws->wa.dp_hpo_and_otg_sequence = true; }return hws; }
@@ -1844,10 +1837,7 @@ static bool dcn316_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags; +// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
@@ -2028,9 +2018,8 @@ static bool dcn316_resource_construct(/* Audio, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;/* HW Sequencer and Plane caps */ dcn31_hw_sequencer_construct (dc);
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +0 -4
@@ -161,8 +161,4 @@ void dcn32_hw_sequencer_init_functions(struct dc *dc) dc->hwss = dcn32_funcs; dc->hwseq->funcs = dcn32_private_funcs; -if (IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { - dc->hwss.init_hw = dcn20_fpga_init_hw; - dc->hwseq->funcs.init_pipes =NULL ; - } }
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +3 -8
@@ -2260,10 +2260,7 @@ static bool dcn32_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags; +// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
@@ -2319,7 +2316,6 @@ static bool dcn32_resource_construct( }/* DML */ -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_2_soc, &dcn3_2_ip,DML_PROJECT_DCN32 );/* IRQ Service */
@@ -2457,9 +2453,8 @@ static bool dcn32_resource_construct(/* Audio, HWSeq, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;/* HW Sequencer init functions and Plane caps */ dcn32_hw_sequencer_init_functions (dc);
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +3 -8
@@ -1801,10 +1801,7 @@ static bool dcn321_resource_construct(if (dc->ctx->dce_environment ==DCE_ENV_PRODUCTION_DRV ) dc->debug = debug_defaults_drv; -else if (dc->ctx->dce_environment ==DCE_ENV_FPGA_MAXIMUS ) { - dc->debug = debug_defaults_diags; - }else - dc->debug = debug_defaults_diags; +// Init the vm_helper if (dc->vm_helper)vm_helper_init (dc->vm_helper,16 );
@@ -1860,7 +1857,6 @@ static bool dcn321_resource_construct( }/* DML */ -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_21_soc, &dcn3_21_ip,DML_PROJECT_DCN32 );/* IRQ Service */
@@ -1993,9 +1989,8 @@ static bool dcn321_resource_construct(/* Audio, HWSeq, Stream Encoders including HPO and virtual, MPC 3D LUTs */ if (!resource_construct (num_virtual_links, dc, &pool->base, - (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) ? - &res_create_funcs : &res_create_maximus_funcs))) - goto create_fail; + &res_create_funcs)) + goto create_fail;/* HW Sequencer init functions and Plane caps */ dcn32_hw_sequencer_init_functions (dc);
drivers/gpu/drm/amd/display/dc/dml/dcn301/dcn301_fpu.c +0 -2
@@ -333,7 +333,6 @@ void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_parammemcpy (s, dcn3_01_soc.clock_limits,sizeof (dcn3_01_soc.clock_limits));/* Default clock levels are used for diags, which may lead to overclocking. */ -if (!IS_DIAG_DC (dc->ctx->dce_environment)) { dcn3_01_ip.max_num_otg = pool->base.res_cap->num_timing_generator; dcn3_01_ip.max_num_dpp = pool->base.pipe_count; dcn3_01_soc.num_chans = bw_params->num_channels;
@@ -372,7 +371,6 @@ void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn3_01_soc.clock_limits[dcn3_01_soc.num_states -1 ]; s[dcn3_01_soc.num_states].state = dcn3_01_soc.num_states; } - }memcpy (dcn3_01_soc.clock_limits, s,sizeof (dcn3_01_soc.clock_limits));
drivers/gpu/drm/amd/display/dc/dml/dcn31/dcn31_fpu.c +1 -16
@@ -582,6 +582,7 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_paramsstruct _vcs_dpi_voltage_scaling_st *s = dc->scratch.update_bw_bounding_box.clock_limits;struct clk_limit_table *clk_table = &bw_params->clk_table;unsigned int i, closest_clk_lvl; +int max_dispclk_mhz =0 , max_dppclk_mhz =0 ;int j;dc_assert_fp_enabled ();
@@ -589,9 +590,6 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_paramsmemcpy (s, dcn3_1_soc.clock_limits,sizeof (dcn3_1_soc.clock_limits));// Default clock levels are used for diags, which may lead to overclocking. -if (!IS_DIAG_DC (dc->ctx->dce_environment)) { -int max_dispclk_mhz =0 , max_dppclk_mhz =0 ; - dcn3_1_ip.max_num_otg = dc->res_pool->res_cap->num_timing_generator; dcn3_1_ip.max_num_dpp = dc->res_pool->pipe_count; dcn3_1_soc.num_chans = bw_params->num_channels;
@@ -642,7 +640,6 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_paramsif (clk_table->num_entries) { dcn3_1_soc.num_states = clk_table->num_entries; } - }memcpy (dcn3_1_soc.clock_limits, s,sizeof (dcn3_1_soc.clock_limits));
@@ -655,10 +652,7 @@ void dcn31_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_params dcn3_1_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000 ; } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_1_soc, &dcn3_1_ip,DML_PROJECT_DCN31 ); -else -dml_init_instance (&dc->dml, &dcn3_1_soc, &dcn3_1_ip,DML_PROJECT_DCN31_FPGA ); }void dcn315_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params)
@@ -719,10 +713,7 @@ void dcn315_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn3_15_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000 ; } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_15_soc, &dcn3_15_ip,DML_PROJECT_DCN315 ); -else -dml_init_instance (&dc->dml, &dcn3_15_soc, &dcn3_15_ip,DML_PROJECT_DCN31_FPGA ); }void dcn316_update_bw_bounding_box (struct dc *dc,struct clk_bw_params *bw_params)
@@ -738,8 +729,6 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_parammemcpy (s, dcn3_16_soc.clock_limits,sizeof (dcn3_16_soc.clock_limits));// Default clock levels are used for diags, which may lead to overclocking. -if (!IS_DIAG_DC (dc->ctx->dce_environment)) { - dcn3_16_ip.max_num_otg = dc->res_pool->res_cap->num_timing_generator; dcn3_16_ip.max_num_dpp = dc->res_pool->pipe_count; dcn3_16_soc.num_chans = bw_params->num_channels;
@@ -803,7 +792,6 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_paramif (clk_table->num_entries) { dcn3_16_soc.num_states = clk_table->num_entries; } - }memcpy (dcn3_16_soc.clock_limits, s,sizeof (dcn3_16_soc.clock_limits));
@@ -817,10 +805,7 @@ void dcn316_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param dcn3_16_soc.dram_clock_change_latency_us = dc->debug.dram_clock_change_latency_ns /1000 ; } -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_16_soc, &dcn3_16_ip,DML_PROJECT_DCN31 ); -else -dml_init_instance (&dc->dml, &dcn3_16_soc, &dcn3_16_ip,DML_PROJECT_DCN31_FPGA ); }int dcn_get_max_non_odm_pix_rate_100hz (struct _vcs_dpi_soc_bounding_box_st *soc)
drivers/gpu/drm/amd/display/dc/dml/dcn31/display_rq_dlg_calc_31.c +0 -8
@@ -1432,14 +1432,6 @@ static void dml_rq_dlg_get_dlg_params(dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_vm_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_vm_flip);dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_row_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_row_flip); -// hack for FPGA -if (mode_lib->project ==DML_PROJECT_DCN31_FPGA ) { -if (disp_dlg_regs->vratio_prefetch >= (unsigned int )dml_pow (2 ,22 )) { - disp_dlg_regs->vratio_prefetch = (unsigned int )dml_pow (2 ,22 ) -1 ; -dml_print ("vratio_prefetch exceed the max value, the register field is [21:0]\n" ); - } - } - disp_dlg_regs->refcyc_per_pte_group_vblank_l = (unsigned int ) (dst_y_per_row_vblank * (double ) htotal * ref_freq_to_pix_freq / (double ) dpte_groups_per_row_ub_l);ASSERT (disp_dlg_regs->refcyc_per_pte_group_vblank_l < (unsigned int )dml_pow (2 ,13 ));
drivers/gpu/drm/amd/display/dc/dml/dcn314/dcn314_fpu.c +1 -5
@@ -190,8 +190,7 @@ void dcn314_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pdc_assert_fp_enabled ();// Default clock levels are used for diags, which may lead to overclocking. -if (!IS_DIAG_DC (dc->ctx->dce_environment) && dc->config.use_default_clock_table == false) { - +if (dc->config.use_default_clock_table == false) { dcn3_14_ip.max_num_otg = dc->res_pool->res_cap->num_timing_generator; dcn3_14_ip.max_num_dpp = dc->res_pool->pipe_count;
@@ -267,10 +266,7 @@ void dcn314_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pdcn20_patch_bounding_box (dc, &dcn3_14_soc); -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment))dml_init_instance (&dc->dml, &dcn3_14_soc, &dcn3_14_ip,DML_PROJECT_DCN314 ); -else -dml_init_instance (&dc->dml, &dcn3_14_soc, &dcn3_14_ip,DML_PROJECT_DCN31_FPGA ); }static bool is_dual_plane (enum surface_pixel_format format)
drivers/gpu/drm/amd/display/dc/dml/dcn314/display_rq_dlg_calc_314.c +0 -8
@@ -1520,14 +1520,6 @@ static void dml_rq_dlg_get_dlg_params(dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_vm_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_vm_flip);dml_print ("DML_DLG: %s: disp_dlg_regs->dst_y_per_row_flip = 0x%x\n" , __func__, disp_dlg_regs->dst_y_per_row_flip); -// hack for FPGA -if (mode_lib->project ==DML_PROJECT_DCN31_FPGA ) { -if (disp_dlg_regs->vratio_prefetch >= (unsigned int )dml_pow (2 ,22 )) { - disp_dlg_regs->vratio_prefetch = (unsigned int )dml_pow (2 ,22 ) -1 ; -dml_print ("vratio_prefetch exceed the max value, the register field is [21:0]\n" ); - } - } - disp_dlg_regs->refcyc_per_pte_group_vblank_l = (unsigned int ) (dst_y_per_row_vblank * (double ) htotal * ref_freq_to_pix_freq / (double ) dpte_groups_per_row_ub_l);ASSERT (disp_dlg_regs->refcyc_per_pte_group_vblank_l < (unsigned int )dml_pow (2 ,13 ));
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -3
@@ -2530,7 +2530,6 @@ void dcn32_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pa {dc_assert_fp_enabled (); -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {/* Overrides from dc->config options */ dcn3_2_ip.clamp_min_dcfclk = dc->config.clamp_min_dcfclk;
@@ -2602,7 +2601,6 @@ void dcn32_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_paif (dc->ctx->dc_bios->vram_info.dram_channel_width_bytes) dcn3_2_soc.dram_channel_width_bytes = dc->ctx->dc_bios->vram_info.dram_channel_width_bytes; - }/* DML DSC delay factor workaround */ dcn3_2_ip.dsc_delay_factor_wa = dc->debug.dsc_delay_factor_wa_x1000 /1000.0 ;
@@ -2614,7 +2612,7 @@ void dcn32_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pa dc->dml.soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz /1000.0 ;/* Overrides Clock levelsfrom CLK Mgr table entries as reported by PM FW */ -if ((!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) && (bw_params->clk_table.entries[0 ].memclk_mhz)) { +if (bw_params->clk_table.entries[0 ].memclk_mhz) {if (dc->debug.use_legacy_soc_bb_mechanism) {unsigned int i =0 , j =0 , num_states =0 ;
drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c +0 -4
@@ -471,7 +471,6 @@ static void dcn321_get_optimal_dcfclk_fclk_for_uclk(unsigned int uclk_mts,void dcn321_update_bw_bounding_box_fpu (struct dc *dc,struct clk_bw_params *bw_params) {dc_assert_fp_enabled (); -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) {/* Overrides from dc->config options */ dcn3_21_ip.clamp_min_dcfclk = dc->config.clamp_min_dcfclk;
@@ -543,7 +542,6 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pif (dc->ctx->dc_bios->vram_info.dram_channel_width_bytes) dcn3_21_soc.dram_channel_width_bytes = dc->ctx->dc_bios->vram_info.dram_channel_width_bytes; - }/* DML DSC delay factor workaround */ dcn3_21_ip.dsc_delay_factor_wa = dc->debug.dsc_delay_factor_wa_x1000 /1000.0 ;
@@ -555,7 +553,6 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_p dc->dml.soc.dispclk_dppclk_vco_speed_mhz = dc->clk_mgr->dentist_vco_freq_khz /1000.0 ;/* Overrides Clock levelsfrom CLK Mgr table entries as reported by PM FW */ -if ((!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) && (bw_params->clk_table.entries[0 ].memclk_mhz)) {if (dc->debug.use_legacy_soc_bb_mechanism) {unsigned int i =0 , j =0 , num_states =0 ;
@@ -699,6 +696,5 @@ void dcn321_update_bw_bounding_box_fpu(struct dc *dc, struct clk_bw_params *bw_pdml_init_instance (&dc->dml, &dcn3_21_soc, &dcn3_21_ip,DML_PROJECT_DCN32 );if (dc->current_state)dml_init_instance (&dc->current_state->bw_ctx.dml, &dcn3_21_soc, &dcn3_21_ip,DML_PROJECT_DCN32 ); - } }
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.c +0 -1
@@ -113,7 +113,6 @@ void dml_init_instance(struct display_mode_lib *lib, lib->funcs = dml30_funcs;break ;case DML_PROJECT_DCN31 : -case DML_PROJECT_DCN31_FPGA :case DML_PROJECT_DCN315 : lib->funcs = dml31_funcs;break ;
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.h +0 -1
@@ -41,7 +41,6 @@ enum dml_project {DML_PROJECT_DCN30 ,DML_PROJECT_DCN31 ,DML_PROJECT_DCN315 , -DML_PROJECT_DCN31_FPGA ,DML_PROJECT_DCN314 , DML_PROJECT_DCN32, };
drivers/gpu/drm/amd/display/dc/link/hwss/link_hwss_hpo_dp.c +0 -73
104 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +10 -25
@@ -765,7 +765,7 @@ static bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable)struct dc_stream_state *stream = pipe_ctx->stream;bool result = false; -if (dc_is_virtual_signal (stream->signal) ||IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) +if (dc_is_virtual_signal (stream->signal)) result = true;else result =dm_helpers_dp_write_dsc_enable (dc->ctx, stream, enable);
@@ -778,7 +778,6 @@ static bool dp_set_dsc_on_rx(struct pipe_ctx *pipe_ctx, bool enable)void link_set_dsc_on_stream (struct pipe_ctx *pipe_ctx,bool enable) {struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc; -struct dc *dc = pipe_ctx->stream->ctx->dc;struct dc_stream_state *stream = pipe_ctx->stream;struct pipe_ctx *odm_pipe;int opp_cnt =1 ;
@@ -816,8 +815,7 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable) optc_dsc_mode = dsc_optc_cfg.is_pixel_format_444 ?OPTC_DSC_ENABLED_444 :OPTC_DSC_ENABLED_NATIVE_SUBSAMPLED ;/* Enable DSC in encoder */ -if (dc_is_dp_signal (stream->signal) && !IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment) - && !dp_is_128b_132b_signal (pipe_ctx)) { +if (dc_is_dp_signal (stream->signal) && !dp_is_128b_132b_signal (pipe_ctx)) {DC_LOG_DSC ("Setting stream encoder DSC config for engine %d:" , (int )pipe_ctx->stream_res.stream_enc->id);dsc_optc_config_log (dsc, &dsc_optc_cfg); pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config(pipe_ctx->stream_res.stream_enc,
@@ -843,19 +841,18 @@ void link_set_dsc_on_stream(struct pipe_ctx *pipe_ctx, bool enable)/* disable DSC in stream encoder */ if (dc_is_dp_signal (stream->signal)) { -if (dp_is_128b_132b_signal (pipe_ctx)) +if (dp_is_128b_132b_signal (pipe_ctx)) { pipe_ctx->stream_res.hpo_dp_stream_enc->funcs->dp_set_dsc_pps_info_packet ( pipe_ctx->stream_res.hpo_dp_stream_enc, false,NULL , true); -else if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { + } pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_config ( pipe_ctx->stream_res.stream_enc,OPTC_DSC_DISABLED ,0 ,0 ); pipe_ctx->stream_res.stream_enc->funcs->dp_set_dsc_pps_info_packet ( pipe_ctx->stream_res.stream_enc, false,NULL , true); - } }/* disable DSC block */
@@ -2271,9 +2268,8 @@ void link_set_dpms_off(struct pipe_ctx *pipe_ctx) } } -if (!IS_DIAG_DC (dc->ctx->dce_environment) && -dc_is_virtual_signal (pipe_ctx->stream->signal)) -return ; +if (dc_is_virtual_signal (pipe_ctx->stream->signal)) +return ;if (!pipe_ctx->stream->sink->edid_caps.panel_patch.skip_avmute) {if (dc_is_hdmi_signal (pipe_ctx->stream->signal))
@@ -2358,6 +2354,8 @@ void link_set_dpms_on(enum otg_out_mux_dest otg_out_dest =OUT_MUX_DIO ;struct vpg *vpg = pipe_ctx->stream_res.stream_enc->vpg;const struct link_hwss *link_hwss =get_link_hwss (link, &pipe_ctx->link_res); +bool apply_edp_fast_boot_optimization = + pipe_ctx->stream->apply_edp_fast_boot_optimization;ASSERT (is_master_pipe_for_link (link, pipe_ctx));
@@ -2375,9 +2373,8 @@ void link_set_dpms_on( } } -if (!IS_DIAG_DC (dc->ctx->dce_environment) && -dc_is_virtual_signal (pipe_ctx->stream->signal)) -return ; +if (dc_is_virtual_signal (pipe_ctx->stream->signal)) +return ; link_enc =link_enc_cfg_get_link_enc (link);ASSERT (link_enc);
@@ -2402,10 +2399,6 @@ void link_set_dpms_on( link_hwss->setup_stream_attribute (pipe_ctx); -if (!IS_FPGA_MAXIMUS_DC (dc->ctx->dce_environment)) { -bool apply_edp_fast_boot_optimization = - pipe_ctx->stream->apply_edp_fast_boot_optimization; - pipe_ctx->stream->apply_edp_fast_boot_optimization = false;// Enable VPG before building infoframe
@@ -2527,14 +2520,6 @@ void link_set_dpms_on( dc->hwss.enable_audio_stream (pipe_ctx); - }else {// if (IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) -if (dp_is_128b_132b_signal (pipe_ctx)) -dp_fpga_hpo_enable_link_and_stream (state, pipe_ctx); -if (dc_is_dp_signal (pipe_ctx->stream->signal) || -dc_is_virtual_signal (pipe_ctx->stream->signal)) -link_set_dsc_enable (pipe_ctx, true); - } -if (dc_is_hdmi_signal (pipe_ctx->stream->signal)) {set_avmute (pipe_ctx, false); }
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +1 -2
@@ -326,8 +326,7 @@ bool dp_is_fec_supported(const struct dc_link *link)return (dc_is_dp_signal (link->connector_signal) && link_enc && link_enc->features.fec_supported && - link->dpcd_caps.fec_cap.bits.FEC_CAPABLE && - !IS_FPGA_MAXIMUS_DC (link->ctx->dce_environment)); + link->dpcd_caps.fec_cap.bits.FEC_CAPABLE); }bool dp_should_enable_fec (const struct dc_link *link)
Signature · 1 line
2.25.1
PATCH 14/18 drm/amd/display: Update correct DCN314 register header
In reply to Tom ChungFrom: Cruise Hung <[email protected]>
[Why]
The register header for DCN314 is not correct.
[How]
Update correct DCN314 register header.
--- drivers/gpu/drm/amd/display/dmub/src/Makefile | 2 +- .../drm/amd/display/dmub/src/dmub_dcn314.c | 62 +++++++++++++++++++ .../drm/amd/display/dmub/src/dmub_dcn314.h | 33 ++++++++++ .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 5 +- 4 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c create mode 100644 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h
drivers/gpu/drm/amd/display/dmub/src/Makefile +1 -1
@@ -22,7 +22,7 @@ DMUB = dmub_srv.o dmub_srv_stat.o dmub_reg.o dmub_dcn20.o dmub_dcn21.o DMUB += dmub_dcn30.o dmub_dcn301.o dmub_dcn302.o dmub_dcn303.o -DMUB += dmub_dcn31.o dmub_dcn315.o dmub_dcn316.o +DMUB += dmub_dcn31.o dmub_dcn314.o dmub_dcn315.o dmub_dcn316.o DMUB += dmub_dcn32.o AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB))
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.c new file +62 -0
62 lines not on this page · raw message
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn314.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* Copyright 2021 Advanced Micro Devices, Inc. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR +* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Authors: AMD +* +*/ + +#ifndef _DMUB_DCN314_H_ +#define _DMUB_DCN314_H_ + +#include "dmub_dcn31.h" + +extern const struct dmub_srv_dcn31_regs dmub_srv_dcn314_regs; + +#endif /* _DMUB_DCN314_H_ */
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +4 -1
@@ -32,6 +32,7 @@#include "dmub_dcn302.h" #include "dmub_dcn303.h" #include "dmub_dcn31.h" +#include "dmub_dcn314.h" #include "dmub_dcn315.h" #include "dmub_dcn316.h" #include "dmub_dcn32.h"
@@ -225,7 +226,9 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)case DMUB_ASIC_DCN314 :case DMUB_ASIC_DCN315 :case DMUB_ASIC_DCN316 : -if (asic ==DMUB_ASIC_DCN315 ) +if (asic ==DMUB_ASIC_DCN314 ) + dmub->regs_dcn31 = &dmub_srv_dcn314_regs; +else if (asic ==DMUB_ASIC_DCN315 ) dmub->regs_dcn31 = &dmub_srv_dcn315_regs;else if (asic ==DMUB_ASIC_DCN316 ) dmub->regs_dcn31 = &dmub_srv_dcn316_regs;
Signature · 1 line
2.25.1
PATCH 15/18 drm/amd/display: Trigger DIO FIFO resync on commit streams for DCN32
In reply to Tom ChungFrom: Saaem Rizvi <[email protected]>
[WHY and HOW]
Currently, on DCN32 we have an old workaround to resolve a DIO FIFO speed issue when writing to the OTG DIVIDER register. However, this workaround is not safe as we should be applying the DIO FIFO rampup logic when the OTG re disabled along with the encoders. This new workaround accounts for this. If the workaround sequence is incorrect, like it is was, there is a chance we might hang.
--- .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c | 21 ++++----------- .../gpu/drm/amd/display/dc/dcn32/dcn32_dccg.h | 5 ++-- .../drm/amd/display/dc/dcn32/dcn32_hwseq.c | 27 +++++++++++++++++++ .../drm/amd/display/dc/dcn32/dcn32_hwseq.h | 2 ++ .../gpu/drm/amd/display/dc/dcn32/dcn32_init.c | 1 + 5 files changed, 38 insertions(+), 18 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +5 -16
@@ -42,18 +42,14 @@#define DC_LOGGER \ dccg->ctx->logger -/* This function is a workaround for writing to OTG_PIXEL_RATE_DIV -* without the probability of causing a DIG FIFO error. -*/ -static void dccg32_wait_for_dentist_change_done ( +static void dccg32_trigger_dio_fifo_resync (struct dccg *dccg) {struct dcn_dccg *dccg_dcn =TO_DCN_DCCG (dccg); +uint32_t dispclk_rdivider_value =0 ; -uint32_t dentist_dispclk_value =REG_READ (DENTIST_DISPCLK_CNTL ); - -REG_WRITE (DENTIST_DISPCLK_CNTL , dentist_dispclk_value); -REG_WAIT (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_CHG_DONE ,1 ,50 ,2000 ); +REG_GET (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_RDIVIDER , &dispclk_rdivider_value); +REG_UPDATE (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_WDIVIDER , dispclk_rdivider_value); } static void dccg32_get_pixel_rate_div(
@@ -124,29 +120,21 @@ static void dccg32_set_pixel_rate_div(REG_UPDATE_2 (OTG_PIXEL_RATE_DIV ,OTG0_PIXEL_RATE_DIVK1 , k1,OTG0_PIXEL_RATE_DIVK2 , k2); - -dccg32_wait_for_dentist_change_done (dccg);break ;case 1 :REG_UPDATE_2 (OTG_PIXEL_RATE_DIV ,OTG1_PIXEL_RATE_DIVK1 , k1,OTG1_PIXEL_RATE_DIVK2 , k2); - -dccg32_wait_for_dentist_change_done (dccg);break ;case 2 :REG_UPDATE_2 (OTG_PIXEL_RATE_DIV ,OTG2_PIXEL_RATE_DIVK1 , k1,OTG2_PIXEL_RATE_DIVK2 , k2); - -dccg32_wait_for_dentist_change_done (dccg);break ;case 3 :REG_UPDATE_2 (OTG_PIXEL_RATE_DIV ,OTG3_PIXEL_RATE_DIVK1 , k1,OTG3_PIXEL_RATE_DIVK2 , k2); - -dccg32_wait_for_dentist_change_done (dccg);break ;default :BREAK_TO_DEBUGGER ();
@@ -352,6 +340,7 @@ static const struct dccg_funcs dccg32_funcs = { .otg_add_pixel = dccg32_otg_add_pixel, .otg_drop_pixel = dccg32_otg_drop_pixel, .set_pixel_rate_div = dccg32_set_pixel_rate_div, + .trigger_dio_fifo_resync = dccg32_trigger_dio_fifo_resync, }; struct dccg *dccg32_create(
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.h +3 -2
@@ -112,8 +112,9 @@DCCG_SF (DTBCLK_P_CNTL ,DTBCLK_P3_EN , mask_sh),\DCCG_SF (DCCG_AUDIO_DTO_SOURCE ,DCCG_AUDIO_DTO_SEL , mask_sh),\DCCG_SF (DCCG_AUDIO_DTO_SOURCE ,DCCG_AUDIO_DTO0_SOURCE_SEL , mask_sh),\ - DCCG_SF(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_CHG_DONE, mask_sh) - +DCCG_SF (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_CHG_DONE , mask_sh),\ +DCCG_SF (DENTIST_DISPCLK_CNTL ,DENTIST_DISPCLK_RDIVIDER , mask_sh),\ + DCCG_SF(DENTIST_DISPCLK_CNTL, DENTIST_DISPCLK_WDIVIDER, mask_sh) struct dccg *dccg32_create( struct dc_context *ctx,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +27 -0
@@ -1175,6 +1175,33 @@ void dcn32_set_pixels_per_cycle(struct pipe_ctx *pipe_ctx) pix_per_cycle); } +void dcn32_resync_fifo_dccg_dio (struct dce_hwseq *hws,struct dc *dc,struct dc_state *context) +{ +uint8_t i; +struct pipe_ctx *pipe =NULL ; +bool otg_disabled[MAX_PIPES ] = {false}; + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { + pipe = &dc->current_state->res_ctx.pipe_ctx[i]; + +if (pipe->top_pipe || pipe->prev_odm_pipe) +continue ; + +if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal))) { + pipe->stream_res.tg->funcs->disable_crtc (pipe->stream_res.tg); +reset_sync_context_for_pipe (dc, context, i); + otg_disabled[i] = true; + } + } + + hws->ctx->dc->res_pool->dccg->funcs->trigger_dio_fifo_resync (hws->ctx->dc->res_pool->dccg); + +for (i =0 ; i < dc->res_pool->pipe_count; i++) { +if (otg_disabled[i]) + pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); + } +} +void dcn32_unblank_stream (struct pipe_ctx *pipe_ctx,struct dc_link_settings *link_settings) {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +2 -0
@@ -75,6 +75,8 @@ unsigned int dcn32_calculate_dccg_k1_k2_values(struct pipe_ctx *pipe_ctx, unsignvoid dcn32_set_pixels_per_cycle (struct pipe_ctx *pipe_ctx); +void dcn32_resync_fifo_dccg_dio (struct dce_hwseq *hws,struct dc *dc,struct dc_state *context); + void dcn32_subvp_pipe_control_lock(struct dc *dc, struct dc_state *context, bool lock,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1 -0
@@ -153,6 +153,7 @@ static const struct hwseq_private_funcs dcn32_private_funcs = { .update_mall_sel = dcn32_update_mall_sel, .calculate_dccg_k1_k2_values = dcn32_calculate_dccg_k1_k2_values, .set_pixels_per_cycle = dcn32_set_pixels_per_cycle, + .resync_fifo_dccg_dio = dcn32_resync_fifo_dccg_dio, .is_dp_dig_pixel_rate_div_policy = dcn32_is_dp_dig_pixel_rate_div_policy, };
Signature · 1 line
2.25.1
PATCH 16/18 drm/amd/display: Reorganize DCN30 Makefile
In reply to Tom ChungFrom: Rodrigo Siqueira <[email protected]>
DCN30 has a lot of files in the Makefile, and adding each one next to the other makes it hard to read and can increase the chance of merge conflicts. This commit just reorganize the Makefile to put each file associated with DCN30 in its own line.
--- drivers/gpu/drm/amd/display/dc/dcn30/Makefile | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn30/Makefile +26 -12
@@ -1,16 +1,16 @@ -# +# # Copyright 2020 Advanced Micro Devices, Inc. -# +# # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, modify, merge, publish, distribute, sublicense, # and/or sell copies of the Software, and to permit persons to whom the # Software is furnished to do so, subject to the following conditions: -# +# # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. -# +# # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
@@ -18,17 +18,31 @@ # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. -# +# # Authors: AMD -# -# +# +# + +DCN30 := \ + dcn30_init.o \ + dcn30_hubbub.o \ + dcn30_hubp.o \ + dcn30_dpp.o \ + dcn30_optc.o \ + dcn30_dccg.o \ + dcn30_hwseq.o \ + dcn30_mpc.o dcn30_vpg.o \ + dcn30_afmt.o \ + dcn30_dio_stream_encoder.o \ + dcn30_dwb.o \ + dcn30_dpp_cm.o \ + dcn30_dwb_cm.o \ + dcn30_cm_common.o \ + dcn30_mmhubbub.o \ + dcn30_resource.o \ + dcn30_dio_link_encoder.o -DCN30 = dcn30_init.o dcn30_hubbub.o dcn30_hubp.o dcn30_dpp.o dcn30_optc.o \ - dcn30_dccg.o dcn30_hwseq.o dcn30_mpc.o dcn30_vpg.o \ - dcn30_afmt.o dcn30_dio_stream_encoder.o dcn30_dwb.o \ - dcn30_dpp_cm.o dcn30_dwb_cm.o dcn30_cm_common.o dcn30_mmhubbub.o \ - dcn30_dio_link_encoder.o dcn30_resource.o AMD_DAL_DCN30 = $(addprefix $(AMDDALPATH)/dc/dcn30/,$(DCN30))
Signature · 1 line
2.25.1
PATCH 17/18 drm/amd/display: cache trace buffer size
In reply to Tom ChungFrom: Josip Pavic <[email protected]>
[Why & How]
Cache the trace buffer size retrieved from DMUB FW in the driver
--- drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 1 + drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +1 -0
@@ -428,6 +428,7 @@ struct dmub_srv {enum dmub_asic asic;void *user_ctx;uint32_t fw_version; +uint32_t trace_buffer_size;bool is_virtual;struct dmub_fb scratch_mem_fb;volatile const struct dmub_fw_state *fw_state;
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +2 -0
@@ -427,6 +427,8 @@ dmub_srv_calc_region_info(struct dmub_srv *dmub, dmub->fw_version = fw_info->fw_version; } + dmub->trace_buffer_size = trace_buffer_size; + trace_buff->base =dmub_align (mail->top,256 ); trace_buff->top = trace_buff->base +dmub_align (trace_buffer_size,64 );
Signature · 1 line
2.25.1
PATCH 18/18 drm/amd/display: 3.2.237
In reply to Tom ChungFrom: Aric Cyr <[email protected]>
This version brings along following fixes:
- Improve the message printed
- Disable dcn315 pixel rate crb when scaling
- Update SR watermarks for DCN314
- Fix dcn315 pixel rate crb scaling check
- Reset CRTC State Before Restore from S2idle
- Have Payload Properly Created After Resume
- Trigger DIO FIFO resync on commit streams
- Revert vblank change that causes null pointer crash
- Fix possible underflow for displays with large vblank
- Apply 60us prefetch for DCFCLK <= 300Mhz
- Update correct DCN314 register header
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dc.h +1 -1
@@ -45,7 +45,7 @@ struct aux_payload;struct set_config_cmd_payload ;struct dmub_notification ; -#define DC_VER "3.2.236" +#define DC_VER "3.2.237"#define MAX_SURFACES 3#define MAX_PLANES 6
Signature · 1 line
2.25.1