amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Adding DC debug options
@ 2020-05-12 16:45 Harry Wentland
  2020-05-12 16:45 ` [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup Harry Wentland
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Harry Wentland @ 2020-05-12 16:45 UTC (permalink / raw)
  To: amd-gfx; +Cc: Harry Wentland

To facilitate bringup of new ASICs, debugging, and measuring of
various power features we would like the ability to disable them
as needed.

This differs from dcfeaturemask in that dcfeaturemask is a collection
of experimental features that can't be enabled by default, whereas
dcdebugmask is a collection of features that are enabled by default.

Harry Wentland (3):
  drm/amd/display: Add DC Debug mask to disable features for bringup
  drm/amd/display: Fix disable_stutter debug option
  drm/amd/display: Respect PP_STUTTER_MODE but don't override
    DC_DISABLE_STUTTER

 drivers/gpu/drm/amd/amdgpu/amdgpu.h           |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c       |  8 ++++++++
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 20 ++++++++++++++++---
 .../drm/amd/display/dc/dcn10/dcn10_hubbub.c   |  1 -
 .../amd/display/dc/dcn10/dcn10_hw_sequencer.c |  3 ++-
 drivers/gpu/drm/amd/include/amd_shared.h      |  7 +++++++
 6 files changed, 35 insertions(+), 5 deletions(-)

--
2.26.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup
  2020-05-12 16:45 [PATCH 0/3] Adding DC debug options Harry Wentland
@ 2020-05-12 16:45 ` Harry Wentland
  2020-05-12 16:54   ` Kazlauskas, Nicholas
  2020-05-12 16:45 ` [PATCH 2/3] drm/amd/display: Fix disable_stutter debug option Harry Wentland
  2020-05-12 16:45 ` [PATCH 3/3] drm/amd/display: Respect PP_STUTTER_MODE but don't override DC_DISABLE_STUTTER Harry Wentland
  2 siblings, 1 reply; 7+ messages in thread
From: Harry Wentland @ 2020-05-12 16:45 UTC (permalink / raw)
  To: amd-gfx; +Cc: Harry Wentland

[Why]
At bringup we want to be able to disable various power features.

[How]
These features are already exposed as dc_debug_options and exercised
on other OSes. Create a new dc_debug_mask module parameter and expose
relevant bits, in particular
 * DC_DISABLE_PIPE_SPLIT
 * DC_DISABLE_STUTTER
 * DC_DISABLE_DSC
 * DC_DISABLE_CLOCK_GATING

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h               |  1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c           |  8 ++++++++
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++++
 drivers/gpu/drm/amd/include/amd_shared.h          |  7 +++++++
 4 files changed, 30 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 2a806cb55b78..13c8ccdb2948 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -173,6 +173,7 @@ extern int amdgpu_gpu_recovery;
 extern int amdgpu_emu_mode;
 extern uint amdgpu_smu_memory_pool_size;
 extern uint amdgpu_dc_feature_mask;
+extern uint amdgpu_dc_debug_mask;
 extern uint amdgpu_dm_abm_level;
 extern struct amdgpu_mgpu_info mgpu_info;
 extern int amdgpu_ras_enable;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 589000938ab6..76707491657e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -140,6 +140,7 @@ int amdgpu_emu_mode = 0;
 uint amdgpu_smu_memory_pool_size = 0;
 /* FBC (bit 0) disabled by default*/
 uint amdgpu_dc_feature_mask = 0;
+uint amdgpu_dc_debug_mask = 0;
 int amdgpu_async_gfx_ring = 1;
 int amdgpu_mcbp = 0;
 int amdgpu_discovery = -1;
@@ -714,6 +715,13 @@ MODULE_PARM_DESC(queue_preemption_timeout_ms, "queue preemption timeout in ms (1
 MODULE_PARM_DESC(dcfeaturemask, "all stable DC features enabled (default))");
 module_param_named(dcfeaturemask, amdgpu_dc_feature_mask, uint, 0444);
 
+/**
+ * DOC: dcdebugmask (uint)
+ * Override display features enabled. See enum DC_DEBUG_MASK in drivers/gpu/drm/amd/include/amd_shared.h.
+ */
+MODULE_PARM_DESC(dcdebugmask, "all debug options disabled (default))");
+module_param_named(dcdebugmask, amdgpu_dc_debug_mask, uint, 0444);
+
 /**
  * DOC: abmlevel (uint)
  * Override the default ABM (Adaptive Backlight Management) level used for DC
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 60fe64aef11b..bf347ca43064 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -918,6 +918,20 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 		goto error;
 	}
 
+	if (amdgpu_dc_debug_mask & DC_DISABLE_PIPE_SPLIT) {
+		adev->dm.dc->debug.force_single_disp_pipe_split = false;
+		adev->dm.dc->debug.pipe_split_policy = MPC_SPLIT_AVOID;
+	}
+
+	if (amdgpu_dc_debug_mask & DC_DISABLE_STUTTER)
+		adev->dm.dc->debug.disable_stutter = true;
+
+	if (amdgpu_dc_debug_mask & DC_DISABLE_DSC)
+		adev->dm.dc->debug.disable_dsc = true;
+
+	if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
+		adev->dm.dc->debug.disable_clock_gate = true;
+
 	r = dm_dmub_hw_init(adev);
 	if (r) {
 		DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index d655a76bedc6..92126c54cb1c 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -150,6 +150,13 @@ enum DC_FEATURE_MASK {
 	DC_PSR_MASK = 0x8,
 };
 
+enum DC_DEBUG_MASK {
+	DC_DISABLE_PIPE_SPLIT = 0x1,
+	DC_DISABLE_STUTTER = 0x2,
+	DC_DISABLE_DSC = 0x4,
+	DC_DISABLE_CLOCK_GATING = 0x8
+};
+
 enum amd_dpm_forced_level;
 /**
  * struct amd_ip_funcs - general hooks for managing amdgpu IP Blocks
-- 
2.26.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] drm/amd/display: Fix disable_stutter debug option
  2020-05-12 16:45 [PATCH 0/3] Adding DC debug options Harry Wentland
  2020-05-12 16:45 ` [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup Harry Wentland
@ 2020-05-12 16:45 ` Harry Wentland
  2020-05-12 16:45 ` [PATCH 3/3] drm/amd/display: Respect PP_STUTTER_MODE but don't override DC_DISABLE_STUTTER Harry Wentland
  2 siblings, 0 replies; 7+ messages in thread
From: Harry Wentland @ 2020-05-12 16:45 UTC (permalink / raw)
  To: amd-gfx; +Cc: Harry Wentland

[Why & How]
One call was forcing stutter on instead of looking at the debug option.
Ensure we always check the debug option unless we want to force stutter
off.

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c       | 1 -
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 3 ++-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
index deccab0228d2..75637c291e75 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubbub.c
@@ -93,7 +93,6 @@ void hubbub1_wm_read_state(struct hubbub *hubbub,
 void hubbub1_allow_self_refresh_control(struct hubbub *hubbub, bool allow)
 {
 	struct dcn10_hubbub *hubbub1 = TO_DCN10_HUBBUB(hubbub);
-
 	/*
 	 * DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE = 1 means do not allow stutter
 	 * DCHUBBUB_ARB_ALLOW_SELF_REFRESH_FORCE_ENABLE = 0 means allow stutter
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index f36d1f57b846..daf6977b5fb5 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -737,7 +737,8 @@ void dcn10_bios_golden_init(struct dc *dc)
 	if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
 		if (allow_self_fresh_force_enable == false &&
 				dc->res_pool->hubbub->funcs->is_allow_self_refresh_enabled(dc->res_pool->hubbub))
-			dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub, true);
+			dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
+										!dc->res_pool->hubbub->ctx->dc->debug.disable_stutter);
 
 }
 
-- 
2.26.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] drm/amd/display: Respect PP_STUTTER_MODE but don't override DC_DISABLE_STUTTER
  2020-05-12 16:45 [PATCH 0/3] Adding DC debug options Harry Wentland
  2020-05-12 16:45 ` [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup Harry Wentland
  2020-05-12 16:45 ` [PATCH 2/3] drm/amd/display: Fix disable_stutter debug option Harry Wentland
@ 2020-05-12 16:45 ` Harry Wentland
  2 siblings, 0 replies; 7+ messages in thread
From: Harry Wentland @ 2020-05-12 16:45 UTC (permalink / raw)
  To: amd-gfx; +Cc: Harry Wentland

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 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 bf347ca43064..9d8aaaa33264 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -923,6 +923,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 		adev->dm.dc->debug.pipe_split_policy = MPC_SPLIT_AVOID;
 	}
 
+	if (adev->asic_type != CHIP_CARRIZO && adev->asic_type != CHIP_STONEY)
+		adev->dm.dc->debug.disable_stutter = amdgpu_pp_feature_mask & PP_STUTTER_MODE ? false : true;
+
 	if (amdgpu_dc_debug_mask & DC_DISABLE_STUTTER)
 		adev->dm.dc->debug.disable_stutter = true;
 
@@ -3036,9 +3039,6 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 		goto fail;
 	}
 
-	if (adev->asic_type != CHIP_CARRIZO && adev->asic_type != CHIP_STONEY)
-		dm->dc->debug.disable_stutter = amdgpu_pp_feature_mask & PP_STUTTER_MODE ? false : true;
-
 	/* No userspace support. */
 	dm->dc->debug.disable_tri_buf = true;
 
-- 
2.26.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup
  2020-05-12 16:45 ` [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup Harry Wentland
@ 2020-05-12 16:54   ` Kazlauskas, Nicholas
  2020-05-12 17:09     ` Harry Wentland
  2020-05-12 17:10     ` Harry Wentland
  0 siblings, 2 replies; 7+ messages in thread
From: Kazlauskas, Nicholas @ 2020-05-12 16:54 UTC (permalink / raw)
  To: Harry Wentland, amd-gfx

On 2020-05-12 12:45 p.m., Harry Wentland wrote:
> [Why]
> At bringup we want to be able to disable various power features.
> 
> [How]
> These features are already exposed as dc_debug_options and exercised
> on other OSes. Create a new dc_debug_mask module parameter and expose
> relevant bits, in particular
>   * DC_DISABLE_PIPE_SPLIT
>   * DC_DISABLE_STUTTER
>   * DC_DISABLE_DSC
>   * DC_DISABLE_CLOCK_GATING
> 
> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu.h               |  1 +
>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c           |  8 ++++++++
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++++
>   drivers/gpu/drm/amd/include/amd_shared.h          |  7 +++++++
>   4 files changed, 30 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index 2a806cb55b78..13c8ccdb2948 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -173,6 +173,7 @@ extern int amdgpu_gpu_recovery;
>   extern int amdgpu_emu_mode;
>   extern uint amdgpu_smu_memory_pool_size;
>   extern uint amdgpu_dc_feature_mask;
> +extern uint amdgpu_dc_debug_mask;
>   extern uint amdgpu_dm_abm_level;
>   extern struct amdgpu_mgpu_info mgpu_info;
>   extern int amdgpu_ras_enable;
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 589000938ab6..76707491657e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> @@ -140,6 +140,7 @@ int amdgpu_emu_mode = 0;
>   uint amdgpu_smu_memory_pool_size = 0;
>   /* FBC (bit 0) disabled by default*/
>   uint amdgpu_dc_feature_mask = 0;
> +uint amdgpu_dc_debug_mask = 0;
>   int amdgpu_async_gfx_ring = 1;
>   int amdgpu_mcbp = 0;
>   int amdgpu_discovery = -1;
> @@ -714,6 +715,13 @@ MODULE_PARM_DESC(queue_preemption_timeout_ms, "queue preemption timeout in ms (1
>   MODULE_PARM_DESC(dcfeaturemask, "all stable DC features enabled (default))");
>   module_param_named(dcfeaturemask, amdgpu_dc_feature_mask, uint, 0444);
>   
> +/**
> + * DOC: dcdebugmask (uint)
> + * Override display features enabled. See enum DC_DEBUG_MASK in drivers/gpu/drm/amd/include/amd_shared.h.
> + */
> +MODULE_PARM_DESC(dcdebugmask, "all debug options disabled (default))");
> +module_param_named(dcdebugmask, amdgpu_dc_debug_mask, uint, 0444);
> +
>   /**
>    * DOC: abmlevel (uint)
>    * Override the default ABM (Adaptive Backlight Management) level used for DC
> 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 60fe64aef11b..bf347ca43064 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -918,6 +918,20 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
>   		goto error;
>   	}
>   
> +	if (amdgpu_dc_debug_mask & DC_DISABLE_PIPE_SPLIT) {
> +		adev->dm.dc->debug.force_single_disp_pipe_split = false;
> +		adev->dm.dc->debug.pipe_split_policy = MPC_SPLIT_AVOID;
> +	}
> +
> +	if (amdgpu_dc_debug_mask & DC_DISABLE_STUTTER)
> +		adev->dm.dc->debug.disable_stutter = true;
> +
> +	if (amdgpu_dc_debug_mask & DC_DISABLE_DSC)
> +		adev->dm.dc->debug.disable_dsc = true;
> +
> +	if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
> +		adev->dm.dc->debug.disable_clock_gate = true;
> +

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

Note that we fill in device defaults during dc_create, but there are 
some debug options which we unfortunately do reference during 
dc_create() itself which would apply some options too late in the sequence.

Fortunately, I don't think that's the case for any of these debug 
options, but it's something to keep in mind at least. That's what the 
init_flags were added for I think, and those generally have preference 
over debug option overrides when available (from my understanding).

Regards,
Nicholas Kazlauskas

>   	r = dm_dmub_hw_init(adev);
>   	if (r) {
>   		DRM_ERROR("DMUB interface failed to initialize: status=%d\n", r);
> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
> index d655a76bedc6..92126c54cb1c 100644
> --- a/drivers/gpu/drm/amd/include/amd_shared.h
> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
> @@ -150,6 +150,13 @@ enum DC_FEATURE_MASK {
>   	DC_PSR_MASK = 0x8,
>   };
>   
> +enum DC_DEBUG_MASK {
> +	DC_DISABLE_PIPE_SPLIT = 0x1,
> +	DC_DISABLE_STUTTER = 0x2,
> +	DC_DISABLE_DSC = 0x4,
> +	DC_DISABLE_CLOCK_GATING = 0x8
> +};
> +
>   enum amd_dpm_forced_level;
>   /**
>    * struct amd_ip_funcs - general hooks for managing amdgpu IP Blocks
> 

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup
  2020-05-12 16:54   ` Kazlauskas, Nicholas
@ 2020-05-12 17:09     ` Harry Wentland
  2020-05-12 17:10     ` Harry Wentland
  1 sibling, 0 replies; 7+ messages in thread
From: Harry Wentland @ 2020-05-12 17:09 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, Harry Wentland, amd-gfx



On 2020-05-12 12:54 p.m., Kazlauskas, Nicholas wrote:
> On 2020-05-12 12:45 p.m., Harry Wentland wrote:
>> [Why]
>> At bringup we want to be able to disable various power features.
>>
>> [How]
>> These features are already exposed as dc_debug_options and exercised
>> on other OSes. Create a new dc_debug_mask module parameter and expose
>> relevant bits, in particular
>>   * DC_DISABLE_PIPE_SPLIT
>>   * DC_DISABLE_STUTTER
>>   * DC_DISABLE_DSC
>>   * DC_DISABLE_CLOCK_GATING
>>
>> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h               |  1 +
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c           |  8 ++++++++
>>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++++
>>   drivers/gpu/drm/amd/include/amd_shared.h          |  7 +++++++
>>   4 files changed, 30 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 2a806cb55b78..13c8ccdb2948 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -173,6 +173,7 @@ extern int amdgpu_gpu_recovery;
>>   extern int amdgpu_emu_mode;
>>   extern uint amdgpu_smu_memory_pool_size;
>>   extern uint amdgpu_dc_feature_mask;
>> +extern uint amdgpu_dc_debug_mask;
>>   extern uint amdgpu_dm_abm_level;
>>   extern struct amdgpu_mgpu_info mgpu_info;
>>   extern int amdgpu_ras_enable;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> index 589000938ab6..76707491657e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> @@ -140,6 +140,7 @@ int amdgpu_emu_mode = 0;
>>   uint amdgpu_smu_memory_pool_size = 0;
>>   /* FBC (bit 0) disabled by default*/
>>   uint amdgpu_dc_feature_mask = 0;
>> +uint amdgpu_dc_debug_mask = 0;
>>   int amdgpu_async_gfx_ring = 1;
>>   int amdgpu_mcbp = 0;
>>   int amdgpu_discovery = -1;
>> @@ -714,6 +715,13 @@ MODULE_PARM_DESC(queue_preemption_timeout_ms,
>> "queue preemption timeout in ms (1
>>   MODULE_PARM_DESC(dcfeaturemask, "all stable DC features enabled
>> (default))");
>>   module_param_named(dcfeaturemask, amdgpu_dc_feature_mask, uint, 0444);
>>   +/**
>> + * DOC: dcdebugmask (uint)
>> + * Override display features enabled. See enum DC_DEBUG_MASK in
>> drivers/gpu/drm/amd/include/amd_shared.h.
>> + */
>> +MODULE_PARM_DESC(dcdebugmask, "all debug options disabled (default))");
>> +module_param_named(dcdebugmask, amdgpu_dc_debug_mask, uint, 0444);
>> +
>>   /**
>>    * DOC: abmlevel (uint)
>>    * Override the default ABM (Adaptive Backlight Management) level
>> used for DC
>> 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 60fe64aef11b..bf347ca43064 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -918,6 +918,20 @@ static int amdgpu_dm_init(struct amdgpu_device
>> *adev)
>>           goto error;
>>       }
>>   +    if (amdgpu_dc_debug_mask & DC_DISABLE_PIPE_SPLIT) {
>> +        adev->dm.dc->debug.force_single_disp_pipe_split = false;
>> +        adev->dm.dc->debug.pipe_split_policy = MPC_SPLIT_AVOID;
>> +    }
>> +
>> +    if (amdgpu_dc_debug_mask & DC_DISABLE_STUTTER)
>> +        adev->dm.dc->debug.disable_stutter = true;
>> +
>> +    if (amdgpu_dc_debug_mask & DC_DISABLE_DSC)
>> +        adev->dm.dc->debug.disable_dsc = true;
>> +
>> +    if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
>> +        adev->dm.dc->debug.disable_clock_gate = true;
>> +
> 
> Series is Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> Note that we fill in device defaults during dc_create, but there are
> some debug options which we unfortunately do reference during
> dc_create() itself which would apply some options too late in the sequence.
> 
> Fortunately, I don't think that's the case for any of these debug
> options, but it's something to keep in mind at least. That's what the
> init_flags were added for I think, and those generally have preference
> over debug option overrides when available (from my understanding).
> 

Thanks.

dc_debug isn't provided via dc_init_data, so we can only modify dc_debug
afterwards. if dc_create uses debug options that's a bit unfortunate but
we'd probably have to address that one-by-one if it matters.

Harry

> Regards,
> Nicholas Kazlauskas
> 
>>       r = dm_dmub_hw_init(adev);
>>       if (r) {
>>           DRM_ERROR("DMUB interface failed to initialize:
>> status=%d\n", r);
>> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h
>> b/drivers/gpu/drm/amd/include/amd_shared.h
>> index d655a76bedc6..92126c54cb1c 100644
>> --- a/drivers/gpu/drm/amd/include/amd_shared.h
>> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
>> @@ -150,6 +150,13 @@ enum DC_FEATURE_MASK {
>>       DC_PSR_MASK = 0x8,
>>   };
>>   +enum DC_DEBUG_MASK {
>> +    DC_DISABLE_PIPE_SPLIT = 0x1,
>> +    DC_DISABLE_STUTTER = 0x2,
>> +    DC_DISABLE_DSC = 0x4,
>> +    DC_DISABLE_CLOCK_GATING = 0x8
>> +};
>> +
>>   enum amd_dpm_forced_level;
>>   /**
>>    * struct amd_ip_funcs - general hooks for managing amdgpu IP Blocks
>>
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup
  2020-05-12 16:54   ` Kazlauskas, Nicholas
  2020-05-12 17:09     ` Harry Wentland
@ 2020-05-12 17:10     ` Harry Wentland
  1 sibling, 0 replies; 7+ messages in thread
From: Harry Wentland @ 2020-05-12 17:10 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, Harry Wentland, amd-gfx



On 2020-05-12 12:54 p.m., Kazlauskas, Nicholas wrote:
> On 2020-05-12 12:45 p.m., Harry Wentland wrote:
>> [Why]
>> At bringup we want to be able to disable various power features.
>>
>> [How]
>> These features are already exposed as dc_debug_options and exercised
>> on other OSes. Create a new dc_debug_mask module parameter and expose
>> relevant bits, in particular
>>   * DC_DISABLE_PIPE_SPLIT
>>   * DC_DISABLE_STUTTER
>>   * DC_DISABLE_DSC
>>   * DC_DISABLE_CLOCK_GATING
>>
>> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu.h               |  1 +
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c           |  8 ++++++++
>>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++++++++
>>   drivers/gpu/drm/amd/include/amd_shared.h          |  7 +++++++
>>   4 files changed, 30 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> index 2a806cb55b78..13c8ccdb2948 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
>> @@ -173,6 +173,7 @@ extern int amdgpu_gpu_recovery;
>>   extern int amdgpu_emu_mode;
>>   extern uint amdgpu_smu_memory_pool_size;
>>   extern uint amdgpu_dc_feature_mask;
>> +extern uint amdgpu_dc_debug_mask;
>>   extern uint amdgpu_dm_abm_level;
>>   extern struct amdgpu_mgpu_info mgpu_info;
>>   extern int amdgpu_ras_enable;
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> index 589000938ab6..76707491657e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
>> @@ -140,6 +140,7 @@ int amdgpu_emu_mode = 0;
>>   uint amdgpu_smu_memory_pool_size = 0;
>>   /* FBC (bit 0) disabled by default*/
>>   uint amdgpu_dc_feature_mask = 0;
>> +uint amdgpu_dc_debug_mask = 0;
>>   int amdgpu_async_gfx_ring = 1;
>>   int amdgpu_mcbp = 0;
>>   int amdgpu_discovery = -1;
>> @@ -714,6 +715,13 @@ MODULE_PARM_DESC(queue_preemption_timeout_ms,
>> "queue preemption timeout in ms (1
>>   MODULE_PARM_DESC(dcfeaturemask, "all stable DC features enabled
>> (default))");
>>   module_param_named(dcfeaturemask, amdgpu_dc_feature_mask, uint, 0444);
>>   +/**
>> + * DOC: dcdebugmask (uint)
>> + * Override display features enabled. See enum DC_DEBUG_MASK in
>> drivers/gpu/drm/amd/include/amd_shared.h.
>> + */
>> +MODULE_PARM_DESC(dcdebugmask, "all debug options disabled (default))");
>> +module_param_named(dcdebugmask, amdgpu_dc_debug_mask, uint, 0444);
>> +
>>   /**
>>    * DOC: abmlevel (uint)
>>    * Override the default ABM (Adaptive Backlight Management) level
>> used for DC
>> 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 60fe64aef11b..bf347ca43064 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -918,6 +918,20 @@ static int amdgpu_dm_init(struct amdgpu_device
>> *adev)
>>           goto error;
>>       }
>>   +    if (amdgpu_dc_debug_mask & DC_DISABLE_PIPE_SPLIT) {
>> +        adev->dm.dc->debug.force_single_disp_pipe_split = false;
>> +        adev->dm.dc->debug.pipe_split_policy = MPC_SPLIT_AVOID;
>> +    }
>> +
>> +    if (amdgpu_dc_debug_mask & DC_DISABLE_STUTTER)
>> +        adev->dm.dc->debug.disable_stutter = true;
>> +
>> +    if (amdgpu_dc_debug_mask & DC_DISABLE_DSC)
>> +        adev->dm.dc->debug.disable_dsc = true;
>> +
>> +    if (amdgpu_dc_debug_mask & DC_DISABLE_CLOCK_GATING)
>> +        adev->dm.dc->debug.disable_clock_gate = true;
>> +
> 
> Series is Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
> 
> Note that we fill in device defaults during dc_create, but there are
> some debug options which we unfortunately do reference during
> dc_create() itself which would apply some options too late in the sequence.
> 
> Fortunately, I don't think that's the case for any of these debug
> options, but it's something to keep in mind at least. That's what the
> init_flags were added for I think, and those generally have preference
> over debug option overrides when available (from my understanding).
> 

Thanks.

dc_debug isn't provided via dc_init_data, so we can only modify dc_debug
afterwards. if dc_create uses debug options that's a bit unfortunate but
we'd probably have to address that one-by-one if it matters.

Harry

> Regards,
> Nicholas Kazlauskas
> 
>>       r = dm_dmub_hw_init(adev);
>>       if (r) {
>>           DRM_ERROR("DMUB interface failed to initialize:
>> status=%d\n", r);
>> diff --git a/drivers/gpu/drm/amd/include/amd_shared.h
>> b/drivers/gpu/drm/amd/include/amd_shared.h
>> index d655a76bedc6..92126c54cb1c 100644
>> --- a/drivers/gpu/drm/amd/include/amd_shared.h
>> +++ b/drivers/gpu/drm/amd/include/amd_shared.h
>> @@ -150,6 +150,13 @@ enum DC_FEATURE_MASK {
>>       DC_PSR_MASK = 0x8,
>>   };
>>   +enum DC_DEBUG_MASK {
>> +    DC_DISABLE_PIPE_SPLIT = 0x1,
>> +    DC_DISABLE_STUTTER = 0x2,
>> +    DC_DISABLE_DSC = 0x4,
>> +    DC_DISABLE_CLOCK_GATING = 0x8
>> +};
>> +
>>   enum amd_dpm_forced_level;
>>   /**
>>    * struct amd_ip_funcs - general hooks for managing amdgpu IP Blocks
>>
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-05-12 17:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 16:45 [PATCH 0/3] Adding DC debug options Harry Wentland
2020-05-12 16:45 ` [PATCH 1/3] drm/amd/display: Add DC Debug mask to disable features for bringup Harry Wentland
2020-05-12 16:54   ` Kazlauskas, Nicholas
2020-05-12 17:09     ` Harry Wentland
2020-05-12 17:10     ` Harry Wentland
2020-05-12 16:45 ` [PATCH 2/3] drm/amd/display: Fix disable_stutter debug option Harry Wentland
2020-05-12 16:45 ` [PATCH 3/3] drm/amd/display: Respect PP_STUTTER_MODE but don't override DC_DISABLE_STUTTER Harry Wentland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).