linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: Junk code
@ 2022-04-04 23:33 Grigory Vasilyev
  2022-04-05 13:56 ` Alex Deucher
  0 siblings, 1 reply; 2+ messages in thread
From: Grigory Vasilyev @ 2022-04-04 23:33 UTC (permalink / raw)
  To: Rodrigo Siqueira, Melissa Wen
  Cc: Grigory Vasilyev, Alex Deucher, Christian König, Pan,
	Xinhui, David Airlie, Daniel Vetter, Harry Wentland,
	Claudio Suarez, amd-gfx, dri-devel, linux-kernel

Variable igp_lane_info always is 0. 0 & any value = 0 and false.
In this way, all сonditional statements will false.
Therefore, it is not clear what this code does.

Signed-off-by: Grigory Vasilyev <h0tc0d3@gmail.com>
---
 .../gpu/drm/amd/amdgpu/atombios_encoders.c    | 21 -------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
index 2b0cc793291c..100bad2f5901 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
@@ -769,7 +769,6 @@ amdgpu_atombios_encoder_setup_dig_transmitter(struct drm_encoder *encoder, int a
 	int dp_clock = 0;
 	int dp_lane_count = 0;
 	int connector_object_id = 0;
-	int igp_lane_info = 0;
 	int dig_encoder = dig->dig_encoder;
 	int hpd_id = AMDGPU_HPD_NONE;
 
@@ -852,26 +851,6 @@ amdgpu_atombios_encoder_setup_dig_transmitter(struct drm_encoder *encoder, int a
 			else
 				args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER;
 
-			if ((adev->flags & AMD_IS_APU) &&
-			    (amdgpu_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_UNIPHY)) {
-				if (is_dp ||
-				    !amdgpu_dig_monitor_is_duallink(encoder, amdgpu_encoder->pixel_clock)) {
-					if (igp_lane_info & 0x1)
-						args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_3;
-					else if (igp_lane_info & 0x2)
-						args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_4_7;
-					else if (igp_lane_info & 0x4)
-						args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_11;
-					else if (igp_lane_info & 0x8)
-						args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_12_15;
-				} else {
-					if (igp_lane_info & 0x3)
-						args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_7;
-					else if (igp_lane_info & 0xc)
-						args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_15;
-				}
-			}
-
 			if (dig->linkb)
 				args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKB;
 			else
-- 
2.35.1


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

* Re: [PATCH] drm/amdgpu: Junk code
  2022-04-04 23:33 [PATCH] drm/amdgpu: Junk code Grigory Vasilyev
@ 2022-04-05 13:56 ` Alex Deucher
  0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2022-04-05 13:56 UTC (permalink / raw)
  To: Grigory Vasilyev
  Cc: Rodrigo Siqueira, Melissa Wen, Pan, Xinhui, LKML, amd-gfx list,
	David Airlie, Claudio Suarez, Maling list - DRI developers,
	Alex Deucher, Christian König

On Tue, Apr 5, 2022 at 5:07 AM Grigory Vasilyev <h0tc0d3@gmail.com> wrote:
>
> Variable igp_lane_info always is 0. 0 & any value = 0 and false.
> In this way, all сonditional statements will false.
> Therefore, it is not clear what this code does.

It was leftover from when the code was ported from radeon.  The igp
lane info was available from the vbios on older APUs.  It's not
relevant on any asics supported by amdgpu.  I've applied the patch and
clarified the commit message.

Thanks,

Alex

>
> Signed-off-by: Grigory Vasilyev <h0tc0d3@gmail.com>
> ---
>  .../gpu/drm/amd/amdgpu/atombios_encoders.c    | 21 -------------------
>  1 file changed, 21 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> index 2b0cc793291c..100bad2f5901 100644
> --- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> +++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
> @@ -769,7 +769,6 @@ amdgpu_atombios_encoder_setup_dig_transmitter(struct drm_encoder *encoder, int a
>         int dp_clock = 0;
>         int dp_lane_count = 0;
>         int connector_object_id = 0;
> -       int igp_lane_info = 0;
>         int dig_encoder = dig->dig_encoder;
>         int hpd_id = AMDGPU_HPD_NONE;
>
> @@ -852,26 +851,6 @@ amdgpu_atombios_encoder_setup_dig_transmitter(struct drm_encoder *encoder, int a
>                         else
>                                 args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER;
>
> -                       if ((adev->flags & AMD_IS_APU) &&
> -                           (amdgpu_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_UNIPHY)) {
> -                               if (is_dp ||
> -                                   !amdgpu_dig_monitor_is_duallink(encoder, amdgpu_encoder->pixel_clock)) {
> -                                       if (igp_lane_info & 0x1)
> -                                               args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_3;
> -                                       else if (igp_lane_info & 0x2)
> -                                               args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_4_7;
> -                                       else if (igp_lane_info & 0x4)
> -                                               args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_11;
> -                                       else if (igp_lane_info & 0x8)
> -                                               args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_12_15;
> -                               } else {
> -                                       if (igp_lane_info & 0x3)
> -                                               args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_7;
> -                                       else if (igp_lane_info & 0xc)
> -                                               args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_15;
> -                               }
> -                       }
> -
>                         if (dig->linkb)
>                                 args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKB;
>                         else
> --
> 2.35.1
>

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

end of thread, other threads:[~2022-04-06  0:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 23:33 [PATCH] drm/amdgpu: Junk code Grigory Vasilyev
2022-04-05 13:56 ` Alex Deucher

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