linux-yocto/include/drm/drm_fbdev_ttm.h
Thomas Zimmermann dad0617fe3 drm/fbdev-ttm: Support struct drm_driver.fbdev_probe
[ Upstream commit c7c1b9e1d5 ]

Rework fbdev probing to support fbdev_probe in struct drm_driver
and reimplement the old fb_probe callback on top of it. Provide an
initializer macro for struct drm_driver that sets the callback
according to the kernel configuration.

This change allows the common fbdev client to run on top of TTM-
based DRM drivers.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-65-tzimmermann@suse.de
Stable-dep-of: 6b481ab0e6 ("drm/nouveau: select FW caching")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-03-13 13:02:03 +01:00

29 lines
682 B
C

/* SPDX-License-Identifier: MIT */
#ifndef DRM_FBDEV_TTM_H
#define DRM_FBDEV_TTM_H
#include <linux/stddef.h>
struct drm_device;
struct drm_fb_helper;
struct drm_fb_helper_surface_size;
#ifdef CONFIG_DRM_FBDEV_EMULATION
int drm_fbdev_ttm_driver_fbdev_probe(struct drm_fb_helper *fb_helper,
struct drm_fb_helper_surface_size *sizes);
#define DRM_FBDEV_TTM_DRIVER_OPS \
.fbdev_probe = drm_fbdev_ttm_driver_fbdev_probe
void drm_fbdev_ttm_setup(struct drm_device *dev, unsigned int preferred_bpp);
#else
#define DRM_FBDEV_TTM_DRIVER_OPS \
.fbdev_probe = NULL
static inline void drm_fbdev_ttm_setup(struct drm_device *dev, unsigned int preferred_bpp)
{ }
#endif
#endif