From: Alex Deucher <alexdeucher@gmail.com>
To: Tom Rix <trix@redhat.com>
Cc: evan.quan@amd.com, alexander.deucher@amd.com,
christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
daniel@ffwll.ch, Hawking.Zhang@amd.com, kenneth.feng@amd.com,
tim.huang@amd.com, lijo.lazar@amd.com, mario.limonciello@amd.com,
dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/pm: change pmfw_decoded_link_width, speed variables to globals
Date: Fri, 14 Apr 2023 17:41:51 -0400 [thread overview]
Message-ID: <CADnq5_N2j-ASAUS4Y9rmAnPyKzJ47bS4PD6y93041-dCttt8NA@mail.gmail.com> (raw)
In-Reply-To: <20230414120344.3170942-1-trix@redhat.com>
Applied. Thanks!
Alex
On Fri, Apr 14, 2023 at 8:04 AM Tom Rix <trix@redhat.com> wrote:
>
> gcc with W=1 reports
> In file included from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu13/smu_v13_0.c:36:
> ./drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0.h:66:18: error:
> ‘pmfw_decoded_link_width’ defined but not used [-Werror=unused-const-variable=]
> 66 | static const int pmfw_decoded_link_width[7] = {0, 1, 2, 4, 8, 12, 16};
> | ^~~~~~~~~~~~~~~~~~~~~~~
> ./drivers/gpu/drm/amd/amdgpu/../pm/swsmu/inc/smu_v13_0.h:65:18: error:
> ‘pmfw_decoded_link_speed’ defined but not used [-Werror=unused-const-variable=]
> 65 | static const int pmfw_decoded_link_speed[5] = {1, 2, 3, 4, 5};
> | ^~~~~~~~~~~~~~~~~~~~~~~
>
> These variables are defined and used in smu_v13_0_7_ppt.c and smu_v13_0_0_ppt.c.
> There should be only one definition. So define the variables as globals
> in smu_v13_0.c
>
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
> drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h | 4 ++--
> drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 3 +++
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
> index 7944ce80e5c3..df3baaab0037 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
> +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
> @@ -62,8 +62,8 @@
> #define CTF_OFFSET_HOTSPOT 5
> #define CTF_OFFSET_MEM 5
>
> -static const int pmfw_decoded_link_speed[5] = {1, 2, 3, 4, 5};
> -static const int pmfw_decoded_link_width[7] = {0, 1, 2, 4, 8, 12, 16};
> +extern const int pmfw_decoded_link_speed[5];
> +extern const int pmfw_decoded_link_width[7];
>
> #define DECODE_GEN_SPEED(gen_speed_idx) (pmfw_decoded_link_speed[gen_speed_idx])
> #define DECODE_LANE_WIDTH(lane_width_idx) (pmfw_decoded_link_width[lane_width_idx])
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
> index 73175c993da9..393c6a7b9609 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c
> @@ -85,6 +85,9 @@ MODULE_FIRMWARE("amdgpu/smu_13_0_10.bin");
> static const int link_width[] = {0, 1, 2, 4, 8, 12, 16};
> static const int link_speed[] = {25, 50, 80, 160};
>
> +const int pmfw_decoded_link_speed[5] = {1, 2, 3, 4, 5};
> +const int pmfw_decoded_link_width[7] = {0, 1, 2, 4, 8, 12, 16};
> +
> int smu_v13_0_init_microcode(struct smu_context *smu)
> {
> struct amdgpu_device *adev = smu->adev;
> --
> 2.27.0
>
prev parent reply other threads:[~2023-04-14 21:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 12:03 [PATCH] drm/amd/pm: change pmfw_decoded_link_width,speed " Tom Rix
2023-04-14 21:41 ` Alex Deucher [this message]
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_N2j-ASAUS4Y9rmAnPyKzJ47bS4PD6y93041-dCttt8NA@mail.gmail.com \
--to=alexdeucher@gmail.com \
--cc=Hawking.Zhang@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=evan.quan@amd.com \
--cc=kenneth.feng@amd.com \
--cc=lijo.lazar@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=tim.huang@amd.com \
--cc=trix@redhat.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®