* [PATCH v2 0/2] Remove redundant check
@ 2024-11-14 15:11 Bhavin Sharma
2024-11-14 15:11 ` [PATCH v2 1/2] drm/amd/display: remove redundant is_dsc_possible check Bhavin Sharma
2024-11-14 15:11 ` [PATCH v2 2/2] drm/amd/pm: remove redundant tools_size check Bhavin Sharma
0 siblings, 2 replies; 6+ messages in thread
From: Bhavin Sharma @ 2024-11-14 15:11 UTC (permalink / raw)
To: alexander.deucher, alex.hung
Cc: Bhavin Sharma, Harry Wentland, Leo Li, Rodrigo Siqueira,
Christian König, Xinhui Pan, David Airlie, Simona Vetter,
Kenneth Feng, Wenjing Liu, Leo Ma, Roman Li, Ilya Bakoulin,
Jose Fernandez, Aurabindo Pillai, amd-gfx, dri-devel,
linux-kernel
Change in V2:
in patch 1/2:
- Remove mode_422 condition check because that
is fixed in amd-staging-drm-next
Link for v1: https://lore.kernel.org/dri-devel/20241111120900.63869-1-bhavin.sharma@siliconsignals.io/T/#t
Bhavin Sharma (2):
drm/amd/display: remove redundant is_dsc_possible check
drm/amd/pm: remove redundant tools_size check
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 ++++------
.../amd/pm/powerplay/smumgr/vega12_smumgr.c | 24 +++++++++----------
2 files changed, 16 insertions(+), 21 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/2] drm/amd/display: remove redundant is_dsc_possible check
2024-11-14 15:11 [PATCH v2 0/2] Remove redundant check Bhavin Sharma
@ 2024-11-14 15:11 ` Bhavin Sharma
2024-11-14 15:21 ` Christian König
2024-11-14 15:11 ` [PATCH v2 2/2] drm/amd/pm: remove redundant tools_size check Bhavin Sharma
1 sibling, 1 reply; 6+ messages in thread
From: Bhavin Sharma @ 2024-11-14 15:11 UTC (permalink / raw)
To: alexander.deucher, alex.hung
Cc: Bhavin Sharma, Harry Wentland, Leo Li, Rodrigo Siqueira,
Christian König, Xinhui Pan, David Airlie, Simona Vetter,
Kenneth Feng, Wenjing Liu, Chris Park, Roman Li, Leo Ma,
Ryan Seto, Jose Fernandez, Ilya Bakoulin, Aurabindo Pillai,
amd-gfx, dri-devel, linux-kernel
Since is_dsc_possible is already checked just above, there's no need to
check it again before filling out the DSC settings.
Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
---
drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
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] 6+ messages in thread
* [PATCH v2 2/2] drm/amd/pm: remove redundant tools_size check
2024-11-14 15:11 [PATCH v2 0/2] Remove redundant check Bhavin Sharma
2024-11-14 15:11 ` [PATCH v2 1/2] drm/amd/display: remove redundant is_dsc_possible check Bhavin Sharma
@ 2024-11-14 15:11 ` Bhavin Sharma
2024-11-14 21:18 ` Alex Deucher
1 sibling, 1 reply; 6+ messages in thread
From: Bhavin Sharma @ 2024-11-14 15:11 UTC (permalink / raw)
To: alexander.deucher, alex.hung
Cc: Bhavin Sharma, Harry Wentland, Leo Li, Rodrigo Siqueira,
Christian König, Xinhui Pan, David Airlie, Simona Vetter,
Kenneth Feng, Wenjing Liu, Leo Ma, Ryan Seto, Jose Fernandez,
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] 6+ messages in thread
* Re: [PATCH v2 1/2] drm/amd/display: remove redundant is_dsc_possible check
2024-11-14 15:11 ` [PATCH v2 1/2] drm/amd/display: remove redundant is_dsc_possible check Bhavin Sharma
@ 2024-11-14 15:21 ` Christian König
2024-11-14 21:20 ` Alex Deucher
0 siblings, 1 reply; 6+ messages in thread
From: Christian König @ 2024-11-14 15:21 UTC (permalink / raw)
To: Bhavin Sharma, alexander.deucher, alex.hung
Cc: Harry Wentland, Leo Li, Rodrigo Siqueira, Xinhui Pan,
David Airlie, Simona Vetter, Kenneth Feng, Wenjing Liu,
Chris Park, Roman Li, Leo Ma, Ryan Seto, Jose Fernandez,
Ilya Bakoulin, Aurabindo Pillai, amd-gfx, dri-devel,
linux-kernel
Am 14.11.24 um 16:11 schrieb Bhavin Sharma:
> Since is_dsc_possible is already checked just above, there's no need to
> check it again before filling out the DSC settings.
>
> Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
> ---
> drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> 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
While at it you should probably replace the // style comment with /* */.
Apart from that looks good to me.
Christian.
> + 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)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] drm/amd/pm: remove redundant tools_size check
2024-11-14 15:11 ` [PATCH v2 2/2] drm/amd/pm: remove redundant tools_size check Bhavin Sharma
@ 2024-11-14 21:18 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2024-11-14 21:18 UTC (permalink / raw)
To: Bhavin Sharma
Cc: alexander.deucher, alex.hung, Harry Wentland, Leo Li,
Rodrigo Siqueira, Christian König, Xinhui Pan, David Airlie,
Simona Vetter, Kenneth Feng, Wenjing Liu, Leo Ma, Ryan Seto,
Jose Fernandez, Ilya Bakoulin, Aurabindo Pillai, amd-gfx,
dri-devel, linux-kernel
Applied. Thanks!
On Thu, Nov 14, 2024 at 10:12 AM Bhavin Sharma
<bhavin.sharma@siliconsignals.io> wrote:
>
> 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] 6+ messages in thread
* Re: [PATCH v2 1/2] drm/amd/display: remove redundant is_dsc_possible check
2024-11-14 15:21 ` Christian König
@ 2024-11-14 21:20 ` Alex Deucher
0 siblings, 0 replies; 6+ messages in thread
From: Alex Deucher @ 2024-11-14 21:20 UTC (permalink / raw)
To: Christian König
Cc: Bhavin Sharma, alexander.deucher, alex.hung, Harry Wentland,
Leo Li, Rodrigo Siqueira, Xinhui Pan, David Airlie,
Simona Vetter, Kenneth Feng, Wenjing Liu, Chris Park, Roman Li,
Leo Ma, Ryan Seto, Jose Fernandez, Ilya Bakoulin,
Aurabindo Pillai, amd-gfx, dri-devel, linux-kernel
On Thu, Nov 14, 2024 at 10:21 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 14.11.24 um 16:11 schrieb Bhavin Sharma:
> > Since is_dsc_possible is already checked just above, there's no need to
> > check it again before filling out the DSC settings.
> >
> > Signed-off-by: Bhavin Sharma <bhavin.sharma@siliconsignals.io>
> > ---
> > drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c | 13 +++++--------
> > 1 file changed, 5 insertions(+), 8 deletions(-)
> >
> > 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
>
> While at it you should probably replace the // style comment with /* */.
>
> Apart from that looks good to me.
Fixed up locally and applied.
Thanks,
Alex
>
> Christian.
>
> > + 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)
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-11-14 21:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-14 15:11 [PATCH v2 0/2] Remove redundant check Bhavin Sharma
2024-11-14 15:11 ` [PATCH v2 1/2] drm/amd/display: remove redundant is_dsc_possible check Bhavin Sharma
2024-11-14 15:21 ` Christian König
2024-11-14 21:20 ` Alex Deucher
2024-11-14 15:11 ` [PATCH v2 2/2] drm/amd/pm: remove redundant tools_size check Bhavin Sharma
2024-11-14 21:18 ` Alex Deucher
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®