* [PATCH 0/2] Remove redundant condition check
@ 2024-11-11 12:08 Bhavin Sharma
2024-11-11 12:08 ` [PATCH 1/2] drm/amd/display: Remove redundant check Bhavin Sharma
2024-11-11 12:08 ` [PATCH 2/2] drm/amd/pm: " Bhavin Sharma
0 siblings, 2 replies; 4+ messages in thread
From: Bhavin Sharma @ 2024-11-11 12:08 UTC (permalink / raw)
To: alexander.deucher
Cc: tarang.raval, Bhavin Sharma, Chaitanya Dhere, Jun Lei,
Harry Wentland, Leo Li, Rodrigo Siqueira, Christian König,
Xinhui Pan, David Airlie, Simona Vetter, Kenneth Feng,
Wenjing Liu, Roman Li, Chris Park, Leo Ma, Jose Fernandez,
Ilya Bakoulin, Aurabindo Pillai, amd-gfx, dri-devel,
linux-kernel
Bhavin Sharma (2):
drm: amd: display: Remove redundant check
drm: amd: pm: Remove redundant check
.../display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +-
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 ++++------
.../amd/pm/powerplay/smumgr/vega12_smumgr.c | 24 +++++++++----------
3 files changed, 17 insertions(+), 22 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] drm/amd/display: Remove redundant check
2024-11-11 12:08 [PATCH 0/2] Remove redundant condition check Bhavin Sharma
@ 2024-11-11 12:08 ` Bhavin Sharma
2024-11-13 16:58 ` Alex Hung
2024-11-11 12:08 ` [PATCH 2/2] drm/amd/pm: " Bhavin Sharma
1 sibling, 1 reply; 4+ messages in thread
From: Bhavin Sharma @ 2024-11-11 12:08 UTC (permalink / raw)
To: alexander.deucher
Cc: tarang.raval, Bhavin Sharma, Chaitanya Dhere, Jun Lei,
Harry Wentland, Leo Li, Rodrigo Siqueira, Christian König,
Xinhui Pan, David Airlie, Simona Vetter, Kenneth Feng,
Wenjing Liu, Roman Li, Alex Hung, Leo Ma, Jose Fernandez,
Aurabindo Pillai, Ilya Bakoulin, amd-gfx, dri-devel,
linux-kernel
The mode_422 variable is initialized to zero, making mode_422 ? 2 : 1
always false.
Since is_dsc_possible is already checked just above, there's no need to
check it again before filling out the DSC settings.
Removing this redundant check simplifies the code without affecting
functionality.
Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
---
.../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +-
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
index d8bfc85e5dcd..705ddabb5024 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
@@ -564,7 +564,7 @@ static void get_surf_rq_param(
unsigned int vp_height = 0;
unsigned int data_pitch = 0;
unsigned int meta_pitch = 0;
- unsigned int ppe = mode_422 ? 2 : 1;
+ unsigned int ppe = 1;
bool surf_linear;
bool surf_vert;
unsigned int bytes_per_element;
diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
index ebd5df1a36e8..85f6f8e43947 100644
--- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
+++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
@@ -1093,14 +1093,11 @@ static bool setup_dsc_config(
if (!is_dsc_possible)
goto done;
- // Final decission: can we do DSC or not?
- if (is_dsc_possible) {
- // Fill out the rest of DSC settings
- dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported;
- dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth;
- dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4;
- dsc_cfg->is_dp = dsc_sink_caps->is_dp;
- }
+ // Fill out the rest of DSC settings
+ dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported;
+ dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth;
+ dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4;
+ dsc_cfg->is_dp = dsc_sink_caps->is_dp;
done:
if (!is_dsc_possible)
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH 1/2] drm/amd/display: Remove redundant check
2024-11-11 12:08 ` [PATCH 1/2] drm/amd/display: Remove redundant check Bhavin Sharma
@ 2024-11-13 16:58 ` Alex Hung
0 siblings, 0 replies; 4+ messages in thread
From: Alex Hung @ 2024-11-13 16:58 UTC (permalink / raw)
To: Bhavin Sharma, alexander.deucher
Cc: tarang.raval, Chaitanya Dhere, Jun Lei, Harry Wentland, Leo Li,
Rodrigo Siqueira, Christian König, Xinhui Pan, David Airlie,
Simona Vetter, Kenneth Feng, Wenjing Liu, Roman Li, Leo Ma,
Jose Fernandez, Aurabindo Pillai, Ilya Bakoulin, amd-gfx,
dri-devel, linux-kernel
On 11/11/24 05:08, Bhavin Sharma wrote:
> The mode_422 variable is initialized to zero, making mode_422 ? 2 : 1
> always false.
>
> Since is_dsc_possible is already checked just above, there's no need to
> check it again before filling out the DSC settings.
>
> Removing this redundant check simplifies the code without affecting
> functionality.
>
> Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
> ---
> .../amd/display/dc/dml/dml1_display_rq_dlg_calc.c | 2 +-
> drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
> 2 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
> index d8bfc85e5dcd..705ddabb5024 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
> @@ -564,7 +564,7 @@ static void get_surf_rq_param(
> unsigned int vp_height = 0;
> unsigned int data_pitch = 0;
> unsigned int meta_pitch = 0;
> - unsigned int ppe = mode_422 ? 2 : 1;
> + unsigned int ppe = 1;
> bool surf_linear;
> bool surf_vert;
> unsigned int bytes_per_element;
This is fixed in amd-staging-drm-next by the following commit and it's
no longer needed.
ec680fdbb29a drm/amd/display: Remove always-false branches
> diff --git a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> index ebd5df1a36e8..85f6f8e43947 100644
> --- a/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> @@ -1093,14 +1093,11 @@ static bool setup_dsc_config(
> if (!is_dsc_possible)
> goto done;
>
> - // Final decission: can we do DSC or not?
> - if (is_dsc_possible) {
> - // Fill out the rest of DSC settings
> - dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported;
> - dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth;
> - dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4;
> - dsc_cfg->is_dp = dsc_sink_caps->is_dp;
> - }
> + // Fill out the rest of DSC settings
> + dsc_cfg->block_pred_enable = dsc_common_caps.is_block_pred_supported;
> + dsc_cfg->linebuf_depth = dsc_common_caps.lb_bit_depth;
> + dsc_cfg->version_minor = (dsc_common_caps.dsc_version & 0xf0) >> 4;
> + dsc_cfg->is_dp = dsc_sink_caps->is_dp;
>
> done:
> if (!is_dsc_possible)
This looks to me. Please revise and include this part in V2. Thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] drm/amd/pm: Remove redundant check
2024-11-11 12:08 [PATCH 0/2] Remove redundant condition check Bhavin Sharma
2024-11-11 12:08 ` [PATCH 1/2] drm/amd/display: Remove redundant check Bhavin Sharma
@ 2024-11-11 12:08 ` Bhavin Sharma
1 sibling, 0 replies; 4+ messages in thread
From: Bhavin Sharma @ 2024-11-11 12:08 UTC (permalink / raw)
To: alexander.deucher
Cc: tarang.raval, Bhavin Sharma, Chaitanya Dhere, Jun Lei,
Harry Wentland, Leo Li, Rodrigo Siqueira, Christian König,
Xinhui Pan, David Airlie, Simona Vetter, Kenneth Feng,
Wenjing Liu, Roman Li, Alex Hung, Leo Ma, Ilya Bakoulin,
Aurabindo Pillai, amd-gfx, dri-devel, linux-kernel
The check for tools_size being non-zero is redundant as tools_size is
explicitly set to a non-zero value (0x19000). Removing the if condition
simplifies the code without altering functionality.
Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
---
.../amd/pm/powerplay/smumgr/vega12_smumgr.c | 24 +++++++++----------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c
index b52ce135d84d..d3ff6a831ed5 100644
--- a/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c
+++ b/drivers/gpu/drm/amd/pm/powerplay/smumgr/vega12_smumgr.c
@@ -257,20 +257,18 @@ static int vega12_smu_init(struct pp_hwmgr *hwmgr)
priv->smu_tables.entry[TABLE_WATERMARKS].size = sizeof(Watermarks_t);
tools_size = 0x19000;
- if (tools_size) {
- ret = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,
- tools_size,
- PAGE_SIZE,
- AMDGPU_GEM_DOMAIN_VRAM,
- &priv->smu_tables.entry[TABLE_PMSTATUSLOG].handle,
- &priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr,
- &priv->smu_tables.entry[TABLE_PMSTATUSLOG].table);
- if (ret)
- goto err1;
+ ret = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,
+ tools_size,
+ PAGE_SIZE,
+ AMDGPU_GEM_DOMAIN_VRAM,
+ &priv->smu_tables.entry[TABLE_PMSTATUSLOG].handle,
+ &priv->smu_tables.entry[TABLE_PMSTATUSLOG].mc_addr,
+ &priv->smu_tables.entry[TABLE_PMSTATUSLOG].table);
+ if (ret)
+ goto err1;
- priv->smu_tables.entry[TABLE_PMSTATUSLOG].version = 0x01;
- priv->smu_tables.entry[TABLE_PMSTATUSLOG].size = tools_size;
- }
+ priv->smu_tables.entry[TABLE_PMSTATUSLOG].version = 0x01;
+ priv->smu_tables.entry[TABLE_PMSTATUSLOG].size = tools_size;
/* allocate space for AVFS Fuse table */
ret = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-13 16:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-11 12:08 [PATCH 0/2] Remove redundant condition check Bhavin Sharma
2024-11-11 12:08 ` [PATCH 1/2] drm/amd/display: Remove redundant check Bhavin Sharma
2024-11-13 16:58 ` Alex Hung
2024-11-11 12:08 ` [PATCH 2/2] drm/amd/pm: " Bhavin Sharma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®