From: Alex Deucher <alexdeucher@gmail.com> To: Grigory Vasilyev <h0tc0d3@gmail.com> Cc: "David Airlie" <airlied@linux.ie>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, "Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>, LKML <linux-kernel@vger.kernel.org>, "amd-gfx list" <amd-gfx@lists.freedesktop.org>, "Melissa Wen" <mwen@igalia.com>, "Claudio Suarez" <cssk@net-c.es>, "Maling list - DRI developers" <dri-devel@lists.freedesktop.org>, "Alex Deucher" <alexander.deucher@amd.com>, "Christian König" <christian.koenig@amd.com> Subject: Re: [PATCH] drm/amdgpu: Junk code Date: Tue, 5 Apr 2022 09:56:10 -0400 [thread overview] Message-ID: <CADnq5_Mf3hpqnbgywSD68CmUe3dYrwjdZpFaMDrMWazDxBFWcg@mail.gmail.com> (raw) In-Reply-To: <20220404233306.2207-1-h0tc0d3@gmail.com> 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 >
WARNING: multiple messages have this Message-ID (diff)
From: Alex Deucher <alexdeucher@gmail.com> To: Grigory Vasilyev <h0tc0d3@gmail.com> Cc: "Rodrigo Siqueira" <Rodrigo.Siqueira@amd.com>, "Melissa Wen" <mwen@igalia.com>, "Pan, Xinhui" <Xinhui.Pan@amd.com>, LKML <linux-kernel@vger.kernel.org>, "amd-gfx list" <amd-gfx@lists.freedesktop.org>, "David Airlie" <airlied@linux.ie>, "Claudio Suarez" <cssk@net-c.es>, "Maling list - DRI developers" <dri-devel@lists.freedesktop.org>, "Alex Deucher" <alexander.deucher@amd.com>, "Christian König" <christian.koenig@amd.com> Subject: Re: [PATCH] drm/amdgpu: Junk code Date: Tue, 5 Apr 2022 09:56:10 -0400 [thread overview] Message-ID: <CADnq5_Mf3hpqnbgywSD68CmUe3dYrwjdZpFaMDrMWazDxBFWcg@mail.gmail.com> (raw) In-Reply-To: <20220404233306.2207-1-h0tc0d3@gmail.com> 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 >
next prev parent reply other threads:[~2022-04-05 13:56 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-04 23:33 [PATCH] drm/amdgpu: Junk code Grigory Vasilyev 2022-04-04 23:33 ` Grigory Vasilyev 2022-04-04 23:33 ` Grigory Vasilyev 2022-04-05 13:56 ` Alex Deucher [this message] 2022-04-05 13:56 ` Alex Deucher
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=CADnq5_Mf3hpqnbgywSD68CmUe3dYrwjdZpFaMDrMWazDxBFWcg@mail.gmail.com \ --to=alexdeucher@gmail.com \ --cc=Rodrigo.Siqueira@amd.com \ --cc=Xinhui.Pan@amd.com \ --cc=airlied@linux.ie \ --cc=alexander.deucher@amd.com \ --cc=amd-gfx@lists.freedesktop.org \ --cc=christian.koenig@amd.com \ --cc=cssk@net-c.es \ --cc=dri-devel@lists.freedesktop.org \ --cc=h0tc0d3@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=mwen@igalia.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.