From: Hamza Mahfooz <hamza.mahfooz@amd.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
harry.wentland@amd.com, sunpeng.li@amd.com,
Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com,
christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com,
daniel@ffwll.ch, aurabindo.pillai@amd.com, roman.li@amd.com,
hersenxs.wu@amd.com, stylon.wang@amd.com
Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/amd/display: Slightly optimize dm_dmub_outbox1_low_irq()
Date: Wed, 22 Mar 2023 11:15:47 -0400 [thread overview]
Message-ID: <a7e45c16-cfc7-691c-8bf9-c187f85b7679@amd.com> (raw)
In-Reply-To: <b7cff2c1976308c64951d466fd627989ef6e46fb.1679421347.git.christophe.jaillet@wanadoo.fr>
On 3/21/23 13:58, Christophe JAILLET wrote:
> A kzalloc()+memcpy() can be optimized in a single kmemdup().
> This saves a few cycles because some memory doesn't need to be zeroed.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Applied, thanks!
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index 5bac5781a06b..57a5fbdab890 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -820,15 +820,14 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params)
> DRM_ERROR("Failed to allocate dmub_hpd_wrk");
> return;
> }
> - dmub_hpd_wrk->dmub_notify = kzalloc(sizeof(struct dmub_notification), GFP_ATOMIC);
> + dmub_hpd_wrk->dmub_notify = kmemdup(¬ify, sizeof(struct dmub_notification),
> + GFP_ATOMIC);
> if (!dmub_hpd_wrk->dmub_notify) {
> kfree(dmub_hpd_wrk);
> DRM_ERROR("Failed to allocate dmub_hpd_wrk->dmub_notify");
> return;
> }
> INIT_WORK(&dmub_hpd_wrk->handle_hpd_work, dm_handle_hpd_work);
> - if (dmub_hpd_wrk->dmub_notify)
> - memcpy(dmub_hpd_wrk->dmub_notify, ¬ify, sizeof(struct dmub_notification));
> dmub_hpd_wrk->adev = adev;
> if (notify.type == DMUB_NOTIFICATION_HPD) {
> plink = adev->dm.dc->links[notify.link_index];
--
Hamza
prev parent reply other threads:[~2023-03-22 15:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 17:58 Christophe JAILLET
2023-03-22 15:15 ` Hamza Mahfooz [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=a7e45c16-cfc7-691c-8bf9-c187f85b7679@amd.com \
--to=hamza.mahfooz@amd.com \
--cc=Rodrigo.Siqueira@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=airlied@gmail.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=aurabindo.pillai@amd.com \
--cc=christian.koenig@amd.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=harry.wentland@amd.com \
--cc=hersenxs.wu@amd.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=roman.li@amd.com \
--cc=stylon.wang@amd.com \
--cc=sunpeng.li@amd.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®