linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: daniel@ffwll.ch, airlied@linux.ie, mripard@kernel.org,
	maarten.lankhorst@linux.intel.com, deller@gmx.de,
	javierm@redhat.com
Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org,
	Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH 7/9] drm/fb-helper: Provide fbdev deferred-I/O helpers
Date: Thu,  3 Mar 2022 21:58:37 +0100	[thread overview]
Message-ID: <20220303205839.28484-8-tzimmermann@suse.de> (raw)
In-Reply-To: <20220303205839.28484-1-tzimmermann@suse.de>

Add drm_fb_helper_vm_page_mkwrite(), a helper to track pages written
by fbdev userspace. DRM drivers should use this function to implement
fbdev deferred I/O.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/drm_fb_helper.c | 10 ++++++++++
 include/drm/drm_fb_helper.h     |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 9d1140a789f4..6203f5ab33af 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -760,6 +760,16 @@ void drm_fb_helper_deferred_io(struct fb_info *info,
 }
 EXPORT_SYMBOL(drm_fb_helper_deferred_io);
 
+vm_fault_t drm_fb_helper_vm_page_mkwrite(struct drm_fb_helper *fb_helper, struct vm_fault *vmf)
+{
+	struct fb_info *info = fb_helper->fbdev;
+
+	if (!info->fbdefio)
+		return 0;
+	return fb_deferred_io_page_mkwrite(info, vmf);
+}
+EXPORT_SYMBOL(drm_fb_helper_vm_page_mkwrite);
+
 /**
  * drm_fb_helper_sys_read - wrapper around fb_sys_read
  * @info: fb_info struct pointer
diff --git a/include/drm/drm_fb_helper.h b/include/drm/drm_fb_helper.h
index 3af4624368d8..8994c65f0b5a 100644
--- a/include/drm/drm_fb_helper.h
+++ b/include/drm/drm_fb_helper.h
@@ -232,6 +232,9 @@ void drm_fb_helper_fill_info(struct fb_info *info,
 void drm_fb_helper_deferred_io(struct fb_info *info,
 			       struct list_head *pagelist);
 
+vm_fault_t drm_fb_helper_vm_page_mkwrite(struct drm_fb_helper *fb_helper,
+					 struct vm_fault *vmf);
+
 ssize_t drm_fb_helper_sys_read(struct fb_info *info, char __user *buf,
 			       size_t count, loff_t *ppos);
 ssize_t drm_fb_helper_sys_write(struct fb_info *info, const char __user *buf,
@@ -355,6 +358,12 @@ static inline void drm_fb_helper_deferred_io(struct fb_info *info,
 {
 }
 
+static inline vm_fault_t drm_fb_helper_vm_page_mkwrite(struct drm_fb_helper *fb_helper,
+						       struct vm_fault *vmf)
+{
+	return 0;
+}
+
 static inline int drm_fb_helper_defio_init(struct drm_fb_helper *fb_helper)
 {
 	return -ENODEV;
-- 
2.35.1


  parent reply	other threads:[~2022-03-03 20:58 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 20:58 [PATCH 0/9] drm: Support GEM SHMEM fbdev without shadow FB Thomas Zimmermann
2022-03-03 20:58 ` [PATCH 1/9] drm/simpledrm: Use fbdev defaults for shadow buffering Thomas Zimmermann
2022-03-08  9:31   ` Javier Martinez Canillas
2022-03-08  9:56     ` Thomas Zimmermann
2022-03-08  9:58       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 2/9] fbdev: Put mmap for deferred I/O into drivers Thomas Zimmermann
2022-03-08 14:03   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 3/9] fbdev: Track deferred-I/O pages in pageref struct Thomas Zimmermann
2022-03-08 14:42   ` Javier Martinez Canillas
2022-03-09  8:36     ` Thomas Zimmermann
2022-03-09 11:21       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 4/9] fbdev: Export helper for implementing page_mkwrite Thomas Zimmermann
2022-03-08 17:21   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 5/9] drm/fb-helper: Separate deferred I/O from shadow buffers Thomas Zimmermann
2022-03-08 17:24   ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 6/9] drm/fb-helper: Provide callback to create fbdev dumb buffers Thomas Zimmermann
2022-03-08 17:51   ` Javier Martinez Canillas
2022-03-09  8:42     ` Thomas Zimmermann
2022-03-15 19:11     ` Thomas Zimmermann
2022-03-03 20:58 ` Thomas Zimmermann [this message]
2022-03-08 18:56   ` [PATCH 7/9] drm/fb-helper: Provide fbdev deferred-I/O helpers Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 8/9] drm/gem-shmem: Implement fbdev dumb buffer and mmap helpers Thomas Zimmermann
2022-03-08 19:29   ` Javier Martinez Canillas
2022-03-09  8:47     ` Thomas Zimmermann
2022-03-09 11:25       ` Javier Martinez Canillas
2022-03-03 20:58 ` [PATCH 9/9] drm/virtio: Implement dumb_create_fbdev with GEM SHMEM helpers Thomas Zimmermann
2022-03-08 19:37   ` Javier Martinez Canillas
2022-03-09  8:52     ` Thomas Zimmermann
2022-03-09 11:29       ` Javier Martinez Canillas
2022-03-08  9:13 ` [PATCH 0/9] drm: Support GEM SHMEM fbdev without shadow FB Javier Martinez Canillas
2022-03-08  9:44   ` Thomas Zimmermann

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=20220303205839.28484-8-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    /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).