From: Melissa Wen <mwen@igalia.com>
To: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Cc: Emma Anholt <emma@anholt.net>, David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
dan.carpenter@oracle.com
Subject: Re: [PATCH] drm/v3d: Use kvcalloc
Date: Mon, 28 Mar 2022 11:25:36 -0100 [thread overview]
Message-ID: <20220328122536.cobmqclwtl2ca6k4@mail.igalia.com> (raw)
In-Reply-To: <20220312152656.51625-1-harshit.m.mogalapalli@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 1423 bytes --]
On 03/12, Harshit Mogalapalli wrote:
> kvcalloc is same as kvmalloc_array + __GFP_ZERO.
>
> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
> ---
> drivers/gpu/drm/v3d/v3d_gem.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/v3d/v3d_gem.c b/drivers/gpu/drm/v3d/v3d_gem.c
> index c7ed2e1cbab6..f7d37228461e 100644
> --- a/drivers/gpu/drm/v3d/v3d_gem.c
> +++ b/drivers/gpu/drm/v3d/v3d_gem.c
> @@ -308,9 +308,8 @@ v3d_lookup_bos(struct drm_device *dev,
> return -EINVAL;
> }
>
> - job->bo = kvmalloc_array(job->bo_count,
> - sizeof(struct drm_gem_cma_object *),
> - GFP_KERNEL | __GFP_ZERO);
> + job->bo = kvcalloc(job->bo_count, sizeof(struct drm_gem_cma_object *),
> + GFP_KERNEL);
Hi Harshit,
This change seems valid to me, but I believe, in this point, v3d should
move to use the DRM function `drm_gem_objects_lookup()`, and then your
change goes there, since drm_get_objects_lookup() has the same issue
you're pointing. What do you think?
I already sent a patchset to replace steps in v3d_lookup_bos() by
drm_gem_objects_lookup(), as I mentioned. The patchset is here:
https://patchwork.freedesktop.org/series/101610/
Willing to review it? ^
Thanks,
Melissa
> if (!job->bo) {
> DRM_DEBUG("Failed to allocate validated BO pointers\n");
> return -ENOMEM;
> --
> 2.31.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-03-28 12:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-12 15:26 Harshit Mogalapalli
2022-03-12 22:27 ` Joe Perches
2022-03-13 6:05 ` Harshit Mogalapalli
2022-03-28 12:25 ` Melissa Wen [this message]
2022-03-29 12:01 ` Harshit Mogalapalli
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=20220328122536.cobmqclwtl2ca6k4@mail.igalia.com \
--to=mwen@igalia.com \
--cc=airlied@linux.ie \
--cc=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emma@anholt.net \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=linux-kernel@vger.kernel.org \
/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®