From: Daniel Vetter <daniel@ffwll.ch>
To: Thomas Zimmermann <tzimmermann@suse.de>
Cc: kieran.bingham+renesas@ideasonboard.com,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
airlied@linux.ie, daniel@ffwll.ch, eric@anholt.net,
Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/cma-helper: Implement mmap as GEM CMA object functions
Date: Thu, 14 Jan 2021 18:19:57 +0100 [thread overview]
Message-ID: <YAB9PRxbDMfvd2dB@phenom.ffwll.local> (raw)
In-Reply-To: <d6b5376d-05c9-bb43-3071-820d675d921e@suse.de>
On Thu, Jan 14, 2021 at 02:26:41PM +0100, Thomas Zimmermann wrote:
> From d0583fe22cd0cd29749ff679e46e13b58de325cb Mon Sep 17 00:00:00 2001
> From: Thomas Zimmermann <tzimmermann@suse.de>
> Date: Thu, 14 Jan 2021 14:21:51 +0100
> Subject: [PATCH] drm/cma: Set vma ops in mmap function
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/drm_gem_cma_helper.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_gem_cma_helper.c b/drivers/gpu/drm/drm_gem_cma_helper.c
> index 7942cf05cd93..0bd192736169 100644
> --- a/drivers/gpu/drm/drm_gem_cma_helper.c
> +++ b/drivers/gpu/drm/drm_gem_cma_helper.c
> @@ -489,6 +489,8 @@ int drm_gem_cma_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
> struct drm_gem_cma_object *cma_obj;
> int ret;
>
> + vma->vm_ops = obj->funcs->vm_ops;
I think this should be done in core, otherwise we have tons of refcount
leaks. I think this was an oversight when we've done that refactoring.
Also drivers can easily overwrite this one if they really have to, but not
assigned this is a clear bug.
-Daniel
> +
> /*
> * Clear the VM_PFNMAP flag that was set by drm_gem_mmap(), and set the
> * vm_pgoff (used as a fake buffer offset by DRM) to 0 as we want to map
> --
> 2.29.2
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
prev parent reply other threads:[~2021-01-14 17:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20201123115646.11004-1-tzimmermann@suse.de>
[not found] ` <20201123115646.11004-3-tzimmermann@suse.de>
2021-01-14 12:51 ` [PATCH 2/2] drm/cma-helper: Implement mmap as GEM CMA object functions Kieran Bingham
2021-01-14 13:26 ` Thomas Zimmermann
2021-01-14 14:34 ` Kieran Bingham
2021-01-14 15:15 ` Thomas Zimmermann
2021-01-14 16:28 ` Kieran Bingham
2021-01-15 8:15 ` Thomas Zimmermann
2021-01-14 17:19 ` Daniel Vetter [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=YAB9PRxbDMfvd2dB@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
/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