From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: linaro-kernel@lists.linaro.org, michel@daenzer.net,
philippe.cornu@st.com, dri-devel@lists.freedesktop.org,
yannick.fertre@st.com, airlied@redhat.com
Subject: Re: [PATCH v4 2/4] fbmem: add a default get_fb_unmapped_area function
Date: Wed, 07 Dec 2016 16:35:34 +0200 [thread overview]
Message-ID: <8725304.BWVgPDhfvh@avalon> (raw)
In-Reply-To: <1481105211-18020-3-git-send-email-benjamin.gaignard@linaro.org>
Hi Benjamin,
Thank you for the patch.
On Wednesday 07 Dec 2016 11:06:49 Benjamin Gaignard wrote:
> Allow generic frame-buffer to provide a default
> get_fb_unmapped_area function if specific devices need it.
>
> Usually this function is defined in architecture directories but
> define it here may limit code duplication especially for all ARM
> platforms without MMU.
I still would like to see an explanation why an architecture-specific version
is sometimes needed, and why this implementation is a reasonable default.
Furthermore, it looks very similar to the blackfin implementation, so if you
can't unify the two I'd like to know why.
> version 4:
> - introdude a configuration flag to be independent of architecture
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
> ---
> drivers/video/fbdev/Kconfig | 8 ++++++++
> drivers/video/fbdev/core/fbmem.c | 15 +++++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index 5d3b0db..922e4ea 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -138,6 +138,14 @@ config FB_SYS_IMAGEBLIT
> blitting. This is used by drivers that don't provide their own
> (accelerated) version and the framebuffer is in system RAM.
>
> +config FB_PROVIDE_GET_FB_UNMAPPED_AREA
> + bool
> + depends on FB
> + default n
> + ---help---
> + Allow generic frame-buffer to provide get_fb_unmapped_area
> + function.
> +
> menuconfig FB_FOREIGN_ENDIAN
> bool "Framebuffer foreign endianness support"
> depends on FB
> diff --git a/drivers/video/fbdev/core/fbmem.c
> b/drivers/video/fbdev/core/fbmem.c index 76c1ad9..22321a2 100644
> --- a/drivers/video/fbdev/core/fbmem.c
> +++ b/drivers/video/fbdev/core/fbmem.c
> @@ -1492,6 +1492,21 @@ static long fb_compat_ioctl(struct file *file,
> unsigned int cmd, return 0;
> }
>
> +#ifdef CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA
> +unsigned long get_fb_unmapped_area(struct file *filp,
> + unsigned long addr, unsigned long len,
> + unsigned long pgoff, unsigned long flags)
> +{
> + struct fb_info * const info = filp->private_data;
> + unsigned long fb_size = PAGE_ALIGN(info->fix.smem_len);
> +
> + if (pgoff > fb_size || len > fb_size - pgoff)
> + return -EINVAL;
> +
> + return (unsigned long)info->screen_base + pgoff;
> +}
> +#endif
> +
> static const struct file_operations fb_fops = {
> .owner = THIS_MODULE,
> .read = fb_read,
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-12-07 14:35 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 10:06 [PATCH v4 0/4] DRM: allow to use mmuless devices Benjamin Gaignard
2016-12-07 10:06 ` [PATCH v4 1/4] nommu: allow mmap when !CONFIG_MMU Benjamin Gaignard
2016-12-07 10:06 ` [PATCH v4 2/4] fbmem: add a default get_fb_unmapped_area function Benjamin Gaignard
2016-12-07 14:35 ` Laurent Pinchart [this message]
2016-12-07 14:57 ` Benjamin Gaignard
2016-12-07 15:19 ` Laurent Pinchart
2016-12-07 15:31 ` Benjamin Gaignard
2016-12-07 10:06 ` [PATCH v4 3/4] drm: compile drm_vm.c only when needed Benjamin Gaignard
2016-12-07 14:34 ` Laurent Pinchart
2016-12-07 10:06 ` [PATCH v4 4/4] drm: allow to use mmuless SoC Benjamin Gaignard
2016-12-07 10:27 ` Daniel Vetter
2016-12-07 10:42 ` Benjamin Gaignard
2016-12-07 14:32 ` Laurent Pinchart
2016-12-07 14:49 ` Daniel Vetter
2016-12-07 15:19 ` Benjamin Gaignard
2016-12-07 16:17 ` Eric Engestrom
2016-12-07 20:44 ` Arnd Bergmann
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=8725304.BWVgPDhfvh@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=airlied@redhat.com \
--cc=benjamin.gaignard@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=michel@daenzer.net \
--cc=philippe.cornu@st.com \
--cc=yannick.fertre@st.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 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.