linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javierm@redhat.com>
To: Thomas Zimmermann <tzimmermann@suse.de>,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org
Cc: dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-fbdev@vger.kernel.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Helge Deller <deller@gmx.de>
Subject: Re: [PATCH 01/10] fbdev: Add fb_ops init macros for framebuffers in DMA-able memory
Date: Wed, 05 Jul 2023 10:23:03 +0200	[thread overview]
Message-ID: <875y6ysr6g.fsf@minerva.mail-host-address-is-not-set> (raw)
In-Reply-To: <20230704160133.20261-2-tzimmermann@suse.de>

Thomas Zimmermann <tzimmermann@suse.de> writes:

Hello Thomas,

> Add initializer macros for struct fb_ops for framebuffers in DMA-able
> memory areas. Also add a corresponding Kconfig token. As of now, this
> is equivalent to system framebuffers and mostly useful for labeling
> drivers correctly.
>
> A later patch may add a generic DMA-specific mmap operation. Linux
> offers a number of dma_mmap_*() helpers for different use cases.
>
> Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: Helge Deller <deller@gmx.de>
> ---
>  drivers/video/fbdev/Kconfig |  8 ++++++++
>  include/linux/fb.h          | 13 +++++++++++++
>  2 files changed, 21 insertions(+)
>
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index cecf15418632..f14229757311 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -168,6 +168,14 @@ config FB_DEFERRED_IO
>  	bool
>  	depends on FB
>  
> +config FB_DMA_HELPERS
> +	bool
> +	depends on FB
> +	select FB_SYS_COPYAREA
> +	select FB_SYS_FILLRECT
> +	select FB_SYS_FOPS
> +	select FB_SYS_IMAGEBLIT
> +
>  config FB_IO_HELPERS
>  	bool
>  	depends on FB
> diff --git a/include/linux/fb.h b/include/linux/fb.h
> index 1d5c13f34b09..1191a78c5289 100644
> --- a/include/linux/fb.h
> +++ b/include/linux/fb.h
> @@ -594,6 +594,19 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
>  	__FB_DEFAULT_SYS_OPS_DRAW, \
>  	__FB_DEFAULT_SYS_OPS_MMAP
>  
> +/*
> + * Helpers for framebuffers in DMA-able memory
> + */
> +

The comment for I/O memory helpers says:

/*
 * Initializes struct fb_ops for framebuffers in I/O memory.
 */

I think that would be good to have consistency between these two,
so something like:

/*
 * Initializes struct fb_ops for framebuffers in DMA-able memory.
 */

> +#define __FB_DEFAULT_DMA_OPS_RDWR \
> +	.fb_read	= fb_sys_read, \
> +	.fb_write	= fb_sys_write
> +
> +#define __FB_DEFAULT_DMA_OPS_DRAW \
> +	.fb_fillrect	= sys_fillrect, \
> +	.fb_copyarea	= sys_copyarea, \
> +	.fb_imageblit	= sys_imageblit
> +

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


  reply	other threads:[~2023-07-05  8:24 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-04 15:49 [PATCH 00/10] drm: Improve fbdev emulation for DMA-able framebuffers Thomas Zimmermann
2023-07-04 15:49 ` [PATCH 01/10] fbdev: Add fb_ops init macros for framebuffers in DMA-able memory Thomas Zimmermann
2023-07-05  8:23   ` Javier Martinez Canillas [this message]
2023-07-05  9:08     ` Thomas Zimmermann
2023-07-05  9:13       ` Javier Martinez Canillas
2023-07-04 15:49 ` [PATCH 02/10] drm/fbdev-dma: Use fbdev DMA helpers Thomas Zimmermann
2023-07-05  8:24   ` Javier Martinez Canillas
2023-07-04 15:50 ` [PATCH 03/10] drm/tegra: " Thomas Zimmermann
2023-07-05  8:24   ` Javier Martinez Canillas
2023-07-04 15:50 ` [PATCH 04/10] drm/tegra: Set fbdev flags Thomas Zimmermann
2023-07-05  8:34   ` Javier Martinez Canillas
2023-07-05  9:19     ` Thomas Zimmermann
2023-07-05  9:34       ` Javier Martinez Canillas
2023-07-06 12:44         ` Thomas Zimmermann
2023-07-04 15:50 ` [PATCH 05/10] drm/exynos: Use fbdev DMA helpers Thomas Zimmermann
2023-07-05  2:10   ` 대인기/Tizen Platform Lab(SR)/삼성전자
2023-07-05  8:38   ` Javier Martinez Canillas
2023-07-04 15:50 ` [PATCH 06/10] drm/exynos: Set fbdev flags Thomas Zimmermann
2023-07-05  8:49   ` Javier Martinez Canillas
2023-07-05  9:31     ` Thomas Zimmermann
2023-07-05  9:53       ` Javier Martinez Canillas
2023-07-04 15:50 ` [PATCH 07/10] drm/omapdrm: Set VM flags in GEM-object mmap function Thomas Zimmermann
2023-07-05  9:03   ` Javier Martinez Canillas
2023-07-04 15:50 ` [PATCH 08/10] drm/omapdrm: Use GEM mmap for fbdev emulation Thomas Zimmermann
2023-07-05  9:05   ` Javier Martinez Canillas
2023-07-04 15:50 ` [PATCH 09/10] drm/omapdrm: Set fbdev flags Thomas Zimmermann
2023-07-05  9:07   ` Javier Martinez Canillas
2023-07-04 15:50 ` [PATCH 10/10] fbdev: Remove FB_DEFAULT_SYS_OPS Thomas Zimmermann
2023-07-05  9:07   ` Javier Martinez Canillas
2023-07-05  8:30 ` [PATCH 00/10] drm: Improve fbdev emulation for DMA-able framebuffers Maxime Ripard

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=875y6ysr6g.fsf@minerva.mail-host-address-is-not-set \
    --to=javierm@redhat.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux-tegra@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;
as well as URLs for NNTP newsgroup(s).