summaryrefslogtreecommitdiff
path: root/include/drm/drm_fbdev_shmem.h
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-04-19 10:29:01 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2024-05-02 11:33:15 +0200
commit150f431a08317e0e0363a7f9147b6246d3b40ba6 (patch)
tree8f691901d5ef6d81a57919e0b2f6489f79e91b08 /include/drm/drm_fbdev_shmem.h
parent747bda7bb5b1644a06734900326847a5d353c448 (diff)
downloadlinux-150f431a08317e0e0363a7f9147b6246d3b40ba6.tar.gz
linux-150f431a08317e0e0363a7f9147b6246d3b40ba6.tar.bz2
linux-150f431a08317e0e0363a7f9147b6246d3b40ba6.zip
drm/fbdev: Add fbdev-shmem
Add an fbdev emulation for SHMEM-based memory managers. The code is similar to fbdev-generic, but does not require an additional shadow buffer for mmap(). Fbdev-shmem operates directly on the buffer object's SHMEM pages. Fbdev's deferred-I/O mechanism updates the hardware state on write operations. The memory pages of GEM SHMEM cannot be detected by fbdefio. Therefore fbdev-shmem implements the .get_page() hook in struct fb_deferred_io. The fbdefio helpers call this hook to retrieve the page directly from fbdev-shmem instead of trying to detect it internally. v3: - clarify on get_page mechanism in commit description (Javier) v2: - use drm_driver_legacy_fb_format() (Geert) Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240419083331.7761-9-tzimmermann@suse.de
Diffstat (limited to 'include/drm/drm_fbdev_shmem.h')
-rw-r--r--include/drm/drm_fbdev_shmem.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/drm/drm_fbdev_shmem.h b/include/drm/drm_fbdev_shmem.h
new file mode 100644
index 000000000000..fb43cadd1950
--- /dev/null
+++ b/include/drm/drm_fbdev_shmem.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: MIT */
+
+#ifndef DRM_FBDEV_SHMEM_H
+#define DRM_FBDEV_SHMEM_H
+
+struct drm_device;
+
+#ifdef CONFIG_DRM_FBDEV_EMULATION
+void drm_fbdev_shmem_setup(struct drm_device *dev, unsigned int preferred_bpp);
+#else
+static inline void drm_fbdev_shmem_setup(struct drm_device *dev, unsigned int preferred_bpp)
+{ }
+#endif
+
+#endif