[PATCH 6/6] Revert "drm/amd/display: Drop unnecessary guard from DC resource"

Harry Wentland harry.wentland at amd.com
Mon Jun 6 18:01:35 UTC 2022



On 2022-06-06 12:17, Alex Deucher wrote:
> On Mon, Jun 6, 2022 at 10:16 AM Harry Wentland <harry.wentland at amd.com> wrote:
>>
>> On 2022-06-03 14:50, Rodrigo Siqueira wrote:
>>> This reverts commit 78baa3c4dfff4375b109bc5e19663a2f7fad1190.
>>>
>>> This commit introduced the below compilation error when using
>>> allmodconfig:
>>>
>>> error: implicit declaration of function ‘remove_hpo_dp_link_enc_from_ctx’; did you mean ‘add_hpo_dp_link_enc_to_ctx’? [-Werror=implicit-function-declaration]
>>>  2010 |   remove_hpo_dp_link_enc_from_ctx(&new_ctx->res_ctx, del_pipe, del_pipe->stream);
>>>       |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>       |   add_hpo_dp_link_enc_to_ctx
>>>
>>> Fixes: 78baa3c4dfff43 ("drm/amd/display: Drop unnecessary guard from DC resource")
>>> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
>>> ---
>>>  drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
>>> index 7357efb8b439..9bbdfcd6b3a4 100644
>>> --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
>>> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
>>> @@ -2002,6 +2002,7 @@ enum dc_status dc_remove_stream_from_ctx(
>>>       if (dc->res_pool->funcs->link_enc_unassign)
>>>               dc->res_pool->funcs->link_enc_unassign(new_ctx, del_pipe->stream);
>>>
>>> +#if defined(CONFIG_DRM_AMD_DC_DCN)
>>>       if (is_dp_128b_132b_signal(del_pipe)) {
>>>               update_hpo_dp_stream_engine_usage(
>>>                       &new_ctx->res_ctx, dc->res_pool,
>>> @@ -2009,6 +2010,7 @@ enum dc_status dc_remove_stream_from_ctx(
>>>                       false);
>>>               remove_hpo_dp_link_enc_from_ctx(&new_ctx->res_ctx, del_pipe, del_pipe->stream);
>>
>> Wouldn't a better solution be to drop the DCN guards around
>> remove_hpo_dp_link_enc_from_ctx and release_hpo_dp_link_enc?
>> Not sure why those were guarded in the first place.
> 
> They were added by me in:
> 
> commit d8e4fb9112e88d8d87ffbc38fa511e7118042d4f
> Author: Alex Deucher <alexander.deucher at amd.com>
> Date:   Wed Jun 1 22:22:07 2022 -0400
> 
>     drm/amdgpu/display: Protect some functions with CONFIG_DRM_AMD_DC_DCN
> 
>     Protect remove_hpo_dp_link_enc_from_ctx() and release_hpo_dp_link_enc()
>     with CONFIG_DRM_AMD_DC_DCN as the functions are only called from code
>     that is protected by CONFIG_DRM_AMD_DC_DCN.  Fixes build fail with
>     -Werror=unused-function.
> 
>     Fixes: 9b0e0d433f74 ("drm/amd/display: Add dependant changes for DCN32/321")
>     Reported-by: Stephen Rothwell <sfr at canb.auug.org.au>
>     Reviewed-by: Harry Wentland <harry.wentland at amd.com>
>     Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
>     Cc: Aurabindo Pillai <aurabindo.pillai at amd.com>
> 

I remember your patch was needed but don't see it now. I wonder
if someone removed the reason the guards were needed.

Harry

> Maybe they are no longer required?
> 
> Alex
> 
> 
>>
>> Harry
>>
>>>       }
>>> +#endif
>>>
>>>       if (del_pipe->stream_res.audio)
>>>               update_audio_usage(
>>



More information about the amd-gfx mailing list