linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: drm/amd/display: Restructuring and cleaning up DML
       [not found] <20171118000201.31E1B21C31@pdx-korg-gitolite-1.ci.codeaurora.org>
@ 2017-11-29  3:05 ` Dave Jones
  2017-11-29  3:34   ` Cheng, Tony
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jones @ 2017-11-29  3:05 UTC (permalink / raw)
  To: Linux Kernel Mailing List
  Cc: Dmytro Laktyushkin, Tony Cheng, Harry Wentland, Alex Deucher

On Sat, Nov 18, 2017 at 12:02:01AM +0000, Linux Kernel wrote:
 > Web:        https://git.kernel.org/torvalds/c/6d04ee9dc10149db842d41de66eca201c9d91b60
 > Commit:     6d04ee9dc10149db842d41de66eca201c9d91b60
 > Parent:     19b7fe4a48efbe0f7e8c496b040c4eb16ff02313
 > Refname:    refs/heads/master
 > Author:     Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
 > AuthorDate: Wed Aug 23 16:43:17 2017 -0400
 > Committer:  Alex Deucher <alexander.deucher@amd.com>
 > CommitDate: Sat Oct 21 16:45:24 2017 -0400
 > 
 >     drm/amd/display: Restructuring and cleaning up DML
 >     
 >     Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
 >     Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
 >     Acked-by: Harry Wentland <Harry.Wentland@amd.com>
 >     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 > ---


 > 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 a18474437990..b6abe0f3bb15 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,20 +27,36 @@
 >  
 >  float dcn_bw_mod(const float arg1, const float arg2)
 >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 - arg1 * ((int) (arg1 / arg2));
 >  }
 >  
 >  float dcn_bw_min2(const float arg1, const float arg2)
 >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 < arg2 ? arg1 : arg2;
 >  }
 >  
 >  unsigned int dcn_bw_max(const unsigned int arg1, const unsigned int arg2)
 >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 > arg2 ? arg1 : arg2;
 >  }
 >  float dcn_bw_max2(const float arg1, const float arg2)
 >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 > arg2 ? arg1 : arg2;
 >  }

This looks really, really bizarre. What was the intention here ?

