From: Lewis Huang <[email protected]>

[Why]
We want flexibility to choose how pwrseq instance is mapped to eDP panel

[How]
Add configuration option to choose the pwrseq mapping policy.
When enabled, allow fixed mapping between DIG inst to pwrseq inst.

Reviewed-by: Anthony Koo <[email protected]>
Acked-by: Hamza Mahfooz <[email protected]>
Signed-off-by: Lewis Huang <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/dc.h                     | 1 +
 drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c | 9 ++++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dc.h 
b/drivers/gpu/drm/amd/display/dc/dc.h
index 46be4845ec28..db87f9cdd567 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -437,6 +437,7 @@ struct dc_config {
        bool usb4_bw_alloc_support;
        bool allow_0_dtb_clk;
        bool use_assr_psp_message;
+       bool support_edp0_on_dp1;
 };
 
 enum visual_confirm {
diff --git a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c 
b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
index 281be20b1a10..20c6fe48567f 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
@@ -173,5 +173,12 @@ void dcn31_panel_cntl_construct(
                break;
        }
 
-       dcn31_panel_cntl->base.pwrseq_inst = pwrseq_inst;
+       if (dcn31_panel_cntl->base.ctx->dc->config.support_edp0_on_dp1)
+               //If supported, power sequencer mapping shall follow the DIG 
instance
+               dcn31_panel_cntl->base.pwrseq_inst = pwrseq_inst;
+       else
+               /* If not supported, pwrseq will be assigned in order,
+                * so first pwrseq will be assigned to first panel instance 
(legacy behavior)
+                */
+               dcn31_panel_cntl->base.pwrseq_inst = 
dcn31_panel_cntl->base.inst;
 }
-- 
2.44.0

Reply via email to