From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v4] DRM: add drm gem CMA helper
Date: Wed, 08 Aug 2012 18:31:23 +0200 [thread overview]
Message-ID: <1514673.2bbekI2AVd@avalon> (raw)
In-Reply-To: <502292FA.6070109@metafoo.de>
Hi Lars,
On Wednesday 08 August 2012 18:25:30 Lars-Peter Clausen wrote:
> On 08/08/2012 04:44 PM, Laurent Pinchart wrote:
> > On Wednesday 27 June 2012 15:30:18 Sascha Hauer wrote:
> >> Many embedded drm devices do not have a IOMMU and no dedicated
> >> memory for graphics. These devices use CMA (Contiguous Memory
> >> Allocator) backed graphics memory. This patch provides helper
> >> functions to be able to share the code. The code technically does
> >> not depend on CMA as the backend allocator, the name has been chosen
> >> because cma makes for a nice, short but still descriptive function
> >> prefix.
> >>
> >> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> >> ---
> >>
> >> changes since v3:
> >> - *really* use DIV_ROUND_UP(args->width * args->bpp, 8) to calculate the
> >> pitch changes since v2:
> >> - make drm_gem_cma_create_with_handle static
> >> - use DIV_ROUND_UP(args->width * args->bpp, 8) to calculate the pitch
> >> - make drm_gem_cma_vm_ops const
> >> - add missing #include <linux/export.h>
> >> changes since v1:
> >> - map whole buffer at mmap time, not page by page at fault time
> >> - several cleanups as suggested by Lars-Peter Clausen and Laurent
> >> Pinchart
> >>
> >> drivers/gpu/drm/Kconfig | 6 +
> >> drivers/gpu/drm/Makefile | 1 +
> >> drivers/gpu/drm/drm_gem_cma_helper.c | 251
> >> +++++++++++++++++++++++++++++++
> >> include/drm/drm_gem_cma_helper.h | 44 ++++++
> >> 4 files changed, 302 insertions(+)
> >> create mode 100644 drivers/gpu/drm/drm_gem_cma_helper.c
> >> create mode 100644 include/drm/drm_gem_cma_helper.h
> >>
> >> diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
> >> index dc5df12..8f362ec 100644
> >> --- a/drivers/gpu/drm/Kconfig
> >> +++ b/drivers/gpu/drm/Kconfig
> >> @@ -53,6 +53,12 @@ config DRM_TTM
> >>
> >> GPU memory types. Will be enabled automatically if a device driver
> >> uses it.
> >>
> >> +config DRM_GEM_CMA_HELPER
> >> + tristate
> >> + depends on DRM
> >> + help
> >> + Choose this if you need the GEM CMA helper functions
> >> +
> >>
> >> config DRM_TDFX
> >>
> >> tristate "3dfx Banshee/Voodoo3+"
> >> depends on DRM && PCI
> >>
> >> diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
> >> index 0487ff6..8759cda 100644
> >> --- a/drivers/gpu/drm/Makefile
> >> +++ b/drivers/gpu/drm/Makefile
> >> @@ -15,6 +15,7 @@ drm-y := drm_auth.o drm_buffer.o drm_bufs.o
> >> drm_cache.o \ drm_trace_points.o drm_global.o drm_prime.o
> >>
> >> drm-$(CONFIG_COMPAT) += drm_ioc32.o
> >>
> >> +drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
> >
> > This results in a built failure for me with
> >
> > CONFIG_DRM=y
> > CONFIG_DRM_KMS_HELPER=m
> > # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set
> > CONFIG_DRM_GEM_CMA_HELPER=m
> > CONFIG_DRM_KMS_CMA_HELPER=m
> >
> > drm_gem_cma_helper.o isn't compiled at all. Can you reproduce the problem
> > ?
>
> The Kconfig entry needs to be bool instead of tristate.
That's my preferred solution as well. I'll modify the patch in my tree, unless
Sascha wants to submit a v5.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2012-08-08 16:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-27 13:30 [PATCH v4] DRM: add drm gem CMA helper Sascha Hauer
2012-06-27 13:47 ` Laurent Pinchart
2012-07-18 14:17 ` Lars-Peter Clausen
2012-08-08 14:44 ` Laurent Pinchart
2012-08-08 16:25 ` Lars-Peter Clausen
2012-08-08 16:31 ` Laurent Pinchart [this message]
2012-08-08 21:02 ` Dave Airlie
2012-08-08 21:29 ` Laurent Pinchart
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=1514673.2bbekI2AVd@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=lars@metafoo.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