[PATCH] drm/amd/display: fix compilation error due to shifting negative value

2023-06-03 Thread GONG, Ruiqi
Currently compiling linux-next with allmodconfig triggers the following
error:

./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function 
‘dc_fixpt_truncate’:
./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:528:22: error: 
left shift of negative value [-Werror=shift-negative-value]
  528 |  arg.value &= (~0LL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - 
frac_bits);
  |  ^~

Use `unsigned long long` instead.

Signed-off-by: GONG, Ruiqi 
---
 drivers/gpu/drm/amd/display/include/fixed31_32.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/include/fixed31_32.h 
b/drivers/gpu/drm/amd/display/include/fixed31_32.h
index ece97ae0e826..d4cf7ead1d87 100644
--- a/drivers/gpu/drm/amd/display/include/fixed31_32.h
+++ b/drivers/gpu/drm/amd/display/include/fixed31_32.h
@@ -525,7 +525,7 @@ static inline struct fixed31_32 dc_fixpt_truncate(struct 
fixed31_32 arg, unsigne
 
if (negative)
arg.value = -arg.value;
-   arg.value &= (~0LL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - 
frac_bits);
+   arg.value &= (~0ULL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - 
frac_bits);
if (negative)
arg.value = -arg.value;
return arg;
-- 
2.25.1



Re: [PATCH] drm/amd/display: fix compilation error due to shifting negative value

2023-06-02 Thread Hamza Mahfooz

On 6/2/23 06:12, GONG, Ruiqi wrote:

Currently compiling linux-next with allmodconfig triggers the following
error:

./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h: In function 
‘dc_fixpt_truncate’:
./drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:528:22: error: 
left shift of negative value [-Werror=shift-negative-value]
   528 |  arg.value &= (~0LL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - 
frac_bits);
   |  ^~

Use `unsigned long long` instead.

Signed-off-by: GONG, Ruiqi 


Applied, thanks!


---
  drivers/gpu/drm/amd/display/include/fixed31_32.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/include/fixed31_32.h 
b/drivers/gpu/drm/amd/display/include/fixed31_32.h
index ece97ae0e826..d4cf7ead1d87 100644
--- a/drivers/gpu/drm/amd/display/include/fixed31_32.h
+++ b/drivers/gpu/drm/amd/display/include/fixed31_32.h
@@ -525,7 +525,7 @@ static inline struct fixed31_32 dc_fixpt_truncate(struct 
fixed31_32 arg, unsigne
  
  	if (negative)

arg.value = -arg.value;
-   arg.value &= (~0LL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - 
frac_bits);
+   arg.value &= (~0ULL) << (FIXED31_32_BITS_PER_FRACTIONAL_PART - 
frac_bits);
if (negative)
arg.value = -arg.value;
return arg;

--
Hamza



Re: [PATCH] drm/amd/display: fix compilation error

2019-06-13 Thread Alex Deucher
On Thu, Jun 13, 2019 at 2:42 PM Sam Ravnborg  wrote:
>
> Hi Alex.
>
> On Wed, Jun 12, 2019 at 10:35:26PM -0400, Alex Deucher wrote:
> > On Wed, Jun 12, 2019 at 10:34 PM Hariprasad Kelam
> >  wrote:
> > >
> > > this patch fixes below compilation error
> > >
> > > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In
> > > function ‘dcn10_apply_ctx_for_surface’:
> > > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2378:3:
> > > error: implicit declaration of function ‘udelay’
> > > [-Werror=implicit-function-declaration]
> > >udelay(underflow_check_delay_us);
> > >
> > > Signed-off-by: Hariprasad Kelam 
>
> Am I right in assuming you took this patch?
>
> I expect that new code using udelay was added to the amd tree,
> and when merged with drm-misc-next it failed, because drm-misc-next no
> longer had drmP.h included so no implicit include of delay.h
>
> The root cause was that my original patchset should have been based
> on the amd tree, and applied there :-(

No worries.  I've picked it up.

Alex
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amd/display: fix compilation error

2019-06-13 Thread Sam Ravnborg
Hi Alex.

On Wed, Jun 12, 2019 at 10:35:26PM -0400, Alex Deucher wrote:
> On Wed, Jun 12, 2019 at 10:34 PM Hariprasad Kelam
>  wrote:
> >
> > this patch fixes below compilation error
> >
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In
> > function ‘dcn10_apply_ctx_for_surface’:
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2378:3:
> > error: implicit declaration of function ‘udelay’
> > [-Werror=implicit-function-declaration]
> >udelay(underflow_check_delay_us);
> >
> > Signed-off-by: Hariprasad Kelam 

Am I right in assuming you took this patch?

I expect that new code using udelay was added to the amd tree,
and when merged with drm-misc-next it failed, because drm-misc-next no
longer had drmP.h included so no implicit include of delay.h

The root cause was that my original patchset should have been based
on the amd tree, and applied there :-(

Sam
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amd/display: fix compilation error

2019-06-13 Thread Daniel Vetter
On Thu, Jun 13, 2019 at 08:18:54AM +0530, Hariprasad Kelam wrote:
> On Wed, Jun 12, 2019 at 10:35:26PM -0400, Alex Deucher wrote:
> > On Wed, Jun 12, 2019 at 10:34 PM Hariprasad Kelam
> >  wrote:
> > >
> > > this patch fixes below compilation error
> > >
> > > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In
> > > function ‘dcn10_apply_ctx_for_surface’:
> > > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2378:3:
> > > error: implicit declaration of function ‘udelay’
> > > [-Werror=implicit-function-declaration]
> > >udelay(underflow_check_delay_us);
> > >
> > > Signed-off-by: Hariprasad Kelam 
> > 
> > What branch is this patch based on?
> > 
> > Alex
> 
> Hi Alex,
> 
> It is on linux-next

drm-misc-next has Sam's header cleanup. I guess we pull linux/delay.h in
implicitly somewhere, but not for all configs.
-Daniel

> 
> Thanks,
> Hariprasad k
> > > ---
> > >  drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c 
> > > b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> > > index d2352949..1ac9a4f 100644
> > > --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> > > +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> > > @@ -23,6 +23,7 @@
> > >   *
> > >   */
> > >
> > > +#include 
> > >  #include "dm_services.h"
> > >  #include "core_types.h"
> > >  #include "resource.h"
> > > --
> > > 2.7.4
> > >
> > > ___
> > > amd-gfx mailing list
> > > amd-...@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[PATCH] drm/amd/display: fix compilation error

2019-06-13 Thread Hariprasad Kelam
this patch fixes below compilation error

drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In
function ‘dcn10_apply_ctx_for_surface’:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2378:3:
error: implicit declaration of function ‘udelay’
[-Werror=implicit-function-declaration]
   udelay(underflow_check_delay_us);

Signed-off-by: Hariprasad Kelam 
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index d2352949..1ac9a4f 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -23,6 +23,7 @@
  *
  */
 
+#include 
 #include "dm_services.h"
 #include "core_types.h"
 #include "resource.h"
-- 
2.7.4

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amd/display: fix compilation error

2019-06-13 Thread Hariprasad Kelam
On Wed, Jun 12, 2019 at 10:35:26PM -0400, Alex Deucher wrote:
> On Wed, Jun 12, 2019 at 10:34 PM Hariprasad Kelam
>  wrote:
> >
> > this patch fixes below compilation error
> >
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In
> > function ‘dcn10_apply_ctx_for_surface’:
> > drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2378:3:
> > error: implicit declaration of function ‘udelay’
> > [-Werror=implicit-function-declaration]
> >udelay(underflow_check_delay_us);
> >
> > Signed-off-by: Hariprasad Kelam 
> 
> What branch is this patch based on?
> 
> Alex

Hi Alex,

It is on linux-next

Thanks,
Hariprasad k
> > ---
> >  drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c 
> > b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> > index d2352949..1ac9a4f 100644
> > --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> > +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> > @@ -23,6 +23,7 @@
> >   *
> >   */
> >
> > +#include 
> >  #include "dm_services.h"
> >  #include "core_types.h"
> >  #include "resource.h"
> > --
> > 2.7.4
> >
> > ___
> > amd-gfx mailing list
> > amd-...@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH] drm/amd/display: fix compilation error

2019-06-12 Thread Alex Deucher
On Wed, Jun 12, 2019 at 10:34 PM Hariprasad Kelam
 wrote:
>
> this patch fixes below compilation error
>
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c: In
> function ‘dcn10_apply_ctx_for_surface’:
> drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_hw_sequencer.c:2378:3:
> error: implicit declaration of function ‘udelay’
> [-Werror=implicit-function-declaration]
>udelay(underflow_check_delay_us);
>
> Signed-off-by: Hariprasad Kelam 

What branch is this patch based on?

Alex

> ---
>  drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c 
> b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> index d2352949..1ac9a4f 100644
> --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
> @@ -23,6 +23,7 @@
>   *
>   */
>
> +#include 
>  #include "dm_services.h"
>  #include "core_types.h"
>  #include "resource.h"
> --
> 2.7.4
>
> ___
> amd-gfx mailing list
> amd-...@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel