From: "Kazlauskas, Nicholas" <nicholas.kazlauskas@amd.com>
To: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>,
alexander.deucher@amd.com, harry.wentland@amd.com
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu/display: fix FP handling in DCN30
Date: Fri, 13 Nov 2020 13:05:52 -0500 [thread overview]
Message-ID: <31edbdfb-156d-d10a-9f8e-1bdb44e233e9@amd.com> (raw)
In-Reply-To: <20201112220618.3610982-1-Bhawanpreet.Lakha@amd.com>
On 2020-11-12 5:06 p.m., Bhawanpreet Lakha wrote:
> From: Alex Deucher <alexander.deucher@amd.com>
>
> Adjust the FP handling to avoid nested calls.
>
> The nested calls cause the warning below
> WARNING: CPU: 3 PID: 384 at arch/x86/kernel/fpu/core.c:129 kernel_fpu_begin
>
> Fixes: 26803606c5d6 ("drm/amdgpu/display: FP fixes for DCN3.x (v4)")
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
I guess dropping the noinline is fine if we're just calling it via the
function pointer.
Regards,
Nicholas Kazlauskas
> ---
> .../drm/amd/display/dc/dcn30/dcn30_resource.c | 43 +++----------------
> 1 file changed, 6 insertions(+), 37 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
> index b379057e669c..d5c81ad55045 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn30/dcn30_resource.c
> @@ -1470,20 +1470,8 @@ int dcn30_populate_dml_pipes_from_context(
> return pipe_cnt;
> }
>
> -/*
> - * This must be noinline to ensure anything that deals with FP registers
> - * is contained within this call; previously our compiling with hard-float
> - * would result in fp instructions being emitted outside of the boundaries
> - * of the DC_FP_START/END macros, which makes sense as the compiler has no
> - * idea about what is wrapped and what is not
> - *
> - * This is largely just a workaround to avoid breakage introduced with 5.6,
> - * ideally all fp-using code should be moved into its own file, only that
> - * should be compiled with hard-float, and all code exported from there
> - * should be strictly wrapped with DC_FP_START/END
> - */
> -static noinline void dcn30_populate_dml_writeback_from_context_fp(
> - struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes)
> +void dcn30_populate_dml_writeback_from_context(
> + struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes)
> {
> int pipe_cnt, i, j;
> double max_calc_writeback_dispclk;
> @@ -1571,14 +1559,6 @@ static noinline void dcn30_populate_dml_writeback_from_context_fp(
>
> }
>
> -void dcn30_populate_dml_writeback_from_context(
> - struct dc *dc, struct resource_context *res_ctx, display_e2e_pipe_params_st *pipes)
> -{
> - DC_FP_START();
> - dcn30_populate_dml_writeback_from_context_fp(dc, res_ctx, pipes);
> - DC_FP_END();
> -}
> -
> unsigned int dcn30_calc_max_scaled_time(
> unsigned int time_per_pixel,
> enum mmhubbub_wbif_mode mode,
> @@ -1977,7 +1957,7 @@ static struct pipe_ctx *dcn30_find_split_pipe(
> return pipe;
> }
>
> -static bool dcn30_internal_validate_bw(
> +static noinline bool dcn30_internal_validate_bw(
> struct dc *dc,
> struct dc_state *context,
> display_e2e_pipe_params_st *pipes,
> @@ -1999,6 +1979,7 @@ static bool dcn30_internal_validate_bw(
>
> pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, fast_validate);
>
> + DC_FP_START();
> if (!pipe_cnt) {
> out = true;
> goto validate_out;
> @@ -2222,6 +2203,7 @@ static bool dcn30_internal_validate_bw(
> out = false;
>
> validate_out:
> + DC_FP_END();
> return out;
> }
>
> @@ -2404,7 +2386,7 @@ void dcn30_calculate_wm_and_dlg(
> DC_FP_END();
> }
>
> -static noinline bool dcn30_validate_bandwidth_fp(struct dc *dc,
> +bool dcn30_validate_bandwidth(struct dc *dc,
> struct dc_state *context,
> bool fast_validate)
> {
> @@ -2455,19 +2437,6 @@ static noinline bool dcn30_validate_bandwidth_fp(struct dc *dc,
> return out;
> }
>
> -bool dcn30_validate_bandwidth(struct dc *dc,
> - struct dc_state *context,
> - bool fast_validate)
> -{
> - bool out;
> -
> - DC_FP_START();
> - out = dcn30_validate_bandwidth_fp(dc, context, fast_validate);
> - DC_FP_END();
> -
> - return out;
> -}
> -
> static noinline void get_optimal_dcfclk_fclk_for_uclk(unsigned int uclk_mts,
> unsigned int *optimal_dcfclk,
> unsigned int *optimal_fclk)
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
prev parent reply other threads:[~2020-11-13 18:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 22:06 [PATCH] drm/amdgpu/display: fix FP handling in DCN30 Bhawanpreet Lakha
2020-11-13 14:33 ` Alex Deucher
2020-11-13 18:05 ` Kazlauskas, Nicholas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31edbdfb-156d-d10a-9f8e-1bdb44e233e9@amd.com \
--to=nicholas.kazlauskas@amd.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).