[ Upstream commit d07fdf9225922d3e36ebd13ccab3df62b1ccdab3 ]
DRM may support multiple in-kernel clients that run as soon as a DRM
driver has been registered. To select the client(s) in a single place,
introduce drm_client_setup().
Drivers that call the new helper automatically instantiate the kernel's
configured default clients. Only fbdev emulation is currently supported.
Later versions can add support for DRM-based logging, a boot logo or even
a console.
Some drivers handle the color mode for clients internally. Provide the
helper drm_client_setup_with_color_mode() for them.
Using the new interface requires the driver to select
DRM_CLIENT_SELECTION in its Kconfig. For now this only enables the
client-setup helpers if the fbdev client has been configured by the
user. A future patchset will further modularize client support and
rework DRM_CLIENT_SELECTION to select the correct dependencies for
all its clients.
v5:
- add CONFIG_DRM_CLIENT_SELECTION und DRM_CLIENT_SETUP
v4:
- fix docs for drm_client_setup_with_fourcc() (Geert)
v3:
- fix build error
v2:
- add drm_client_setup_with_fourcc() (Laurent)
- push default-format handling into actual clients
Change-Id: I78a2e4fec8c831d13a16a66f57a91e2e7a6fc1c5
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240924071734.98201-5-tzimmermann@suse.de
Stable-dep-of: 6b481ab0e685 ("drm/nouveau: select FW caching")
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 09d1157182)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
27 lines
776 B
C
27 lines
776 B
C
/* SPDX-License-Identifier: MIT */
|
|
|
|
#ifndef DRM_CLIENT_SETUP_H
|
|
#define DRM_CLIENT_SETUP_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
struct drm_device;
|
|
struct drm_format_info;
|
|
|
|
#if defined(CONFIG_DRM_CLIENT_SETUP)
|
|
void drm_client_setup(struct drm_device *dev, const struct drm_format_info *format);
|
|
void drm_client_setup_with_fourcc(struct drm_device *dev, u32 fourcc);
|
|
void drm_client_setup_with_color_mode(struct drm_device *dev, unsigned int color_mode);
|
|
#else
|
|
static inline void drm_client_setup(struct drm_device *dev,
|
|
const struct drm_format_info *format)
|
|
{ }
|
|
static inline void drm_client_setup_with_fourcc(struct drm_device *dev, u32 fourcc)
|
|
{ }
|
|
static inline void drm_client_setup_with_color_mode(struct drm_device *dev,
|
|
unsigned int color_mode)
|
|
{ }
|
|
#endif
|
|
|
|
#endif
|