From b79fe9abd58bab7363583d30d67a5385ed779616 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Mon, 13 Mar 2023 16:51:14 +0100 Subject: drm/fbdev-dma: Implement fbdev emulation for GEM DMA helpers Implement fbdev emulation that is optimized for drivers that use DMA helpers. The buffers may no tbe moveable, may not require damage handling and have to be located in system memory. This allows fbdev emulation to operate directly on the buffer and mmap it to userspace. Besides those constraints, the emulation works like in the generic code. As an internal DRM client provides, it receives hotplug, restore and unregister events. The DRM client is independent from the fbdev probing, which runs on the first successful hotplug event. The emulation is part of the DMA helper module and not build unless DMA helpers and fbdev emulation has been configured. Tested with vc4. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230313155138.20584-2-tzimmermann@suse.de --- include/drm/drm_fbdev_dma.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/drm/drm_fbdev_dma.h (limited to 'include/drm/drm_fbdev_dma.h') diff --git a/include/drm/drm_fbdev_dma.h b/include/drm/drm_fbdev_dma.h new file mode 100644 index 000000000000..2da7ee784133 --- /dev/null +++ b/include/drm/drm_fbdev_dma.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: MIT */ + +#ifndef DRM_FBDEV_DMA_H +#define DRM_FBDEV_DMA_H + +struct drm_device; + +#ifdef CONFIG_DRM_FBDEV_EMULATION +void drm_fbdev_dma_setup(struct drm_device *dev, unsigned int preferred_bpp); +#else +static inline void drm_fbdev_dma_setup(struct drm_device *dev, unsigned int preferred_bpp) +{ } +#endif + +#endif -- cgit v1.2.3