(This, and a bunch of other stuff in this driver picked up by Coverity,
 sign up at scan.coverity.com if you want access, and I'll approve.)

	Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: drm/amd/display: Restructuring and cleaning up DML
  2017-11-29  3:05 ` drm/amd/display: Restructuring and cleaning up DML Dave Jones
@ 2017-11-29  3:34   ` Cheng, Tony
  2017-11-29 15:22     ` Harry Wentland
  0 siblings, 1 reply; 3+ messages in thread
From: Cheng, Tony @ 2017-11-29  3:34 UTC (permalink / raw)
  To: Dave Jones, Linux Kernel Mailing List
  Cc: Laktyushkin, Dmytro, Wentland, Harry, Deucher, Alexander

That code is to handle NAN (not a number) in float.  Unfortunately our HW architect decided NAN is one of the way to determine if something isn't supported.  We have feed this back to our HW team and they will look into improving this for next next generation.

-----Original Message-----
From: Dave Jones [mailto:davej@codemonkey.org.uk] 
Sent: Tuesday, November 28, 2017 10:06 PM
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Laktyushkin, Dmytro <Dmytro.Laktyushkin@amd.com>; Cheng, Tony <Tony.Cheng@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: Re: drm/amd/display: Restructuring and cleaning up DML

On Sat, Nov 18, 2017 at 12:02:01AM +0000, Linux Kernel wrote:
 > Web:        https://git.kernel.org/torvalds/c/6d04ee9dc10149db842d41de66eca201c9d91b60
 > Commit:     6d04ee9dc10149db842d41de66eca201c9d91b60
 > Parent:     19b7fe4a48efbe0f7e8c496b040c4eb16ff02313
 > Refname:    refs/heads/master
 > Author:     Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
 > AuthorDate: Wed Aug 23 16:43:17 2017 -0400  > Committer:  Alex Deucher <alexander.deucher@amd.com>  > CommitDate: Sat Oct 21 16:45:24 2017 -0400  > 
 >     drm/amd/display: Restructuring and cleaning up DML
 >     
 >     Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
 >     Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
 >     Acked-by: Harry Wentland <Harry.Wentland@amd.com>
 >     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
 > ---


 > 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 a18474437990..b6abe0f3bb15 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,20 +27,36 @@
 >
 >  float dcn_bw_mod(const float arg1, const float arg2)  >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 - arg1 * ((int) (arg1 / arg2));
 >  }
 >
 >  float dcn_bw_min2(const float arg1, const float arg2)  >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 < arg2 ? arg1 : arg2;
 >  }
 >
 >  unsigned int dcn_bw_max(const unsigned int arg1, const unsigned int arg2)  >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 > arg2 ? arg1 : arg2;
 >  }
 >  float dcn_bw_max2(const float arg1, const float arg2)  >  {
 > +	if (arg1 != arg1)
 > +		return arg2;
 > +	if (arg2 != arg2)
 > +		return arg1;
 >  	return arg1 > arg2 ? arg1 : arg2;
 >  }

This looks really, really bizarre. What was the intention here ?

(This, and a bunch of other stuff in this driver picked up by Coverity,  sign up at scan.coverity.com if you want access, and I'll approve.)

	Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: drm/amd/display: Restructuring and cleaning up DML
  2017-11-29  3:34   ` Cheng, Tony
@ 2017-11-29 15:22     ` Harry Wentland
  0 siblings, 0 replies; 3+ messages in thread
From: Harry Wentland @ 2017-11-29 15:22 UTC (permalink / raw)
  To: Cheng, Tony, Dave Jones, Linux Kernel Mailing List
  Cc: Laktyushkin, Dmytro, Deucher, Alexander

On 2017-11-28 10:34 PM, Cheng, Tony wrote:
> That code is to handle NAN (not a number) in float.  Unfortunately our HW architect decided NAN is one of the way to determine if something isn't supported.  We have feed this back to our HW team and they will look into improving this for next next generation.
> 

We should probably macro this check to an isNaN(number) macro and remove the check for dcn_bw_max which uses unsigned int.

We should also explain that these files are coming pretty much straight from HW teams and should be treated as HW gospel.

I'll send patches.

Harry

> -----Original Message-----
> From: Dave Jones [mailto:davej@codemonkey.org.uk] 
> Sent: Tuesday, November 28, 2017 10:06 PM
> To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
> Cc: Laktyushkin, Dmytro <Dmytro.Laktyushkin@amd.com>; Cheng, Tony <Tony.Cheng@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>
> Subject: Re: drm/amd/display: Restructuring and cleaning up DML
> 
> On Sat, Nov 18, 2017 at 12:02:01AM +0000, Linux Kernel wrote:
>  > Web:        https://git.kernel.org/torvalds/c/6d04ee9dc10149db842d41de66eca201c9d91b60
>  > Commit:     6d04ee9dc10149db842d41de66eca201c9d91b60
>  > Parent:     19b7fe4a48efbe0f7e8c496b040c4eb16ff02313
>  > Refname:    refs/heads/master
>  > Author:     Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
>  > AuthorDate: Wed Aug 23 16:43:17 2017 -0400  > Committer:  Alex Deucher <alexander.deucher@amd.com>  > CommitDate: Sat Oct 21 16:45:24 2017 -0400  > 
>  >     drm/amd/display: Restructuring and cleaning up DML
>  >     
>  >     Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
>  >     Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
>  >     Acked-by: Harry Wentland <Harry.Wentland@amd.com>
>  >     Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>  > ---
> 
> 
>  > 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 a18474437990..b6abe0f3bb15 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,20 +27,36 @@
>  >
>  >  float dcn_bw_mod(const float arg1, const float arg2)  >  {
>  > +	if (arg1 != arg1)
>  > +		return arg2;
>  > +	if (arg2 != arg2)
>  > +		return arg1;
>  >  	return arg1 - arg1 * ((int) (arg1 / arg2));
>  >  }
>  >
>  >  float dcn_bw_min2(const float arg1, const float arg2)  >  {
>  > +	if (arg1 != arg1)
>  > +		return arg2;
>  > +	if (arg2 != arg2)
>  > +		return arg1;
>  >  	return arg1 < arg2 ? arg1 : arg2;
>  >  }
>  >
>  >  unsigned int dcn_bw_max(const unsigned int arg1, const unsigned int arg2)  >  {
>  > +	if (arg1 != arg1)
>  > +		return arg2;
>  > +	if (arg2 != arg2)
>  > +		return arg1;
>  >  	return arg1 > arg2 ? arg1 : arg2;
>  >  }
>  >  float dcn_bw_max2(const float arg1, const float arg2)  >  {
>  > +	if (arg1 != arg1)
>  > +		return arg2;
>  > +	if (arg2 != arg2)
>  > +		return arg1;
>  >  	return arg1 > arg2 ? arg1 : arg2;
>  >  }
> 
> This looks really, really bizarre. What was the intention here ?
> 
> (This, and a bunch of other stuff in this driver picked up by Coverity,  sign up at scan.coverity.com if you want access, and I'll approve.)
> 
> 	Dave
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-29 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20171118000201.31E1B21C31@pdx-korg-gitolite-1.ci.codeaurora.org>
2017-11-29  3:05 ` drm/amd/display: Restructuring and cleaning up DML Dave Jones
2017-11-29  3:34   ` Cheng, Tony
2017-11-29 15:22     ` Harry Wentland

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).