diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-01-25 21:04:11 +0100 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-01-26 08:52:31 +0100 |
commit | 6c80a93be62d398e1854d95069340b2e60f96166 (patch) | |
tree | c107a876390a29d6fb351bd1f47d81be79ee63da /drivers/gpu/drm/drm_fbdev_generic.c | |
parent | ec9361a1374f8f1ff23d5b6c217326648a8191de (diff) | |
download | lwn-6c80a93be62d398e1854d95069340b2e60f96166.tar.gz lwn-6c80a93be62d398e1854d95069340b2e60f96166.zip |
drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function
Initialize the fb-helper's preferred_bpp field early from within
drm_fb_helper_prepare(); instead of the later client hot-plugging
callback. This simplifies the generic fbdev setup function.
No real changes, but all drivers' fbdev code has to be adapted.
v3:
* build with CONFIG_DRM_FBDEV_EMULATION unset (kernel test bot)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230125200415.14123-7-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/drm_fbdev_generic.c')
-rw-r--r-- | drivers/gpu/drm/drm_fbdev_generic.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 63f66325a8a5..6ae014040df3 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -392,7 +392,7 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client) if (!drm_drv_uses_atomic_modeset(dev)) drm_helper_disable_unused_functions(dev); - ret = drm_fb_helper_initial_config(fb_helper, fb_helper->preferred_bpp); + ret = drm_fb_helper_initial_config(fb_helper); if (ret) goto err_cleanup; @@ -454,7 +454,7 @@ void drm_fbdev_generic_setup(struct drm_device *dev, fb_helper = kzalloc(sizeof(*fb_helper), GFP_KERNEL); if (!fb_helper) return; - drm_fb_helper_prepare(dev, fb_helper, &drm_fb_helper_generic_funcs); + drm_fb_helper_prepare(dev, fb_helper, preferred_bpp, &drm_fb_helper_generic_funcs); ret = drm_client_init(dev, &fb_helper->client, "fbdev", &drm_fbdev_client_funcs); if (ret) { @@ -462,21 +462,6 @@ void drm_fbdev_generic_setup(struct drm_device *dev, goto err_drm_client_init; } - /* - * Pick a preferred bpp of 32 if no value has been given. This - * will select XRGB8888 for the framebuffer formats. All drivers - * have to support XRGB8888 for backwards compatibility with legacy - * userspace, so it's the safe choice here. - * - * TODO: Replace struct drm_mode_config.preferred_depth and this - * bpp value with a preferred format that is given as struct - * drm_format_info. Then derive all other values from the - * format. - */ - if (!preferred_bpp) - preferred_bpp = 32; - fb_helper->preferred_bpp = preferred_bpp; - ret = drm_fbdev_client_hotplug(&fb_helper->client); if (ret) drm_dbg_kms(dev, "client hotplug ret=%d\n", ret); |