[4/4] drm/amdgpu/display: add flag for multi-display mclk switching

Submitted by Alex Deucher on Aug. 22, 2019, 7:30 p.m.

Details

Message ID 20190822193050.3107-5-alexander.deucher@amd.com
State New
Headers show
Series "Support mclk switching when monitors are in sync" ( rev: 2 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Alex Deucher Aug. 22, 2019, 7:30 p.m.
Add a dcfeaturemask flag for mclk switching.  Disable by default;
enable once the feature has seen more testing.

Set amdgpu.dcfeaturemask=2 on the kernel command line in grub
to enable this.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++
 drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c  | 5 ++++-
 drivers/gpu/drm/amd/display/dc/dc.h               | 2 +-
 drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
 4 files changed, 9 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 45298269744d..cb86ccf48bd9 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -694,6 +694,9 @@  static int amdgpu_dm_init(struct amdgpu_device *adev)
 	if (amdgpu_dc_feature_mask & DC_FBC_MASK)
 		init_data.flags.fbc_support = true;
 
+	if (amdgpu_dc_feature_mask & DC_MULTI_MON_PP_MCLK_SWITCH_MASK)
+		init_data.flags.multi_mon_pp_mclk_switch = true;
+
 	init_data.flags.power_down_display_on_boot = true;
 
 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
index eca681d9d7f5..a1d49256fab7 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
@@ -3025,7 +3025,10 @@  bool bw_calcs(struct dc_context *ctx,
 
 	populate_initial_data(pipe, pipe_count, data);
 
-	calcs_output->all_displays_in_sync = all_displays_in_sync(pipe, pipe_count);
+	if (ctx->dc->config.multi_mon_pp_mclk_switch)
+		calcs_output->all_displays_in_sync = all_displays_in_sync(pipe, pipe_count);
+	else
+		calcs_output->all_displays_in_sync = false;
 
 	if (data->number_of_displays != 0) {
 		uint8_t yclk_lvl, sclk_lvl;
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 3ef269f82478..5d4a2a9228f0 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -220,7 +220,7 @@  struct dc_config {
 	bool power_down_display_on_boot;
 	bool edp_not_connected;
 	bool forced_clocks;
-
+	bool multi_mon_pp_mclk_switch;
 };
 
 enum visual_confirm {
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index a0a7211438f2..8889aaceec60 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -142,6 +142,7 @@  enum PP_FEATURE_MASK {
 
 enum DC_FEATURE_MASK {
 	DC_FBC_MASK = 0x1,
+	DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,
 };
 
 enum amd_dpm_forced_level;

Comments

On 8/22/19 3:30 PM, Alex Deucher wrote:
> Add a dcfeaturemask flag for mclk switching.  Disable by default;

> enable once the feature has seen more testing.

> 

> Set amdgpu.dcfeaturemask=2 on the kernel command line in grub

> to enable this.

> 

> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>


Patches 3 and 4 are

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>


> ---

>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++

>   drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c  | 5 ++++-

>   drivers/gpu/drm/amd/display/dc/dc.h               | 2 +-

>   drivers/gpu/drm/amd/include/amd_shared.h          | 1 +

>   4 files changed, 9 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> index 45298269744d..cb86ccf48bd9 100644

> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> @@ -694,6 +694,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)

>   	if (amdgpu_dc_feature_mask & DC_FBC_MASK)

>   		init_data.flags.fbc_support = true;

>   

> +	if (amdgpu_dc_feature_mask & DC_MULTI_MON_PP_MCLK_SWITCH_MASK)

> +		init_data.flags.multi_mon_pp_mclk_switch = true;

> +

>   	init_data.flags.power_down_display_on_boot = true;

>   

>   #ifdef CONFIG_DRM_AMD_DC_DCN2_0

> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

> index eca681d9d7f5..a1d49256fab7 100644

> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

> @@ -3025,7 +3025,10 @@ bool bw_calcs(struct dc_context *ctx,

>   

>   	populate_initial_data(pipe, pipe_count, data);

>   

> -	calcs_output->all_displays_in_sync = all_displays_in_sync(pipe, pipe_count);

> +	if (ctx->dc->config.multi_mon_pp_mclk_switch)

> +		calcs_output->all_displays_in_sync = all_displays_in_sync(pipe, pipe_count);

> +	else

> +		calcs_output->all_displays_in_sync = false;

>   

>   	if (data->number_of_displays != 0) {

>   		uint8_t yclk_lvl, sclk_lvl;

> diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h

> index 3ef269f82478..5d4a2a9228f0 100644

> --- a/drivers/gpu/drm/amd/display/dc/dc.h

> +++ b/drivers/gpu/drm/amd/display/dc/dc.h

> @@ -220,7 +220,7 @@ struct dc_config {

>   	bool power_down_display_on_boot;

>   	bool edp_not_connected;

>   	bool forced_clocks;

> -

> +	bool multi_mon_pp_mclk_switch;

>   };

>   

>   enum visual_confirm {

> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h

> index a0a7211438f2..8889aaceec60 100644

> --- a/drivers/gpu/drm/amd/include/amd_shared.h

> +++ b/drivers/gpu/drm/amd/include/amd_shared.h

> @@ -142,6 +142,7 @@ enum PP_FEATURE_MASK {

>   

>   enum DC_FEATURE_MASK {

>   	DC_FBC_MASK = 0x1,

> +	DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,

>   };

>   

>   enum amd_dpm_forced_level;

>
Patch1, 2 are reviewed-by: Evan Quan <evan.quan@amd.com>
Patch 3,4 are acked-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----

> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex

> Deucher

> Sent: Friday, August 23, 2019 3:31 AM

> To: amd-gfx@lists.freedesktop.org

> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>

> Subject: [PATCH 4/4] drm/amdgpu/display: add flag for multi-display mclk

> switching

> 

> Add a dcfeaturemask flag for mclk switching.  Disable by default; enable once

> the feature has seen more testing.

> 

> Set amdgpu.dcfeaturemask=2 on the kernel command line in grub to enable

> this.

> 

> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

> ---

>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++

> drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c  | 5 ++++-

>  drivers/gpu/drm/amd/display/dc/dc.h               | 2 +-

>  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +

>  4 files changed, 9 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> index 45298269744d..cb86ccf48bd9 100644

> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

> @@ -694,6 +694,9 @@ static int amdgpu_dm_init(struct amdgpu_device

> *adev)

>  	if (amdgpu_dc_feature_mask & DC_FBC_MASK)

>  		init_data.flags.fbc_support = true;

> 

> +	if (amdgpu_dc_feature_mask &

> DC_MULTI_MON_PP_MCLK_SWITCH_MASK)

> +		init_data.flags.multi_mon_pp_mclk_switch = true;

> +

>  	init_data.flags.power_down_display_on_boot = true;

> 

>  #ifdef CONFIG_DRM_AMD_DC_DCN2_0

> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

> b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

> index eca681d9d7f5..a1d49256fab7 100644

> --- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c

> @@ -3025,7 +3025,10 @@ bool bw_calcs(struct dc_context *ctx,

> 

>  	populate_initial_data(pipe, pipe_count, data);

> 

> -	calcs_output->all_displays_in_sync = all_displays_in_sync(pipe,

> pipe_count);

> +	if (ctx->dc->config.multi_mon_pp_mclk_switch)

> +		calcs_output->all_displays_in_sync =

> all_displays_in_sync(pipe, pipe_count);

> +	else

> +		calcs_output->all_displays_in_sync = false;

> 

>  	if (data->number_of_displays != 0) {

>  		uint8_t yclk_lvl, sclk_lvl;

> diff --git a/drivers/gpu/drm/amd/display/dc/dc.h

> b/drivers/gpu/drm/amd/display/dc/dc.h

> index 3ef269f82478..5d4a2a9228f0 100644

> --- a/drivers/gpu/drm/amd/display/dc/dc.h

> +++ b/drivers/gpu/drm/amd/display/dc/dc.h

> @@ -220,7 +220,7 @@ struct dc_config {

>  	bool power_down_display_on_boot;

>  	bool edp_not_connected;

>  	bool forced_clocks;

> -

> +	bool multi_mon_pp_mclk_switch;

>  };

> 

>  enum visual_confirm {

> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h

> b/drivers/gpu/drm/amd/include/amd_shared.h

> index a0a7211438f2..8889aaceec60 100644

> --- a/drivers/gpu/drm/amd/include/amd_shared.h

> +++ b/drivers/gpu/drm/amd/include/amd_shared.h

> @@ -142,6 +142,7 @@ enum PP_FEATURE_MASK {

> 

>  enum DC_FEATURE_MASK {

>  	DC_FBC_MASK = 0x1,

> +	DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,

>  };

> 

>  enum amd_dpm_forced_level;

> --

> 2.20.1

> 

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx