[PATCH] drm/amd/display: Add comment for NaN checks in DCN calcs

Alex Deucher alexdeucher at gmail.com
Wed Oct 11 16:53:50 UTC 2017


On Wed, Oct 11, 2017 at 10:55 AM, Harry Wentland <harry.wentland at amd.com> wrote:
> This is confusing as-is and really needs a comment.
>
> Signed-off-by: Harry Wentland <harry.wentland at amd.com>

Acked-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c
> index b6abe0f3bb15..f95dc4ff9a23 100644
> --- a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c
> +++ b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calc_math.c
> @@ -27,6 +27,7 @@
>
>  float dcn_bw_mod(const float arg1, const float arg2)
>  {
> +       /* NaN checks */
>         if (arg1 != arg1)
>                 return arg2;
>         if (arg2 != arg2)
> @@ -36,6 +37,7 @@ float dcn_bw_mod(const float arg1, const float arg2)
>
>  float dcn_bw_min2(const float arg1, const float arg2)
>  {
> +       /* NaN checks */
>         if (arg1 != arg1)
>                 return arg2;
>         if (arg2 != arg2)
> @@ -45,6 +47,7 @@ float dcn_bw_min2(const float arg1, const float arg2)
>
>  unsigned int dcn_bw_max(const unsigned int arg1, const unsigned int arg2)
>  {
> +       /* NaN checks */
>         if (arg1 != arg1)
>                 return arg2;
>         if (arg2 != arg2)
> @@ -53,6 +56,7 @@ unsigned int dcn_bw_max(const unsigned int arg1, const unsigned int arg2)
>  }
>  float dcn_bw_max2(const float arg1, const float arg2)
>  {
> +       /* NaN checks */
>         if (arg1 != arg1)
>                 return arg2;
>         if (arg2 != arg2)
> --
> 2.14.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list