From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: kernel@pengutronix.de, dri-devel@lists.freedesktop.org,
Rob Clark <rob.clark@linaro.org>
Subject: Re: [PATCH] DRM: add drm gem CMA helper
Date: Thu, 31 May 2012 11:41:45 +0200 [thread overview]
Message-ID: <1540988.s7dT6vcBqX@avalon> (raw)
In-Reply-To: <20120530162812.GL30400@pengutronix.de>
Hi Sascha,
On Wednesday 30 May 2012 18:28:12 Sascha Hauer wrote:
> On Wed, May 30, 2012 at 05:40:13PM +0200, Laurent Pinchart wrote:
> > Hi Sascha,
> >
> > Thank you for the patch. I've successfully tested the helper with the new
> > SH Mobile DRM driver. Just a couple of comments below in addition to
> > Lars' comments (this is not a full review, just details that caught my
> > attention when comparing the code with my implementation, and trying to
> > use it).
> > > +/*
> > > + * drm_gem_cma_mmap - (struct file_operation)->mmap callback function
> > > + */
> > > +int drm_gem_cma_mmap(struct file *filp, struct vm_area_struct *vma)
> > > +{
> > > + int ret;
> > > +
> > > + ret = drm_gem_mmap(filp, vma);
> > > + if (ret)
> > > + return ret;
> > > +
> > > + vma->vm_flags &= ~VM_PFNMAP;
> > > + vma->vm_flags |= VM_MIXEDMAP;
> >
> > Why is this a mixed map ?
>
> Honestly, I don't know. This is copied from the exynos driver. I don't
> know much about these flags, so if you think something else is better
> here than you're probably right ;)
I wouldn't claim to be an expert on this matter :-) As far as I know, PFNMAP
means that the mapping refers to physical memory with no struct page
associated with it (that could be I/O memory, DRAM reserved at boot time, ...
basically any memory outside of the system memory resources controlled by the
kernel page allocator). MIXEDMAP means that the mapping refers to memory that
contains both PFNMAP regions and non-PFNMAP regions. I would be surprised if
dma_alloc_writecombine() returned such a mix. On the other hand the memory it
returns might be PFNMAP or non-PFNMAP depending on the underneath allocator,
maybe that's why VM_MIXEDMAP was used.
I'd appreciate an expert's opinion on this :-)
> > > +
> > > + return ret;
> > > +}
> > > +EXPORT_SYMBOL_GPL(drm_gem_cma_mmap);
> >
> > My implementation maps the whole buffer in one go at mmap time, not page
> > by page at page fault time. Isn't that more efficient when mapping frame
> > buffer memory ?
>
> I remember Alan has mentioned this in an earlier review. I'll update the
> patch accordingly.
>
> I will fix this and the other things you mentioned and repost.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2012-05-31 9:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-29 14:10 [PATCH] DRM: add drm gem CMA helper Sascha Hauer
2012-05-29 14:46 ` Lars-Peter Clausen
2012-05-29 15:26 ` Lars-Peter Clausen
2012-05-29 16:06 ` Sascha Hauer
2012-05-29 18:20 ` [PATCH 1/2] DRM: Add DRM kms/fb cma helper Lars-Peter Clausen
2012-05-29 18:20 ` [PATCH 2/2] DRM: imx: Use new fb cma helper functions Lars-Peter Clausen
2012-05-30 10:16 ` [PATCH 1/2] DRM: Add DRM kms/fb cma helper Sascha Hauer
2012-05-30 15:40 ` [PATCH] DRM: add drm gem CMA helper Laurent Pinchart
2012-05-30 16:28 ` Sascha Hauer
2012-05-31 9:41 ` Laurent Pinchart [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-06-27 13:00 Sascha Hauer
2012-06-27 13:20 ` Laurent Pinchart
2012-06-27 13:43 ` Sascha Hauer
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=1540988.s7dT6vcBqX@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@pengutronix.de \
--cc=rob.clark@linaro.org \
--cc=s.hauer@pengutronix.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 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.