Skip to contentSkip to conversation

drm/amd/display: fix static checker warning

PATCH In review S, Shirish 2 participants 4 messages Nov 7, 2017 – Nov 10, 2017 6 messages not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 1510025307-28747-1-git-send-email-shirish.s12-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

S, Shirish

author
#2 lore raw

PATCH 1/1 drm/amd/display: fix static checker warning

From: Shirish S <[email protected]>

This patch fixes static checker warning of
"warn: cast after binop" introduced by
4d3e00dad80a: "drm/amd/display : add high part address calculation for underlay"

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
index a87e5ac..e1bdf5e 100644
@@ -1827,7 +1827,7 @@ static int fill_plane_attributes_from_fb(struct amdgpu_device *adev,
 						= lower_32_bits(fb_location);
 		plane_state->address.video_progressive.luma_addr.high_part
 						= upper_32_bits(fb_location);
-		chroma_addr = fb_location + (u64)(awidth * fb->height);
+		chroma_addr = fb_location + (u64)awidth * fb->height;
 		plane_state->address.video_progressive.chroma_addr.low_part
 						= lower_32_bits(chroma_addr);
 		plane_state->address.video_progressive.chroma_addr.high_part
@@ -2959,7 +2959,7 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
 							= lower_32_bits(afb->address);
 			plane_state->address.video_progressive.luma_addr.high_part
 							= upper_32_bits(afb->address);
-			chroma_addr = afb->address + (u64)(awidth * new_state->fb->height);
+			chroma_addr = afb->address + (u64)awidth * new_state->fb->height;
 			plane_state->address.video_progressive.chroma_addr.low_part
 							= lower_32_bits(chroma_addr);
 			plane_state->address.video_progressive.chroma_addr.high_part
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1826B46B10F7FD2BC24F0D2BF2510-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw
Quoted 26 lines · Shirish

From: Shirish S <[email protected]>

This patch fixes static checker warning of
"warn: cast after binop" introduced by
4d3e00dad80a: "drm/amd/display : add high part address calculation for underlay"

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
index a87e5ac..e1bdf5e 100644
@@ -1827,7 +1827,7 @@ static int fill_plane_attributes_from_fb(struct amdgpu_device *adev,
 						= lower_32_bits(fb_location);
 		plane_state->address.video_progressive.luma_addr.high_part
 						= upper_32_bits(fb_location);
-		chroma_addr = fb_location + (u64)(awidth * fb->height);
+		chroma_addr = fb_location + (u64)awidth * fb->height;
 		plane_state->address.video_progressive.chroma_addr.low_part
 						= lower_32_bits(chroma_addr);
 		plane_state->address.video_progressive.chroma_addr.high_part

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · line 2965

Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -2959,7 +2959,7 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
 							= lower_32_bits(afb->address);
 			plane_state->address.video_progressive.luma_addr.high_part
 							= upper_32_bits(afb->address);
-			chroma_addr = afb->address + (u64)(awidth * new_state->fb->height);
+			chroma_addr = afb->address + (u64)awidth * new_state->fb->height;
 			plane_state->address.video_progressive.chroma_addr.low_part
 							= lower_32_bits(chroma_addr);
 			plane_state->address.video_progressive.chroma_addr.high_part

This code should really be removed, since fb_location is always 0 now in this function, so the values derived from it cannot be used for anything anyway.

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 8c2e60ac-04ab-ce1e-c349-bbb5770e1406-5C7GfCeVMHo@public.gmane.org

author
#7 lore raw

PATCH 1/1 drm/amd/display: fix static checker warning

Quoted 31 lines · Michel Dänzer
Quoted 30 lines · Shirish

From: Shirish S <[email protected]>

This patch fixes static checker warning of
"warn: cast after binop" introduced by
4d3e00dad80a: "drm/amd/display : add high part address calculation for underlay"

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index a87e5ac..e1bdf5e 100644
@@ -1827,7 +1827,7 @@ static int fill_plane_attributes_from_fb(struct amdgpu_device *adev,
  						= lower_32_bits(fb_location);
  		plane_state->address.video_progressive.luma_addr.high_part
  						= upper_32_bits(fb_location);
-		chroma_addr = fb_location + (u64)(awidth * fb->height);
+		chroma_addr = fb_location + (u64)awidth * fb->height;
  		plane_state->address.video_progressive.chroma_addr.low_part
  						= lower_32_bits(chroma_addr);
  		plane_state->address.video_progressive.chroma_addr.high_part
@@ -2959,7 +2959,7 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
  							= lower_32_bits(afb->address);
  			plane_state->address.video_progressive.luma_addr.high_part
  							= upper_32_bits(afb->address);
-			chroma_addr = afb->address + (u64)(awidth * new_state->fb->height);
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · line 2965

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+			chroma_addr = afb->address + (u64)awidth * new_state->fb->height;
  			plane_state->address.video_progressive.chroma_addr.low_part
  							= lower_32_bits(chroma_addr);
  			plane_state->address.video_progressive.chroma_addr.high_part

This code should really be removed, since fb_location is always 0 now in this function, so the values derived from it cannot be used for anything anyway.

I remember Andrey had some concerns with it, if he is ok with it i can move it as a separate patch, for future bisect-ability.

Regards,
Shirish S

Quoted 2 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1826F6AF1DC0FF93C23BEE52F2540-/b2+HYfkarSCndJ3FSsNdQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#9 lore raw
Quoted 40 lines · Shirish
Quoted 31 lines · Michel Dänzer
Quoted 30 lines · Shirish

From: Shirish S <[email protected]>

This patch fixes static checker warning of
"warn: cast after binop" introduced by
4d3e00dad80a: "drm/amd/display : add high part address calculation for underlay"

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -2
index a87e5ac..e1bdf5e 100644
@@ -1827,7 +1827,7 @@ static int fill_plane_attributes_from_fb(struct amdgpu_device *adev,
  						= lower_32_bits(fb_location);
  		plane_state->address.video_progressive.luma_addr.high_part
  						= upper_32_bits(fb_location);
-		chroma_addr = fb_location + (u64)(awidth * fb->height);
+		chroma_addr = fb_location + (u64)awidth * fb->height;
  		plane_state->address.video_progressive.chroma_addr.low_part
  						= lower_32_bits(chroma_addr);
  		plane_state->address.video_progressive.chroma_addr.high_part
@@ -2959,7 +2959,7 @@ static int dm_plane_helper_prepare_fb(struct drm_plane *plane,
  							= lower_32_bits(afb->address);
  			plane_state->address.video_progressive.luma_addr.high_part
  							= upper_32_bits(afb->address);
-			chroma_addr = afb->address + (u64)(awidth * new_state->fb->height);
Quoted 8 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_plane_helper_prepare_fb(struct drm_plane *plane, · line 2965

Quoted 5 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
+			chroma_addr = afb->address + (u64)awidth * new_state->fb->height;
  			plane_state->address.video_progressive.chroma_addr.low_part
  							= lower_32_bits(chroma_addr);
  			plane_state->address.video_progressive.chroma_addr.high_part

This code should really be removed, since fb_location is always 0 now in this function, so the values derived from it cannot be used for anything anyway.

Quoted 2 lines

I remember Andrey had some concerns with it, if he is ok with it i can move it as a separate patch, for future bisect-ability.

Harry already removed this code in amd-staging-drm-next commit f5887bb33b1e ("amdgpu/dm: Remove fb_location form fill_plane_attributes").

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx