[PATCH 18/28] drm/amd/display: Remove unnecessary DC_FP_START/DC_FP_END
Alex Hung
alex.hung at amd.com
Tue Apr 29 16:01:06 UTC 2025
On 4/29/25 09:04, Alex Deucher wrote:
> On Mon, Apr 28, 2025 at 9:57 AM Ray Wu <ray.wu at amd.com> wrote:
>>
>> From: Alex Hung <alex.hung at amd.com>
>>
>> [WHY & HOW]
>> Remove the unnecessary DC_FP_START/DC_FP_END pair to reduce time in
>> preempt_disable. It also fixes "BUG: sleeping function called from
>> invalid context" error messages because of calling kzalloc with
>> GFP_KERNEL which can sleep.
>
> Is this safe? If this function uses FP or calls a function which uses
> FP, removing these will lead to register corruption.
I checked dcn32_resource_construct again and I did not find any FP or
functions uses FP, and Aurabindo helped double check.
I also checked other dnc*_resource_construct (like 321, 35, 351, 36) and
they don't use DC_FP_START/DC_FP_END pair either.
So it should be safe to remove this pair.
>
> Alex
>
>>
>> Reviewed-by: Aurabindo Pillai <aurabindo.pillai at amd.com>
>> Signed-off-by: Alex Hung <alex.hung at amd.com>
>> Signed-off-by: Ray Wu <ray.wu at amd.com>
>> ---
>> .../gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c | 6 ------
>> 1 file changed, 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
>> index 2a59cc61ed8c..944650cb13de 100644
>> --- a/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
>> +++ b/drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c
>> @@ -2114,8 +2114,6 @@ static bool dcn32_resource_construct(
>> #define REG_STRUCT dccg_regs
>> dccg_regs_init();
>>
>> - DC_FP_START();
>> -
>> ctx->dc_bios->regs = &bios_regs;
>>
>> pool->base.res_cap = &res_cap_dcn32;
>> @@ -2501,14 +2499,10 @@ static bool dcn32_resource_construct(
>> if (ASICREV_IS_GC_11_0_3(dc->ctx->asic_id.hw_internal_rev) && (dc->config.sdpif_request_limit_words_per_umc == 0))
>> dc->config.sdpif_request_limit_words_per_umc = 16;
>>
>> - DC_FP_END();
>> -
>> return true;
>>
>> create_fail:
>>
>> - DC_FP_END();
>> -
>> dcn32_resource_destruct(pool);
>>
>> return false;
>> --
>> 2.43.0
>>
More information about the amd-gfx
mailing list