[ Upstream commit 5d08c44e47b9d41366714552bdd374ac4b595591 ]
Add an fbdev client that can work with any memory manager. The
client implementation is the same as existing code in fbdev-dma or
fbdev-shmem.
Provide struct drm_driver.fbdev_probe for the new client to allocate
the surface GEM buffer. The new callback replaces fb_probe of struct
drm_fb_helper_funcs, which does the same.
To use the new client, DRM drivers set fbdev_probe in their struct
drm_driver instance and call drm_fbdev_client_setup(). Probing and
creating the fbdev surface buffer is now independent from the other
operations in struct drm_fb_helper. For the pixel format, the fbdev
client either uses a specified format, the value in preferred_depth
or 32-bit RGB.
v2:
- test for struct drm_fb_helper.funcs for NULL (Sui)
- respect struct drm_mode_config.preferred_depth for default format
Change-Id: I50035b52dfef65794ea7057ae0aeaa580defd9c7
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-4-tzimmermann@suse.de
Stable-dep-of: 6b481ab0e685 ("drm/nouveau: select FW caching")
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 7f5535fcbb)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
20 lines
404 B
C
20 lines
404 B
C
/* SPDX-License-Identifier: MIT */
|
|
|
|
#ifndef DRM_FBDEV_CLIENT_H
|
|
#define DRM_FBDEV_CLIENT_H
|
|
|
|
struct drm_device;
|
|
struct drm_format_info;
|
|
|
|
#ifdef CONFIG_DRM_FBDEV_EMULATION
|
|
int drm_fbdev_client_setup(struct drm_device *dev, const struct drm_format_info *format);
|
|
#else
|
|
static inline int drm_fbdev_client_setup(struct drm_device *dev,
|
|
const struct drm_format_info *format)
|
|
{
|
|
return 0;
|
|
}
|
|
#endif
|
|
|
|
#endif
|