From: Thomas Zimmermann <tzimmermann@suse.de>
To: javierm@redhat.com, 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>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Subject: [PATCH v2 08/11] drm/omapdrm: Use GEM mmap for fbdev emulation
Date: Thu, 6 Jul 2023 14:46:46 +0200 [thread overview]
Message-ID: <20230706124905.15134-9-tzimmermann@suse.de> (raw)
In-Reply-To: <20230706124905.15134-1-tzimmermann@suse.de>
The fbdev emulation currently uses fbdev's default mmap code, which
has been written for I/O memory. Provide an mmap that uses GEM's mmap
infrastructure.
Utilize fine-grained fbdev macros to initialize struct fb_ops. The
macros set the read/write and the draw callbacks for DMA memory. Set
the fb_mmap callback to omapdrm's new mmap helper. Also select the
correct Kconfig token for fbdev's DMA helpers. Note that the DMA
helpers are the same as for system memory.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/gpu/drm/omapdrm/Kconfig | 2 +-
drivers/gpu/drm/omapdrm/omap_fbdev.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index b4ac76c9f31b..d3c4877e465c 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -4,7 +4,7 @@ config DRM_OMAP
depends on DRM && OF
depends on ARCH_OMAP2PLUS
select DRM_KMS_HELPER
- select FB_SYS_HELPERS if DRM_FBDEV_EMULATION
+ select FB_DMA_HELPERS if DRM_FBDEV_EMULATION
select VIDEOMODE_HELPERS
select HDMI
default n
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index b7ccce0704a3..b1a2d00ef52d 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -76,6 +76,15 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,
return drm_fb_helper_pan_display(var, fbi);
}
+static int omap_fbdev_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
+{
+ struct drm_fb_helper *helper = info->par;
+ struct drm_framebuffer *fb = helper->fb;
+ struct drm_gem_object *bo = drm_gem_fb_get_obj(fb, 0);
+
+ return drm_gem_mmap_obj(bo, omap_gem_mmap_size(bo), vma);
+}
+
static void omap_fbdev_fb_destroy(struct fb_info *info)
{
struct drm_fb_helper *helper = info->par;
@@ -97,14 +106,16 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)
static const struct fb_ops omap_fb_ops = {
.owner = THIS_MODULE,
- FB_DEFAULT_SYS_OPS,
+ __FB_DEFAULT_DMA_OPS_RDWR,
.fb_check_var = drm_fb_helper_check_var,
.fb_set_par = drm_fb_helper_set_par,
.fb_setcmap = drm_fb_helper_setcmap,
.fb_blank = drm_fb_helper_blank,
.fb_pan_display = omap_fbdev_pan_display,
+ __FB_DEFAULT_DMA_OPS_DRAW,
.fb_ioctl = drm_fb_helper_ioctl,
- .fb_destroy = omap_fbdev_fb_destroy,
+ .fb_mmap = omap_fbdev_fb_mmap,
+ .fb_destroy = omap_fbdev_fb_destroy,
};
static int omap_fbdev_create(struct drm_fb_helper *helper,
--
2.41.0
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: javierm@redhat.com, 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>,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Subject: [PATCH v2 08/11] drm/omapdrm: Use GEM mmap for fbdev emulation
Date: Thu, 6 Jul 2023 14:46:46 +0200 [thread overview]
Message-ID: <20230706124905.15134-9-tzimmermann@suse.de> (raw)
In-Reply-To: <20230706124905.15134-1-tzimmermann@suse.de>
The fbdev emulation currently uses fbdev's default mmap code, which
has been written for I/O memory. Provide an mmap that uses GEM's mmap
infrastructure.
Utilize fine-grained fbdev macros to initialize struct fb_ops. The
macros set the read/write and the draw callbacks for DMA memory. Set
the fb_mmap callback to omapdrm's new mmap helper. Also select the
correct Kconfig token for fbdev's DMA helpers. Note that the DMA
helpers are the same as for system memory.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/gpu/drm/omapdrm/Kconfig | 2 +-
drivers/gpu/drm/omapdrm/omap_fbdev.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index b4ac76c9f31b..d3c4877e465c 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -4,7 +4,7 @@ config DRM_OMAP
depends on DRM && OF
depends on ARCH_OMAP2PLUS
select DRM_KMS_HELPER
- select FB_SYS_HELPERS if DRM_FBDEV_EMULATION
+ select FB_DMA_HELPERS if DRM_FBDEV_EMULATION
select VIDEOMODE_HELPERS
select HDMI
default n
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index b7ccce0704a3..b1a2d00ef52d 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -76,6 +76,15 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,
return drm_fb_helper_pan_display(var, fbi);
}
+static int omap_fbdev_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
+{
+ struct drm_fb_helper *helper = info->par;
+ struct drm_framebuffer *fb = helper->fb;
+ struct drm_gem_object *bo = drm_gem_fb_get_obj(fb, 0);
+
+ return drm_gem_mmap_obj(bo, omap_gem_mmap_size(bo), vma);
+}
+
static void omap_fbdev_fb_destroy(struct fb_info *info)
{
struct drm_fb_helper *helper = info->par;
@@ -97,14 +106,16 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)
static const struct fb_ops omap_fb_ops = {
.owner = THIS_MODULE,
- FB_DEFAULT_SYS_OPS,
+ __FB_DEFAULT_DMA_OPS_RDWR,
.fb_check_var = drm_fb_helper_check_var,
.fb_set_par = drm_fb_helper_set_par,
.fb_setcmap = drm_fb_helper_setcmap,
.fb_blank = drm_fb_helper_blank,
.fb_pan_display = omap_fbdev_pan_display,
+ __FB_DEFAULT_DMA_OPS_DRAW,
.fb_ioctl = drm_fb_helper_ioctl,
- .fb_destroy = omap_fbdev_fb_destroy,
+ .fb_mmap = omap_fbdev_fb_mmap,
+ .fb_destroy = omap_fbdev_fb_destroy,
};
static int omap_fbdev_create(struct drm_fb_helper *helper,
--
2.41.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: javierm@redhat.com, maarten.lankhorst@linux.intel.com,
mripard@kernel.org
Cc: linux-fbdev@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
dri-devel@lists.freedesktop.org,
Thomas Zimmermann <tzimmermann@suse.de>,
linux-tegra@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 08/11] drm/omapdrm: Use GEM mmap for fbdev emulation
Date: Thu, 6 Jul 2023 14:46:46 +0200 [thread overview]
Message-ID: <20230706124905.15134-9-tzimmermann@suse.de> (raw)
In-Reply-To: <20230706124905.15134-1-tzimmermann@suse.de>
The fbdev emulation currently uses fbdev's default mmap code, which
has been written for I/O memory. Provide an mmap that uses GEM's mmap
infrastructure.
Utilize fine-grained fbdev macros to initialize struct fb_ops. The
macros set the read/write and the draw callbacks for DMA memory. Set
the fb_mmap callback to omapdrm's new mmap helper. Also select the
correct Kconfig token for fbdev's DMA helpers. Note that the DMA
helpers are the same as for system memory.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/gpu/drm/omapdrm/Kconfig | 2 +-
drivers/gpu/drm/omapdrm/omap_fbdev.c | 15 +++++++++++++--
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig
index b4ac76c9f31b..d3c4877e465c 100644
--- a/drivers/gpu/drm/omapdrm/Kconfig
+++ b/drivers/gpu/drm/omapdrm/Kconfig
@@ -4,7 +4,7 @@ config DRM_OMAP
depends on DRM && OF
depends on ARCH_OMAP2PLUS
select DRM_KMS_HELPER
- select FB_SYS_HELPERS if DRM_FBDEV_EMULATION
+ select FB_DMA_HELPERS if DRM_FBDEV_EMULATION
select VIDEOMODE_HELPERS
select HDMI
default n
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index b7ccce0704a3..b1a2d00ef52d 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -76,6 +76,15 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,
return drm_fb_helper_pan_display(var, fbi);
}
+static int omap_fbdev_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
+{
+ struct drm_fb_helper *helper = info->par;
+ struct drm_framebuffer *fb = helper->fb;
+ struct drm_gem_object *bo = drm_gem_fb_get_obj(fb, 0);
+
+ return drm_gem_mmap_obj(bo, omap_gem_mmap_size(bo), vma);
+}
+
static void omap_fbdev_fb_destroy(struct fb_info *info)
{
struct drm_fb_helper *helper = info->par;
@@ -97,14 +106,16 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)
static const struct fb_ops omap_fb_ops = {
.owner = THIS_MODULE,
- FB_DEFAULT_SYS_OPS,
+ __FB_DEFAULT_DMA_OPS_RDWR,
.fb_check_var = drm_fb_helper_check_var,
.fb_set_par = drm_fb_helper_set_par,
.fb_setcmap = drm_fb_helper_setcmap,
.fb_blank = drm_fb_helper_blank,
.fb_pan_display = omap_fbdev_pan_display,
+ __FB_DEFAULT_DMA_OPS_DRAW,
.fb_ioctl = drm_fb_helper_ioctl,
- .fb_destroy = omap_fbdev_fb_destroy,
+ .fb_mmap = omap_fbdev_fb_mmap,
+ .fb_destroy = omap_fbdev_fb_destroy,
};
static int omap_fbdev_create(struct drm_fb_helper *helper,
--
2.41.0
next prev parent reply other threads:[~2023-07-06 12:50 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-06 12:46 [PATCH v2 00/11] drm: Improve fbdev emulation for DMA-able framebuffers Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 01/11] fbdev: Add fb_ops init macros for framebuffers in DMA-able memory Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 02/11] drm/fbdev-dma: Use fbdev DMA helpers Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 03/11] drm/tegra: " Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 04/11] drm/tegra: Set fbdev FBINFO_VIRTFB flag Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 14:31 ` Thierry Reding
2023-07-06 14:31 ` Thierry Reding
2023-07-06 14:31 ` Thierry Reding
2023-07-06 14:47 ` Thomas Zimmermann
2023-07-06 14:47 ` Thomas Zimmermann
2023-07-06 14:47 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 05/11] drm/exynos: Use fbdev DMA helpers Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 06/11] drm/exynos: Set fbdev FBINFO_VIRTFB flag Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-07 2:01 ` 대인기/Tizen Platform Lab(SR)/삼성전자
2023-07-07 2:01 ` 대인기/Tizen Platform Lab(SR)/삼성전자
2023-07-07 2:01 ` 대인기/Tizen Platform Lab(SR)/삼성전자
2023-07-06 12:46 ` [PATCH v2 07/11] drm/omapdrm: Set VM flags in GEM-object mmap function Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann [this message]
2023-07-06 12:46 ` [PATCH v2 08/11] drm/omapdrm: Use GEM mmap for fbdev emulation Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 09/11] drm/omapdrm: Set fbdev FBINFO_VIRTFB flag Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 10/11] fbdev: Remove FB_DEFAULT_SYS_OPS Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` [PATCH v2 11/11] fbdev: Harmonize some comments in <linux/fb.h> Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 12:46 ` Thomas Zimmermann
2023-07-06 13:07 ` Javier Martinez Canillas
2023-07-06 13:07 ` Javier Martinez Canillas
2023-07-06 13:07 ` Javier Martinez Canillas
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=20230706124905.15134-9-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--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=tomi.valkeinen@ideasonboard.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.